Windows and Controls| *Tip:
To correctly access windows and controls, it is important to understand how vTask identifies windows.
For more information concerning locating windows and controls, see Identifying Windows and Controls.
|
Use Window Get Text Set Text Get Window Info Move Window Resize Maximize Minimize Restore Close Window Set Window Style Child Control Action Minimize all Windows Close all Windows |
Use Window
| *Tip:
All Window commands must have at least one Use Window command before it, or alternatively you must have a previously saved window handle to use.
A window handle can be retreived using "Use Window", {hwnd} or the Win32 API.
Interaction with windows is based on the currently focused window/control, which can only be performed by Use Window.
|
| Match Method | Sample Data |
| Exact Title | "Untitled - Notepad" |
| Partial Title | "- Notepad" |
| Class | "Edit" (window type) (Note: Class allows appended * wildcards, which enables matching dynamic .NET controls. For example, "WindowsForms10.STATIC.*" will match "WindowsForms10.STATIC.app.0.1b3cbea") |
| ID | "1001" (identifier) |
| Userdata | "8417839" |
| Title+Class+ID+Userdata, Title+Class, Class+ID, etc. |
"Notepad|Edit|54212344|0" (a combination of data, separated by "|") |
| Handle (HWND) | "4582743" |
| Window/Child Control At X,Y | "30,40" (x,y) |
| Child at Parent-Relative X/Y | "30,40" (x,y) This X,Y coordinate is starting from parent window's upper left corner, therefore (10,10) is 10 pixels inside of the parent app. To use the correct parent window, either use "{hwnd}" in the Parent HWND field, or add a Use Window action to identify the parent window before identifing the child control. |
| Window/Child Control Below Mouse | "30,40" (x,y) |
| Top Window | (no parameters needed) |
| Window with Focus | (no parameters needed) |
| Image (Graphic) | "C:\MyImage.BMP" (graphic file) |
Get Text
| Method | Description |
| (let vTask decide) | vTask tries to determine the window type, and adapts the retrieval method to match. Typically, the WM_GETEXT method is used. |
| Control-Specific (all text) | Sends a certain message to the control, depending on the type of control. For example, list boxes, combo boxes, and edit controls all use different messages to retrieve their data. |
| Control-Specific (selected text) | Depending on the type of control, vTask will retrieve the text that is selected, also known as "highlighted." Please note that some custom or non-standard controls cannot be read. |
| GetWindowText | Uses the internal system function to retrieve the text. Note: Microsoft Windows cannot retrieve the text of an edit control in another application using GetWindowText. This function is provided for completeness. |
| WM_GETTEXT | This is the default method. |
| WM_GETTEXT (interactive) | Interactively sends a request to the window. This is the safest and most reliable method, and is also the method used for the "Display all Windows & Controls" feature. |
Set Text
Get Window Info
| Window Information | Description |
| Text | the title or data of the window |
| Width | the horizontal size of the window, in pixels |
| Height | the vertical size of the window, in pixels |
| Left Coordinate | the left pixel location of the window (0,0 is upper left of screen) |
| Right Coordinate | the right pixel location of the window |
| Top Coordinate | the top pixel location of the window |
| Bottom Coordinate | the bottom pixel location of the window |
| Is Visible | 1 if window visible, 0 if not visible |
| Is Minimized | 1 if window is minimized to tray, else 0 if normal |
| Is Maximized | 1 if window is full screen, else 0 if normal |
| Is Checked | 1 if checked, 0 if not checked (for checkboxes and radio buttons) |
| Is Enabled | 1 if enabled, 0 if not enabled (grayed) |
| Window Class | the Class Name, such as "Button" or "tooltips_class32" |
| Control Type | text description of the control, such as "Button" or "Edit" |
| Control ID | the numeric identifier of the control, such as "1000" |
| Style Value | Numeric value of the window's style (WS_VISIBLE = 0x10000000, etc) This is a technical reference, and only used by programmers who need to check for a certain style bit |
| Process EXE | The source filename of the EXE program that is running the window, for example, "C:\Windows\Notepad.exe" |
| Process EXE Path | The source path of the EXE program that is running the window, for example, "C:\Windows\" |
| Process EXE Base |
The base name of the EXE program that is running the window, for example, "Notepad.exe"
NOTE: vTask can only retrieve the EXE filenames of programs that are 32-bit. |
Move Window
Resize
Maximize
Minimize
| *Tip:
Please note that some windows hide themselves or go to the system tray when minimized (such as printer configuration apps and MS Messenger).
This non-standard behavior will not allow vTask to restore as it would a normal program.
In these circumstances, you need to determine what the program needs in able to restore its main window (usually a mouse command or menu selection).
|
Restore
Close Window
Set Window Style
| Visible |
| Hidden |
| Enabled |
| Disabled |
| Not Always on Top |
| Always on Top |
| Caption |
| Not Resizable |
| Resizable |
| Maximize Button |
| Without Maximize Button |
| Without Minimize Button |
| Minimize Button |
Child Control Action
Minimize all Windows
Close all Windows