A customer, via their customer liaison, reported quite some time ago that their program stopped working on Windows XP. (I told you it was quite some time ago.)
The customer’s investigations revealed that the problem occurred because their window was receiving message 0x0091, and the parameters are wrong. Who is sending this message with the wrong parameters?
Okay, first of all, how do you even know that the parameters are wrong? The message is not listed in winuser.h or in MSDN (as it was then called).
We explained that message 0x0091 is an internal message that they should just pass to DefÂWindowÂProc unchanged. What makes the customer think that the message is being received with the wrong parameters?
The customer said that their program was using that message as a custom message, and now, in addition to getting it when their program sends the message, they are also getting spurious copies of the message with WPARAM and LPARAM values that don’t correspond to any values that the program itself sent.
We informed them that they shouldn’t have been using that message for their own purposes. Those messages are in the system-defined range, which means that they are off-limits to applications. If they want to send a private message, use one in the application space.
It’s like finding an empty closet in an office building and using it to store your bicycle, but now, when you come to work, you find that the closet is filled with other stuff and there’s no room for your bicycle any more. “Why is there stuff in that closet?” Because it wasn’t your closet in the first place.
The liaison took our advice back to the customer, but mentioned that the customer probably won’t like that answer. The message 0x0091 was not the only message they were using. They also used other messages below WM_, and they were all causing problems; they just wanted to start their investigation with 0x0091.
Oh well. But I hope it’s as simple as just changing a macro definition from
#define WM_MYSECRETMESSAGE 0x0091
to
#define WM_MYSECRETMESSAGE (WM_APP + 1020) // or something
Pick a message in the range available to applications for custom use.
0 comments
Be the first to start the discussion.