|
-
July 28th, 2003, 03:21 AM
#13
Ahh, thanks for the explanation.
That given, I thought it might be the best way to implement the WndProc like this:
Code:
LRESULT CALLBACK WndProc( ... )
{
switch(message)
{
case WM_WHATEVER:
// handle the message or not...
break;
}
return DefWindowProc(...);
}
With this code, empty case blocks would not lead to an error, right? Because I always break to the end and return the default procedure. I have seen this approach in a sample code.
I'm currently only returning the default procedure when entering the 'default' case in the switch statement, otherwise I always return 0L. As far as I know, returning 0 tells the program that I handled a message successfully, therefor I'm a bit confused that rxbagain said CreateWindowEx failed because I always returned FALSE (0) in my Window Proc.
Can you clarify this?
- Matthias
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." - Bjarne Stroustrup
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|