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.

Predefined Constants

Description
The scripting language provides a set of predefined integer constants for commonly used Windows messages and control codes.
These constants can be used directly in scripts without declaration. They use the same values as their Windows SDK counterparts.

General Window Messages
WM_NULL = 0x0000
WM_CREATE = 0x0001
WM_DESTROY = 0x0002
WM_MOVE = 0x0003
WM_SIZE = 0x0005
WM_ACTIVATE = 0x0006
WM_SETFOCUS = 0x0007
WM_KILLFOCUS = 0x0008
WM_ENABLE = 0x000A
WM_SETTEXT = 0x000C
WM_GETTEXT = 0x000D
WM_GETTEXTLENGTH = 0x000E
WM_PAINT = 0x000F
WM_CLOSE = 0x0010
WM_QUIT = 0x0012
WM_SHOWWINDOW = 0x0018
WM_SETFONT = 0x0030
WM_GETFONT = 0x0031

Keyboard Messages
WM_KEYDOWN = 0x0100
WM_KEYUP = 0x0101
WM_CHAR = 0x0102
WM_SYSKEYDOWN = 0x0104
WM_SYSKEYUP = 0x0105
WM_SYSCHAR = 0x0106
WM_HOTKEY = 0x0312

Mouse Messages
WM_MOUSEMOVE = 0x0200
WM_LBUTTONDOWN = 0x0201
WM_LBUTTONUP = 0x0202
WM_LBUTTONDBLCLK = 0x0203
WM_RBUTTONDOWN = 0x0204
WM_RBUTTONUP = 0x0205
WM_RBUTTONDBLCLK = 0x0206
WM_MBUTTONDOWN = 0x0207
WM_MBUTTONUP = 0x0208
WM_MBUTTONDBLCLK = 0x0209
WM_MOUSEWHEEL = 0x020A
WM_MOUSEHWHEEL = 0x020E

Command & Notification
WM_COMMAND = 0x0111
WM_SYSCOMMAND = 0x0112
WM_NOTIFY = 0x004E
WM_CONTEXTMENU = 0x007B

Timer
WM_TIMER = 0x0113

Clipboard
WM_CUT = 0x0300
WM_COPY = 0x0301
WM_PASTE = 0x0302
WM_CLEAR = 0x0303

Scroll
WM_HSCROLL = 0x0114
WM_VSCROLL = 0x0115

System
WM_SETTINGCHANGE = 0x001A
WM_DISPLAYCHANGE = 0x007E
WM_GETMINMAXINFO = 0x0024
WM_ERASEBKGND = 0x0014
WM_SETREDRAW = 0x000B

Dialog
WM_INITDIALOG = 0x0110
WM_NEXTDLGCTL = 0x0028

Button Notification Codes
BN_CLICKED = 0
BN_DOUBLECLICKED = 5

Button Messages
BM_GETCHECK = 0x00F0
BM_SETCHECK = 0x00F1
BM_CLICK = 0x00F5

Check States
BST_UNCHECKED = 0x0000
BST_CHECKED = 0x0001
BST_INDETERMINATE = 0x0002

Combobox Messages
CB_GETCURSEL = 0x0147
CB_SETCURSEL = 0x014E
CB_GETCOUNT = 0x0146
CB_GETLBTEXT = 0x0148
CB_GETLBTEXTLEN = 0x0149
CB_RESETCONTENT = 0x014B

Listbox Messages
LB_GETCURSEL = 0x0188
LB_SETCURSEL = 0x0186
LB_GETCOUNT = 0x018B
LB_GETTEXT = 0x0189
LB_GETTEXTLEN = 0x018A
LB_RESETCONTENT = 0x0184

Edit Control Messages
EM_GETSEL = 0x00B0
EM_SETSEL = 0x00B1
EM_REPLACESEL = 0x00C2
EM_GETLINECOUNT = 0x00BA
EM_GETLINE = 0x00C4
EM_SETREADONLY = 0x00CF

SC_* Constants (used with WM_SYSCOMMAND)
SC_CLOSE = 0xF060
SC_MINIMIZE = 0xF020
SC_MAXIMIZE = 0xF030
SC_RESTORE = 0xF120

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

    // Send WM_CLOSE to the process
    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