Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Windows Event functions
  • Constants defining the messages
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Sends a Windows message to a control or to a window. This message is stores in the queue of Windows messages (the call to this function is not locking: the program continues to run). SendMessage is used to send the message directly.
Remark: This function is a call to the Windows PostMessage API. It is used to perform low-level tasks on controls and windows. To find out the meaning of each message (and parameters), you must refer to the Windows API (WIN32).
Caution: The inappropriate use of this function can lead to very serious problems in your application and/or to malfunctions in the graphic interface.
EXTERN "WinConst.wl"
// Simulate a click on a button
PostMessage(Handle(BTN_BUTTON1), WM_LBUTTONDOWN, 0, 0)
PostMessage(Handle(BTN_BUTTON1), WM_LBUTTONUP, 0, 0)
<Result> = PostMessage(<hWnd> , <Windows message> , <wParam> , <lParam>)
<Result>: Boolean
  • True if the operation was successful,
  • False if an error occurred.
<hWnd>: Integer
Handle of the control or window to which the message must be sent. This control or this window can be objects that do not belong to a WINDEV application. The handle of a control or window can be calculated by Handle (for the WINDEV objects) or by SysWinHandle.
<Windows message>: Integer or character string
Number or name of the Windows message to send.
If a character string is used, RegisterWindowMessage is automatically called to get the corresponding message number.
If this parameter corresponds to a character string, this string is case sensitive.
<wParam>: Integer
Parameter whose use depends on the type of message sent.
<lParam>: Integer
Parameter whose use depends on the type of message sent.

Constants defining the messages

The constants that define the possible messages are defined in the "WINCONST.WL" file available in the WINDEV directory (Personal\External subdirectory). To use this file in your applications, use the following code:
EXTERN "WINCONST.wl"   // Defines the WM_MOUSEMOVE constant
PostMessage(Handle(EDT_EDIT1), WM_MOUSEMOVE, 0, 0)
Component: wd270obj.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 09/04/2023

Send a report | Local help