ProgramminFool
Technical User
I am moving (trying to!) from C++ console apps to windows apps. I have looked at some textbooks, and they explain that you need WinMain, sort of in place of main, and also a message handler or pump or something.
I understand that windows are sent messages and that it is generally a good idea to use a switch statement to use them. Is the function ALWAYS in the form: LRESULT CALLBACK WndProc (..blahblah...) ? Are there other ways to get these messages? I have seen a function called MsgHandler, what's that all about? I've seen PeekMessage();. Finally, what the heck is this?
I understand that windows are sent messages and that it is generally a good idea to use a switch statement to use them. Is the function ALWAYS in the form: LRESULT CALLBACK WndProc (..blahblah...) ? Are there other ways to get these messages? I have seen a function called MsgHandler, what's that all about? I've seen PeekMessage();. Finally, what the heck is this?
Code:
MSG Msg;
while(GetMessage(&Msg, NULL, 0, 0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
[\code]
Thanks for your time people, any help would be hugely appreciated.
------------------------------
“Talent is cheap, dedication is expensive. It will cost you your life.”