MySpy enumerates windows on the desktop and lists them in a tree. You can see some properties of a window represented by a node in the tree: Title (window text), Class name, PID, HWND or the path of the Module. And more in the info pane. For example the properties of the main window of MySpy:
Title : MySpy
HWND : 01051258
Class Name : MySpy_MainFrame
Class Style : CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS
Module Name : N/A
Rect : (365, 167)-(1309, 695) 944x528
Window Style : WS_BORDER | ... | WS_TILEDWINDOW | WS_VISIBLE = 349110272
Window ExStyle : WS_EX_OVERLAPPEDWINDOW |...| WS_EX_WINDOWEDGE = 00000264
Process ID : 00000644
Thread ID : 00006988
Window ID : 1351813779
The flags are decoded, so you can copy the constants directly into your code.
Main toolbar: filter windows and choose display mode
The main toolbar contains the following buttons:
The functions left to right:
- Set MySpy topmost
- Refresh window tree
- Filter buttons (filters can be used combined eg. visible & parent windows)
- visible windows
- invisible windows
- parent windows
- child windows
- Display numbers in hex
- Highlight selected window
Find window by text or by mouse
To find a window in the tree is possible by text or by mouse also. The text can contain any part of informations displayed on a node: Title, Class, PID, HWND or the path of the Module. This tool is very handy if you want to find a control, which is hidden, or if its size became 0 for some reason.
If you can see the window on the desktop, but you can't find it in the tree, you can choose the "By Mouse" tab. While draging the cross-hairs over a window it will be immediatelly selected in the tree, by releasing the mouse button, MySpy will be activated and the last found window will be selected in the tree.
The user can take several actions on a selected window:
- Left click
- Right click
- Left double-click
- Right double-click
This part of the program can break and cause the manipulated program to malfunction, please use it only if you know exactly what you do!
With the advanced actions toolbar you can send or post messages, set text and transparency of the selected window. The message id can be selected by the combobox or can be given also as a number.
I wrote this program long time ago, but it can be used nowadays too. It helped me to detect bugs, develop tricky controls and impress colleagues they don't even know about WinApi
Points of Interest
WinApi is an "old" technology, but it's worth to know about it.
||Some more information, warning and document formatting
||Source and exe links are corrected.