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).
发送消息 is used to send the message directly.
Note: This function calls the Windows API named 传递消息. It is used to perform low-level tasks on the controls and windows. To find out the meaning of each message (and its 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.
外部代码"WinConst.wl"
// Simulate a click on a button
传递消息(句柄(BTN_BUTTON1),WM_LBUTTONDOWN,0,0)
传递消息(句柄(BTN_BUTTON1),WM_LBUTTONUP,0,0)
语法
<Result> = 传递消息(<hWnd> , <Windows Message> , <wParam> , <lParam>)
<Result>: Boolean
- 真 if the operation was successful,
- 假 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 句柄 (for the WinDev objects) or 系统窗口句柄.
<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 different possible messages are defined in the "WINCONST.WL" file available in the directory of (Personal\External sub-directory). To use this file in your applications, use the following code:
外部代码"WINCONST.wl"
传递消息(句柄(EDT_EDIT1),WM_MOUSEMOVE,0,0)