User Defined Messages - Value [modified]
-
The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006
-
The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006
Cliff Hatch wrote:
The help files recommend that user messages be defined in the range WM_USER to 0x7fff...
It should be
WM_APP
.
"The largest fire starts but with the smallest spark." - David Crow
-
Cliff Hatch wrote:
The help files recommend that user messages be defined in the range WM_USER to 0x7fff...
It should be
WM_APP
.
"The largest fire starts but with the smallest spark." - David Crow
Depends on the usage. If you are defining a message that will only be used within the application, then use WM_APP. If the message is for a control that could be used in other apps the use WM_USER. If it is a message that is used to communicate between different modules then use ::RegisterWindowMessage().
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!
-
Depends on the usage. If you are defining a message that will only be used within the application, then use WM_APP. If the message is for a control that could be used in other apps the use WM_USER. If it is a message that is used to communicate between different modules then use ::RegisterWindowMessage().
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!
PJ Arends wrote:
If the message is for a control that could be used in other apps the use WM_USER.
WM_USER
should not be used at it can conflict with messages that Microsoft uses.RegisterWindowMessage()
is the safest/preferred method in any case.
"The largest fire starts but with the smallest spark." - David Crow
-
PJ Arends wrote:
If the message is for a control that could be used in other apps the use WM_USER.
WM_USER
should not be used at it can conflict with messages that Microsoft uses.RegisterWindowMessage()
is the safest/preferred method in any case.
"The largest fire starts but with the smallest spark." - David Crow
Thanks guys. I can see that there is a problem if messages conflict, but what's puzzling me is why does it matter what the value is so long as it is unique - and if I use the Resource Symbols dialog to create it, doesn't that guarantee uniqueness? Is it a matter of standardisation and ease of maintenance perhaps? Best Regards Cliff
-
The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006
See Which message numbers belong to whom?[^]
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
See Which message numbers belong to whom?[^]
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Thanks Michael, that answers my question perfectly. :) Best Regards Cliff