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. |
| wait | Wait for the window to appear with timeout |
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"
TruePS C:\Users\xeek> WindowTool.exe "Title of Window" wait 5000
TruePS C:\Users\xeek> WindowTool.exe "Title of Window" find
TrueYou 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.slnin Visual Studio. - Build the solution by pressing
F7or using theBuildmenu. - To run tests, navigate to the
Test Explorerin Visual Studio and run all tests.