====== SENDWINMSG method (System) ====== ==== Description ==== This method uses the Windows API SendMessage function to call the window procedure of the target window directly and does not return until the window procedure has processed the message. ==== Syntax ==== RetVal = Exec_Method( "SYSTEM", "SENDWINMSG", hwnd, uMsg, wParam, lParam ) ==== Parameters ==== ^Name^Required^Description^ |hwnd|Yes|A handle to the window whose window procedure is to receive the message.| |uMsg|Yes|Integer specifying the message to be sent.| |wParam|No|Message-specific integer value. Defaults to 0.| |IParam|No|Message-specific integer value. Defaults to 0.| ==== Returns ==== An integer value specifying the result of the processing – this depends on the message sent. ==== Remarks ==== While it is possible to use the Windows API SendMessage call with a PS object directly from Basic+, this may not be ideal in all circumstances as some window messages are sensitive to the thread that they are executed from. In this case the SENDWINMSG event should be used as it will send the message from the PS thread instead. Equates for the common window messages can be found the MSWin_WindowMessage_Equates insert record. This method uses the Windows API SendMessage function internally – for further information please see the MSDN website. ==== Example ==== //// Send a WM_CLOSE message to a form (this is basically the same as// //// calling it's CLOSE method).// $Insert MSWin_WindowMessage_Equates hwnd = Get_Property( "MYWIN", "HANDLE" ) uMsg = WM_CLOSE$ wParam = 0 lParam = 0 RetVal = Exec_Method( "SYSTEM", "SENDWINMSG", hwnd, uMsg, wParam, lParam ) ==== See Also ==== SYSTEM POSTWINMSG method, Common GUI QUALIFYWINEVENT method, Common GUI WINMSG event.