[V2.beta] - wInspector - windows spy alternative

Post your working scripts, libraries and tools.
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

[V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 10 Jun 2022, 17:04

An alternative of windows spy, based on the good "AHK window info" that served me for many years, but with extra fuctionalities.

It lists all the processes, windows and controls and makes them searchable.
Drag and drop the cross to specify a specific control or window.

You can reduce wInspector so it only displays information that you find interesting. you can show or hide every groupbox.
Rightclick the listview items for extra commands regarding the controls or windows. Like displaying the styles,

The function groupbox lets you quickly test functions on controls or window.

An ACC viewer is also imbedded to explore the Acc elements, probably extra functions will be used to generate code to use these elements in the future.

Download

wInspector github

winspector1.png
winspector1.png (18.52 KiB) Viewed 4531 times
Attachments
winspector2.png
winspector2.png (88.67 KiB) Viewed 4531 times
Last edited by AHK_user on 03 Jan 2023, 03:46, edited 3 times in total.

User avatar
RaptorX
Posts: 385
Joined: 06 Dec 2014, 14:27
Contact:

Re: [V2.beta] - wInspector - windows spy alternative

Post by RaptorX » 10 Jun 2022, 22:04

This is a really amazing tool with tons of potential.

Ill be playing with it later! Thanks a lot for sharing!
Projects:
AHK-ToolKit

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 12 Jun 2022, 17:03

Update:
- Improved style analisys (when rightclicking on one of the listviews>styles)
- Switched to ChildGuis to handle the different Sections more easily
- Added Function section that allows you to quickly test some functions regarding Windows or Controls. (With a copy button to copy the code)

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 19 Jun 2022, 13:32

Update:
- Added buttons in the function section that let`s you copy the code or quickly go to the help file of the function
- Added toolbar to quickly show/hide the specific groupbox
- Improved automatic sizing of the window

Feedback is welcome, please let me know if there are some interesting features that are missing.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 09 Jul 2022, 14:55

Update:
- Added automatic Process selection in ProcessList of picked window.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 10 Jul 2022, 03:38

Updates:
- Fixed resizing issue that caused the window to grow larger when reloading
- Removed filickering when picking a control
- Added checked status to toolbar, the view menu is removed as it is replaced by the toolbar.

With there updates, some annoiing behaviours are now removed.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 13 Jul 2022, 13:40

Update:
- Fixed resize issues, (using maximized state still causes some strange behavior, but the rest seems to be fixed)
- Fixed Listview click errors
- Added option to switch the display the IDs as number or hexidecimal

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 04 Sep 2022, 13:01

Update:
- Added an command Acc Viewer in the Winlist contextMenu to display the Acc data
winspector_accViewer.png
winspector_accViewer.png (151.6 KiB) Viewed 3966 times

lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V2.beta] - wInspector - windows spy alternative

Post by lexikos » 01 Jan 2023, 21:29

What are the effects of the settings under the Control and Window sub-menus of the Settings menu?

Some suggestions:
  • Add a window class column to the window list.
  • Add "copy class" to the window list context menu.
  • Add an option to filter the window list by what is selected in the process list, instead of (the current behaviour) automatically changing the selection in the process list when the user selects a window.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 03 Jan 2023, 03:26

lexikos wrote:
01 Jan 2023, 21:29
What are the effects of the settings under the Control and Window sub-menus of the Settings menu?

Some suggestions:
  • Add a window class column to the window list.
  • Add "copy class" to the window list context menu.
  • Add an option to filter the window list by what is selected in the process list, instead of (the current behaviour) automatically changing the selection in the process list when the user selects a window.
Suggestions are implemented. Filter on PID is added with a checkbox.

The settings are related to the Function Section that allows the user to quickly test and copy AHK functions and impact with what method the control or window is targeted.

User avatar
Xeo786
Posts: 760
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: [V2.beta] - wInspector - windows spy alternative

Post by Xeo786 » 23 Jan 2023, 08:23

You need to define point is from chrome or not as I ran into an error because of that so I just debug trail and found wInspector.ahk line 986

Code: Select all

oAccp := Acc.ObjectFromPoint(MouseX, MouseY,,PointisChrome ? true : false)
it is set for chrome by default line 894 acc.ahk

Code: Select all

static ObjectFromWindow(hWnd:="A", idObject := 0, activateChromium:=True)
edit:
I just found it's a one-time error for me, using windows 10 ahk 2.0.2.
image.png
image.png (38.01 KiB) Viewed 3240 times
hwnd return empty first time it is not the above issue. you need to put a condition if hwnd is empty in Acc.ahk
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

Descolada
Posts: 1141
Joined: 23 Dec 2021, 02:30

Re: [V2.beta] - wInspector - windows spy alternative

Post by Descolada » 23 Jan 2023, 10:37

@Xeo786, could you tell me how to reproduce this bug?
wInspector is using ObjectFromPoint with only the X and Y arguments, which means that inside ObjectFromPoint the hwnd for accessibility activation is gotten with the call wId := DllCall("GetAncestor", "UInt", DllCall("user32.dll\WindowFromPoint", "int64", pt64), "UInt", GA_ROOT := 2), where pt64 consists of the X and Y coordinates. This wId gets passed into ActivateChromiumAccessibility where WinGetControls gets called with it. If the target window isn't found, then I guess this means that for some reason the DllCall is failing? Can you test whether it's WindowFromPoint or GetAncestor that fails?

User avatar
Xeo786
Posts: 760
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: [V2.beta] - wInspector - windows spy alternative

Post by Xeo786 » 24 Jan 2023, 00:05

Descolada wrote:
23 Jan 2023, 10:37
@Xeo786, could you tell me how to reproduce this bug?
wInspector is using ObjectFromPoint with only the X and Y arguments, which means that inside ObjectFromPoint the hwnd for accessibility activation is gotten with the call wId := DllCall("GetAncestor", "UInt", DllCall("user32.dll\WindowFromPoint", "int64", pt64), "UInt", GA_ROOT := 2), where pt64 consists of the X and Y coordinates. This wId gets passed into ActivateChromiumAccessibility where WinGetControls gets called with it. If the target window isn't found, then I guess this means that for some reason the DllCall is failing? Can you test whether it's WindowFromPoint or GetAncestor that fails?
Idk why? but wid return 0 just once which causes error, but after continuing it works fine.
image.png
image.png (78.18 KiB) Viewed 3164 times
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

User avatar
Xeo786
Posts: 760
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: [V2.beta] - wInspector - windows spy alternative

Post by Xeo786 » 24 Jan 2023, 00:13

Oh I found it, I got two screens
image.png
image.png (1.04 MiB) Viewed 3162 times
Mouse is top left corner on screen 2, Just look at the screen coords they are in
image.png
image.png (49.61 KiB) Viewed 3162 times
They are negative which is actually causing errors.
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

Descolada
Posts: 1141
Joined: 23 Dec 2021, 02:30

Re: [V2.beta] - wInspector - windows spy alternative

Post by Descolada » 26 Jan 2023, 00:39

In a private chat with @Xeo786 we figured out that the problem was in WindowFromPoint requiring bit-masking the X-coordinate, otherwise it will return 0, which causes an error in ActivateChromiumAccessibility. This kind of error repeating can be prevented by updating the Acc library to the latest version (v2.1) which contains a more effective and less error-prone implementation of ActivateChromiumAccessibility. For now I only created a pull request to add bit-masking, but the decision whether to update to the newer Acc library I'll leave to @AHK_user :)

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2.beta] - wInspector - windows spy alternative

Post by AHK_user » 26 Jan 2023, 13:15

Descolada wrote:
26 Jan 2023, 00:39
In a private chat with @Xeo786 we figured out that the problem was in WindowFromPoint requiring bit-masking the X-coordinate, otherwise it will return 0, which causes an error in ActivateChromiumAccessibility. This kind of error repeating can be prevented by updating the Acc library to the latest version (v2.1) which contains a more effective and less error-prone implementation of ActivateChromiumAccessibility. For now I only created a pull request to add bit-masking, but the decision whether to update to the newer Acc library I'll leave to @AHK_user :)
The library is updated. Thanks for the pull request. :D

If I find the time and motivation, I will look into the newer Acc library.
I was planning to add some buttons to test some acc functionalities, with the option to quickly copy some working code.

Post Reply

Return to “Scripts and Functions (v2)”