you can use any UINT value as a messege value. But it should be unique from already existing values. So generally what we does to create a user defined message is
#define MY_CUSTOM_MSG WM_APP + 1
you can sent/post the message using the sendmessage or postmessage function.
And you can add an event handler for this message inside the messagemap as follows.
ON_MESSAGE( MY_CUSTOM_MSG, OnMyMessage )
It is important that you define the
OnMyMessage
as follows
LRESULT OnMyMessage (WPARAM wParam, LPARAM lParam);
Please note that this kind of message is local to your process, if you want to sent message from one process to another, then you have to create the mesasge using
RegisterWindowMessage[
^] function. The message map entry for this type of message is
ON_REGISTERED_MESSAGE
.