Windows Messages

I need to send a custom windows message with a custom id that another application will listen to.

Is there a predefined range of message IDs that Windows reserves for internal messages like SQL Server (up to 50,000 for internal messages)?

+3


source to share


1 answer


The documentation says:

Messages with the app

An application can create messages to be used by its own windows, or communicate with windows in other processes. If the application creates its own messages, then the window procedure that receives them must interpret the messages and provide appropriate processing.

The message id values โ€‹โ€‹are used as follows:

  • The system reserves message ID values โ€‹โ€‹in the range 0x0000 to 0x03FF ( WM_USER value is 1) for system messages. Apps cannot use these values โ€‹โ€‹for private messages.
  • Values in the range 0x0400 (value WM_USER ) through 0x7FFF are available for message identifiers for private window classes.
  • If your application is version 4.0, you can use message id values โ€‹โ€‹in the range 0x8000 ( WM_APP ) through 0xBFFF for private messages.
  • The system returns a message ID in the range 0xC000 to 0xFFFF when an application calls the RegisterWindowMessage function to register a message. The message ID returned by this function is guaranteed to be unique throughout the system. Using this feature prevents conflicts that can arise if other applications use the same message ID for different purposes.


I suspect that RegisterWindowMessage

is the right choice for you.

+5


source







All Articles