DWORD SendMessage(hWnd,wMsg,wParam,lParam)
This function sends a message to a window or windows. The SendMessage function does not return until the message has been processed. If the window that receives the message is part of the same application, the window function is called immediately as a subroutine.
If the window is part of another task, Windows switches to the appropriate task and calls the appropriate window function, and then passes the message to the window function. The message is not placed in the destination application's queue.
Parameter | Type/Description |
hWnd | HWND Identifies the window that is to receive the message. If the hWnd parameter is 0xFFFF, the message is sent to all pop-up windows in the system. The message is not sent to child windows. | |
wMsg | WORD Specifies the message to be sent. | |
wParam | WORD Specifies additional message information. | |
lParam | DWORD Specifies additional message information. |
The return value specifies the outcome of the function. It is the value returned by the window function that received the message; its value depends on the message being sent.
If a system running Windows is configured for expanded memory (EMS) and an application sends a message (by using the SendMessage function) with related data (that is pointed to by the lParam parameter) to a second application, the first application must place the data (that lParam points to) in global memory allocated by the GlobalAlloc function and the GMEM_LOWER flag. Note that this allocation of memory is only necessary if lParam contains a pointer.