ZenoTest
ZenoTest is a lightweight and powerful tool for Windows desktop UI test automation. Record, generate, and run automated tests efficiently for WPF, WinForms, and native apps.

SendMessage

int SendMessage(Handle hWnd, int msg, int wParam, int lParam)

Description
Sends a Windows message to the window identified by the given handle.
This function calls the Win32 API SendMessage internally and returns the result as an integer.
It can be used to interact with windows and controls at a low level, e.g. sending WM_CLOSE, BM_CLICK, or WM_SETTEXT.
The predefined Windows message constants (WM_CLOSE, WM_KEYDOWN, BM_CLICK, etc.) can be used directly as the msg parameter.

Parameter
- hWnd - A Handle to the target window or control.
- msg - The Windows message to send (e.g. WM_CLOSE, BM_CLICK).
- wParam - Additional message-specific information (WPARAM).
- lParam - Additional message-specific information (LPARAM).

Return
- int - The result of the message processing, as returned by the target window procedure.

Example
void main()
{
    int pid = GetProcessID("notepad.exe");
    Handle h = GetProcessIDHandle(pid);

    // Close the window
    SendMessage(h, WM_CLOSE, 0, 0);
}
#include CloseAUT Console mode do...while DoubleClick Execute Fail File for GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetCurrentWorkingDir GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp MiddleMouseDown MiddleMouseUp MouseWheel Pass Predefined Constants Print RightMouseClick RightMouseDown RightMouseUp Script Language SendKeys SendMessage SetFocus SetQtProperty ShellProcess Sleep StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEndsWith VerifyEqual VerifyExists VerifyGreater VerifyLess VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith while