PDA

Click to See Complete Forum and Search --> : Raising windows message


softwareguy74
Jan 5th, 2001, 05:52 PM
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

parksie
Jan 6th, 2001, 04:07 AM
For user messages, they must have values between 0x8000 and 0xBFFF to guarantee that they do not conflict with any system messages.

Vlatko
Jan 6th, 2001, 05:07 AM
You can specify a user message like this:

#define MY_MESSAGE WM_USER + 1
#define MY_MESSAGE_2 WM_USER + 2

parksie
Jan 6th, 2001, 06:04 AM
WM_USER is also used by the other classes - only the range I gave is actually unused. MS says:

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.