Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

WM_APP is too large for change detection message

I am trying to use change detection on a 6527 Digital I/O Board. When trying to use change detection it is required to pass in a user defined message that will be passed when a change is detected. The numerical value that is assigned to this message must be a short, which in Visual C++ 6.0 has a max value of 0x7FFF. The problem with that is that the first available value for user defined messages is WM_APP, which is defined by Windows to be 0x8000. This of course overflows the short that is passed to the change detection function. Is there a work around or update that corrects this issue?
0 Kudos
Message 1 of 3
(3,047 Views)
Typically you use WM_USER as a starting point for user defined messages. Here it is from the Platform SDK headers:

/*
* NOTE: All Message Numbers below 0x0400 are RESERVED.
*
* Private Window Messages Start Here:
*/
#define WM_USER 0x0400

Also, the WM_USER documentation specifies the following guidelines:

"The following are the ranges of message numbers:

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."

WM_USER is well within the range of a short, so you should be able to get this to work by defining your private message to be a small value above WM_USER.

- Elton
0 Kudos
Message 2 of 3
(3,047 Views)
It was my understanding the WM_USER had been depricated because the WM_USER messeges were conflicting with Microsoft messages.
http://www.codetools.com/dialog/messagemgmt.asp
0 Kudos
Message 3 of 3
(3,047 Views)