cSendMessage

The real SendMessage (or SendMessageA if you want to get nitpicky). 

Syntax:

cSendMessage(hWnd, msg, wparam, lparam)

Parameters:

(i) hWnd Window handle

(i) msg Message number

(i) wparam First message parameter

(i) lparam Second message parameter (must be numeric)

Returns:

(i) The value returned by the Windows
"SendMessage" function.

 

This function is designed to allow sophisticated users to access the Windows API "SendMessage" function directly. cSendMessage calls the Windows API "SendMessage" function with the specified parameters and sends the specified message to the given window.

 

Example:

AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
Run('Notepad.exe','')
WinWaitExist('~Notepad', 10)
WMCLOSE = 16 ; value of WM_CLOSE message
hwnd = DllHwnd("~Notepad")
If hwnd != 0
   cSendMessage(hwnd, WMCLOSE, 0, 0) ; send message
EndIf
Pause('Notice','Notepad opened then closed via cSendMessage of WMCLOSE')
Exit

See Also:

IntControl 22 (WIL help file)