ActiveX control for finding window(handle)s, like that used by Spy++.
(Controls like the sight in the upper left corner of the window.)
v1.0.1
Visual Studio 2019
MIT License
- Case Windows (x86)
- Place
WindowSight.ocx
in a folder of your choice. - Launch the command prompt with administrative privileges.
- Run
regsvr32 WindowSight.ocx
.
- Place
- Case Windows (x64)
- Place
WindowSight.ocx
in a folder of your choice. - Launch the command prompt with administrative privileges.
- Run
C:\Windows\SysWow64\regsvr32 WindowSight.ocx
.
- Place
- Case Windows (x86)
- Place
WindowSight.ocx
in a folder of your choice. - Launch the command prompt with administrative privileges.
- Run
regsvr32 /u WindowSight.ocx
.
- Place
- Case Windows (x64)
- Place
WindowSight.ocx
in a folder of your choice. - Launch the command prompt with administrative privileges.
- Run
C:\Windows\SysWow64\regsvr32 /u WindowSight.ocx
.
- Place
- How to Insert a control into a Dialog.
- Open the dialog editor from the resource view.
- Right-click on the dialog and select "Insert ActiveX Control...".
- Select "WindowSight Control" from the "Insert ActiveX Control" window and click the "OK" button.
- How to add properties and methods.
- Right click on the inserted WindowSight control and select "Add Variable...". to add a control variable.
- The IDispatch wrapper class will be automatically inserted into the project and the control variables of the type of the class will be added.
The member functions of the wrapper class will have Getter/Setter properties and methods.
- This is supposed to be the case, but it does not work in Visual Studio 2017 / 2019; it works fine in 2013.
- How to add an event handlers.
- Right click on the inserted WindowSight control and select "Add Event Handler...".
- In the wizard that appears, specify the event you want to add and the member function of the handler, and insert it.
- How to insert a control into a form.
- Open the Form Designer from the Solution Explorer.
- Right-click on an empty area of the toolbox and select "Select Item...".
- Open the "COM Components" tab in the "Select Toolbox Items" window, check the "WindowSight Control" checkbox, and click the "OK" button.
- The "WindowSight Control" is added to the toolbox and inserted into the form.
- If the insertion fails, click "Add Reference..." in the "Project" menu. If the insertion fails, check "WindowSightLib" in the "COM" page of the "Project" menu and click the "OK" button.
- How to add properties and methods.
- By inserting the control, the AxWindowSight class (AxWindowSightLib namespace - AxWindowSight class) is added to the project reference and the control variables are of the type of that class. The control variables are of the class type. The properties and methods are also added and ready to use.
- How to add the event handlers.
- Event handler functions can be added by using the event variables and delegate types that have been added to the AxWindowSight class (AxWindowSightLib namespace - AxWindowSight class).
- FoundWindow
- Description : The handle value of the discovered window held within WindowSight.
- Note : Usually used with Get; Set is also possible, but has no practical meaning.
- FlashFoundWindow
- Description : Flashing of discovered windows held within WindowSight. Help function in case you lose track of which window you are holding.
- DragStart
- Description : Drug initiation event.
- DragEnd
- Description : Drag end event.
- Parameters : OLE_HANDLE - The handle value of the last window that was held.
- ChangeTargetWindow
- Description : Target window change event during dragging.
- Parameters : OLE_HANDLE - Handle value of the newly targeted window.