QA


Q&A

Q1:

What really happens when " Windows sends a program a message"?

A1:

When Windows sends a program a message, what really happens is that Windows calls the WndProc() function in the program, which is then responsible for performing an action based upon the message. Within the WndProc() function, there is a switch statement that looks at one of the function arguments to see what kind of message was sent from Windows. There are also a couple of arguments that contain data specific to the message.

Q2:

Why is it necessary for a main program window to have a window class?

A2:

Window classes are very important in Windows programming because they describe the general characteristics of a window. It is necessary to create a window class for a main program window because the window must be of a type that is uniquely identifiable to Windows. In other words, you can think of all the windows that are floating around in Windows as belonging to different window classes, whereas the main window of your Windows program belongs to its own unique class. In some ways, you can think of a window class as a license to create a certain kind of window.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net