-
Hi,
I'm implementing a function that requires me to specify a int value for a message to be received after the asynchronous function completes..
My question is, what range of values should a user defined message be in? Obviously, I don't want to specify a value that is already used by a Win32 windows message.
Any help would be appreciated..
Dan
-
For user messages, they must have values between 0x8000 and 0xBFFF to guarantee that they do not conflict with any system messages.
-
You can specify a user message like this:
Code:
#define MY_MESSAGE WM_USER + 1
#define MY_MESSAGE_2 WM_USER + 2
-
WM_USER is also used by the other classes - only the range I gave is actually unused. MS says:
Code:
0 through WM_USER – 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system for future use.