Page 14 - DCAP408_WEB_PROGRAMMING
P. 14
Windows Programming
Notes
!
Caution If you do not recognize the absolute path of an application on your computer, right click
its icon positioned on the desktop – Properties – copy the path situated in the Destination field.
Task Write the steps for Running Several Programs Simultaneously.
Self Assessment
Fill in the blank:
5. If you do not recognize the absolute path of an application on your computer, right click
its icon positioned on the desktop ........................ copy the path situated in the Destination
field.
1.4 Messages
A computer application is prepared with Windows controls that permit the user to interrelate
with the computer. Each control generates messages and sends them to the operating system. To
supervise these messages, they are managed by a function pointer known as a Windows
procedure. This function can emerge as follows:
This function utilizes a switch control to list all essential messages and process each one in turn.
This processes just the messages that you ask it to. If you have available messages, and you will
always have unrefined messages, you can call the DefWindowProc() function at the end to take
over.
The most essential message you can process is to ensure a user can close a window after using it.
This can be completed with a function known as PostQuitMessage(). Its syntax is:
This function comprises one argument which is the value of the LPARAM argument. To close a
window, you can pass the argument as WM_QUIT.
Depending on this, a simple Windows procedure can be defined as below:
8 LOVELY PROFESSIONAL UNIVERSITY