I might be a little(...) sleep deprived, but I was rethinking my program design in whole, and I was wondering why precisely I need WndProc(). As I see it, the windows message loop is like this:
while(msg.message!=WM_QUIT) {
if(PeekMessage(&msg,0,0,0,PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Process();//or render or whatever you may want to do
}
So if there's a message, you remove it from windows' internal queue, translate and dispatch it so that windows can call your little personal function. Why not just call PeekMessage() and TranslateMessage() (translate only if you want the character messages), and then instead of dispatching, just process the message within your WinMain() or whatever, and assign 0 to WNDCLASS::lpfnWndProc when calling RegisterClass()? Is it just more standard? Or is there a technical reason that I overlooked?
For example-
while(msg.message!=WM_QUIT) {
if(PeekMessage(&msg,0,0,0,PM_REMOVE)) {
switch(msg.message) {
}
}
Process();//or render or whatever you may want to do
}
Edit - Anyone notice how the time zones etc for posts are different from those of the edits? Something I've seen for a while now, just curious if anyone else has.
[Edited by - CrazyCamel on July 21, 2006 4:27:32 AM]