Windows Messages

Hi everybody,
I'm asking for 2 things:

1-I want to know the equivelant Int value for some messages like WM_SETFOCUS , WM_ACTIVATEAPP ,..etc

From where can I get information about messages like that?

2-After catching a message sent to my application by overriding WndProc(),
Am I allowed to cancel or erase the effect of the received message? and how?
for Example: (When the user presses on Maximize button, I don'twant the window to be maximized).

thanks for Help
[521 byte] By [T i T i] at [2007-11-18 19:15:22]
# 1 Re: Windows Messages
Most of the Windows messsages are defined in windows.h or winuser.h. The easiest way to find the value for those messages is to right click on the one you want to know (in Visual Studio) and choose "Go to Definition".

As for cancelling a message, of course it is allowed. Basically just return true for any messages that you handle. Of course the effect of cancelling certain messages, will depend on the message, so you will have to check the documentation for each message for the specifics.
For example:

case WM_SIZE:
if ( (WPARAM) == SIZE_MAXIMIZED )
return true; // eat maximize message
else
// normal window sizing code, etc
RussG1 at 2007-11-9 13:09:56 >