windows programming

365-? Win CE Programming - writing text to the display

Building a program properly requires a lot of discipline:

1. define goals (what functionality will be achieved?)
2. write up a high level flow/state chart
3. create modular parts from the flow chart (e.g. functions)
4. create tests - e.g. know what input goes in and what should come out
5. fill in the functions with dummy information (e.g. always return constants)
6. integrate and ensure that your "demo" version achieves your goal

Note that all of this ignores the tools to be used, estimating time and cost, scheduling, etc.

365-? Windows CE programming: A win32 api button

Win CE uses a subset of the win32 API which is neat because technically anything written for it can be compiled for a "full" windows as well. 
 

365-36 Winclock v4 (failure is only feedback)

It seems I've bitten off more than I thought with regularly updating a Window every second...

I need to go back and learn more about how WM_PAINT works in windows because my current version is very funky... though it does work!

A couple of obvious other things: WM_TIMER and perhaps strcpy instead of get_current_time again...

The reason I've chosen the awkward system of getting the system time over and over instead of the "convenient" windows timer is that I'm trying to learn and understand what I can do with programming, not how to copy and paste someone else's function.

365-35 WinClock v3

My windows clock is slowly progressing...

Now I can create a window with a QUIT button and display the current system time (only once)...

If you want to know more about the project from the beginning search the site for winclock (or click on the time.h tag).

I've stripped out most of the project header stuff - perhaps in the future I'll just have it as an "include" so that it's in the project but since it doesn't change much I only have to look at it when I refer back to it (instead of at the top of the file ALL THE TIME!)

Ok, enough planning and review, here's the code:

365-29 WinCE custom Include to Modularize Functions

I've again used some "empty" time in the London Tube to stretch my brain a little bit by doing some more WinCE Windows Programming.
 
While it may not seem like much of an accomplishment, using my fingernail on the screen keyboard to eke out code on a moving underground train requires a certain zen attitude... wait... wait... hit the key... oh... the wrong thing showed up (because obviously I pressed the right key)...
 
ok, backspace and do it again... oh, that wasn't backspace, that was ]... and sometimes it looks like ]]]]].

365-23 Windows Programming in WinCE on an HP IPAQ

As the number of portable computers (we might call them mobile phones or smart phones or pda's etc.) explodes they need software. One thing Microsoft got right is that Windows CE, the stripped down version of Windows for Mobile Devices, uses most of the same basic programming platform/language as "normal" desktop windows programming. The following is a very interesting learning experience I've had (and a useful way to pass otherwise idle waiting time in the "Tube") programming Windows Applications in WinCE.

365-22 VBScript Windows Shell Script (Programming) For Loop

Programming obviously requires logic and discipline. Less well known but just as important, it also requires creativity and elasticity.

Windows Script programming has a significantly different syntax (rules of how the code must be written to be valid) than the previous Linux Script, C Programming, HTML, or CSS. How many people do you know who speak multiple languages, much less create functional artificial constructs with them?

365-6 A Simple Windows Button

Windows programming is a bit ugly - you have to selectively ignore the stuff "you know". On the positive side I've figured out how to insert code as preformatted (Drupal Input Filter -> extending the "safe HTML") so this should be easier to copy paste.
Also, Notepad2 has a handy "turn tabs into spaces" that I shall start using more often...

I've built on the previous Windows Program that put some text on the screen so most of it should look familiar.

365-4 First Real Windows Program

Windows Programming has a steep curve in the beginning as there are many things to memorize (oops I mean learn and understand) as theoretically they've created the data structures and functions to get stuff on the screen.

Again I've used gcc 2.95 windows port with the special command on my wndclass-hello.c source code.

gcc.exe -o %1.exe %1 -Iinclude -Llib -Wall -ansi -mwindows

The code is extra commented as this is the foundation (of understanding) for future programs.

365-2 Windows Program MessageBox

Programming in Windows is like building with legos. It can be easy and fun but at the same time very few of us have houses or cars made of legos. Of course, if you're writing an application for 90% of the computer users it will probably have to run on Windows.

I've programmed with Borland, Mingw, Visual Studio and my favorite, GCC.

The story of the GNU C Compiler (and Richard Stallman) is fascinating and reading "Free as in Freedom" really opened my eyes to the details of the shoulders of the giants that I'm standing upon.

Syndicate content