Friday, February 22, 2008

Structure of window program

Structure of window program:

A Window program performs two basic tasks:

• Creation of the program’s window and doing the tasks like setting aside memory space when the program is first loaded.

• Processing messages, which are received, from windows?



Application Creation Stage at API Programming:

We first design the user interface objects like menus, tool bars, status bars etc. This in turn creates resource files.

Then we have to concentrate on the writing the functional code to handle messages, this code is nothing but the source code.

After creating, both of them i.e., resource code and source code, they are builds and then executable file is created.

The general outline of the Window program is as follows:

Create the program’s window
Do any initialisation of variables
LOOP
Fetch messages sent by windows to this program

Is the message QUIT?
If the message = QUIT
{
Terminate the program;
Result control to windows;
}
If the message is another message
{
Do the appropriate actions based on the messages;
Return control to windows;
}
ENDLOOP

No comments: