4. How to start
After all this theory you might feel like doing something practical
now or at least to have a look at some real code. So how do we
start with a windows program? Actually there are two different
approaches.
- The first one is the "ordinary" way of doing it.
This is the way you will find in most books about Windows programming
and it requires almost exclusively coding (C or C++). This approach
features registering a window class and creating a window derived
from that class. Here you will learn a lot about message queues
and client areas. The problem with this approach is, that it takes
you a bit longer to get somewhere and if you are not that keen
on coding you might have a look at the other option.
- The second approach is a more interactive way of designing
an application and coding is here only the second thing in line.
This approach is especially suitable for simple programs but there
are no limits really. If you were to create something like the
calculator you get with windows say, your definitely better of
with this approach to start with. This approach is based on a
dialogue box which you design with a special interactive tool.
Afterwards you just add some code for each of the control elements
you used in your dialogue.
In fact almost every windows program features at least one dialogue
box and so you need the knowledge of approach two anyway. And
vice versa if you want to extend your dialogues with say you own
custom controls you need the knowledge of approach one. In fact
a complex windows program is always a mixture of both techniques.
However I reckon that even many people with Windows programming
experience are not aware of the fact, that almost every application
can be completely based on a dialogue box, simply because it is
not in the books.
So how far do we get with say 200 lines of code?
200 lines of code is not much and you'll be surprised how far
you'll get. The next two chapters give you an outline for a windows
program based on each of the two approaches. You don't have to
understand both approaches straight away. See which one you prefer
and try to modify and extend it a little bit. You can always come
back to the other approach later. Finally in chapter seven I will
then give you some ideas on how to build on the knowledge you
have acquired by giving you a free choice on where to go next.
Your choice:
Go back to previous chapter