WindowTool is a versatile C++ tool designed for automated interaction with window elements on the Windows operating system. It provides a command-line interface to perform specific actions on windows identified by their title. Key functionalities include finding windows, closing them, or simulating button clicks. This tool is particularly useful for automating GUI tasks, testing user interfaces, or controlling windowed applications programmatically.
To use WindowTool.exe
, follow the command-line syntax below:
Action | Description |
---|---|
find | Outputs "True" if the window is found or "False otherwise. |
minimize | Minimize the window. |
close | Attempt to close the window. |
click | Click a button with the name given a the third argument. |
0
is returned for success or 1
for error. If the action occurred as asked, the tool will output (stdout) True
or False
.
PS C:\Users\xeek> WindowTool.exe "Title of Window" click "Button Text"
True
PS C:\Users\xeek> WindowTool.exe "Title of Window" find
True
You can put the tool anywhere you need it, and rename if if desired.
To build and test WindowTool, follow these steps:
- Clone the repository.
- Open
WindowTool.sln
in Visual Studio. - Build the solution by pressing
F7
or using theBuild
menu. - To run tests, navigate to the
Test Explorer
in Visual Studio and run all tests.