Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK Window Info 1.7


  • Please log in to reply
82 replies to this topic
toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
This script will reveal information on windows, controls, etc.
It is made public under the Attribution-NonCommercial-ShareAlike 2.5 licence from Creative Commons
it requires the latest AHK version.

ScreenShots of the 5 tabs (Version 1.4):
Posted Image__Posted Image__Posted Image
Posted Image__Posted Image

ScreenShots of the 3 option tabs (Version 1.4):
Posted Image__Posted Image__Posted Image

A larger list (which can be activated on the advanced tab) shows more data:
- a list of all controls and their properties of the window in question
- a list of all existing windows and their properties

Download the AHK Source Code [ SKAN's Dropbox ]

Change log:

;changes since 1.6
; - added a small gap in the mouse picker grid to identify the center (thanks fade2gray)
; - adjusted groupbox size and tab size
; - added reset of picker to default color on dimensional change

;changes since 1.5
; - Groupboxes with bold text have been set -wrap, to fix line breaks on some windows themes
; - BGR is made default for color picker
; - update is stopped when mouse moves over its own gui, allowing easier graping of data, since no Pause key needs to be pressed.

;changes since 1.4
; - "H" replaced with Hwnd; "P" and "S" with "Pos" and "Size" on advanced tab for Control
; - GroupBox names have bold font
; - Mouse color picker is only updated when mouse tab is visible. Otherwise set to gray
; - set default for color picker to 15x15, since it only influences CPU load when the mouse tab is visible
; - controls list items are only updated when advanced tab is visible. Otherwise set to ">>>not updated<<<""
; - windows statusbar text is only updated when advanced tab is visible. Otherwise set to ">>>not updated<<<""
; - fast/slow visible/hidden window text are only updated when advanced tab is visible. Otherwise set to ">>>not updated<<<""
;todo
; - Window Info should be tested on Windows 9x

;changes since 1.3
; - last tab gets remebered between starts
; - large list hides automatically when tab is not "Advanced"
; - by default not rectangle is drawn around controls
; - gui starts NoActivate
; - fixed a problem with hidden gui and pause key
; - reduced impact in hidden mode on CPU load to nearly 0
; - to support 800x600 screen resolutions the advanced guis initial height is 600
; - instead of auto-update, update of data can be done on mouse click (button can be L/M/R, default M)
; - when started with "HideGui" turned on: GUI starts hidden, after 500 ms data is collected and GUI shown

;changes since 1.2
; - added: Control handle to advanced and list view
; - improved: fixed some spelling mistakes
; - fixed: option "Show tooltip at cursor" had no effect
; - fixed: option "Show tooltip at cursor" wasn't remembered between sessions
; - improved: For all DllCall's the types are put in quotes
; - changed: coordinates and sizes will have a space after the comma when put on clipboard
; - changed: the number of characters in the GUI for the list items is limited to 200. Clipboard will receive all
; - changed: "Introduction - Please Read" button moved to new info tab
; - changed: Renamed "active control in window" to "focused control in window".
; - fixed: Window Info refused to minimize while the right-side list was displayed.
; - changed: While Window Info is minimized, updating of data is turned off
; - fixed: Coordinates of GUI got stored when GUI got closed minimized

;changes since 1.1
; - added: OnExit routine that cleans up frame gui if script exits unexpectedly
; - changed: Tooltip of control frame disappears when mouse gets moved onto it.
; - changed: font size of GUI is now 6pt

;changes since 1.0
; - inproved: specified the font for the GUI, MS Sans Serif, 8 point
; - changed: for some OS (WIN_2000,WIN_NT4,WIN_95,WIN_98,WIN_ME) the icon is changed to ID 57
; - inproved: small features that simplify maintainance
; + combine update routines
; + simplify options actions
; + simplify Pause Key actions
; + reorder code
; - inproved: new method to capture fast/slow visible/hidden window text (Thanks Chris)
; - changed: Gui (advanced) now holds fields for fast/slow visible/hidden window text
; - added: option to switch color picker between RGB and BGR
; - inproved: color picker only updates when mouse moves or color below mouse changes. This reduces jittery update.
; - changed: Color picker now has a 15x15 color matrix
; - changed: checkbox "Show right List" changed to button that alternates between "More Info >>" and "<< Less Info".
; - added: check for miminum required AHK version
; - added: new option to turn auto-update automatically ON when Gui gets inactive (if it had been turned off (by pause or by the large list))


This script started originally in this old thread.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Glad to see further refinements 8) Is there a list of planned changes/improvements at all?

I noticed that when "Show right list" is ticked, and if you change tabs, it stays open.

Also, in Windows XP when not using the Windows XP theme (i.e. using the classic windows look) the text in the title of group boxes (like Control and Window) aren't highlighted in any way. Perhaps making them bold text would work in both cases (and older operating systems)?

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Very nice! Only one little problem: I use non-standard Windows fonts (large), which makes all the edit controls appear in the wrong place. Maybe the right font could be explicitly specified for the GUI.

AHKnow*
  • Guests
  • Last active:
  • Joined: --
Awesome program. Worthy to be distributed with future releases of AutoHotkey.

One thing though, I do miss the "Advanced Tab's" "Show Window Text below" box from version 0.9. I thought it was a nice touch to have it go away or come back.

robiandi
  • Guests
  • Last active:
  • Joined: --
@toralf:

Hmmm, .......... Could you maybe change your OS? :)

Which icon would you choose for AHK Window Info (from the 108)?
Please tell me the Number and a description of how it looks.

I don't know which one to take.
For me this is not important, I have it posted because you didn't got an answer from the Guest

AGU
  • Guests
  • Last active:
  • Joined: --
Ok, I would vote for #23 oder #56.

Posted Image
_______________
Cheers
AGU

AHKnow*
  • Guests
  • Last active:
  • Joined: --
My vote would be for #57 to replace #172 in the below line of code:

Menu, Tray, Icon, %IconFile%, 172   ;icon for taskbar and for proces in task manager


evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Hi toralf. I had an idea for another feature if you're interested. For quick scripts that just need to click on various things in a window, it can be a pain to record each mouse click and the time to wait in between. I was thinking about something like another tab or edit control that (when visible) hooks the left and right mouse buttons (maybe the middle one too) and records the location of any clicks and the time between clicks (e.g. using A_TickCount). There could be radio selection buttons for window or screen relative co-ordinates and optionally record the title of the active window (perhaps only when it changes).

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Yes, I think that would be an improvement. But this is more related to a auto script writter. I know that other people are working on such a thing. Therefore I do not integrate this into Window Info.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Updated to Version 1.1 in first post.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
I thought it could not be improved any more. I was wrong. Good job!

A few minor problems:
- With the default font in my system, the GUI window still looks ugly: the edit boxes are shifted unevenly to the right. Maybe not only the font-size, but also the name of the font should be specified.
- When the tooltip shows the name of the control under the mouse cursor, it could cover another control. I have to move the mouse and come back to see, what is under the tooltip. It was nicer, if the tooltip could disappear, when the mouse cursor gets inside the tooltip.
- When the GUI of the script is active, it does not show the window information under the mouse, I have to click somewhere else, first. After that, the information is shown about the window under the cursor, even if another window is active. It looks inconsistent.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Thanks for the feedback,

1) It is specified on line 203:
Gui, 1:Font, s8, MS Sans Serif
Could you please tell me which font shows the GUI nicely on your system?

2) I look into it. But if you move the mouse slowly in the direction of the tooltip, it should work well.

3) This is by design, since the update has to stop when the GUI gets active. This allows to use Alt+Tab. It also prevents the data to change accidently if the mouse slips off the GUI.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
(1) In my system 6 pt MS Sans Serif font makes the controls nice and aligned. (I have 125% magnified fonts, 120 DPI; 120/96 = 1.25). It could be read from the registry, and used as a correction factor: 8/1.25 = 6.4 ~ 6pt). I experienced this kind of problems with many commercial programs, like with my favorite editor, MultiEdit 9.10. Its customization dialogs suck really badly. I paid $200 for it.

(2) In MSIE, the Google search box is covered with the tooltip. It does not mater if I move the mouse slowly or quickly, until another control gets highlighted, the search box is covered, and no information can be obtained about it.

(3) It makes senseā€¦ Have you tried a Freeze! hotkey, instead? I don't know if it is any easier to use, though.
--- ---
(4) Here is something to think about: I have a Gui (analog clock), with transparent background, but opaque hands. Your script shows the window info, but I cannot get anything about other controls, which are below the transparent part. I can activate them, but no info is shown.

(5) The mouse information is the opposite: the pixel colors are taken from the window at the bottom, the hands of the clock do not ever show up.

(6) After experimenting a little, the script crashed. Windows got in a funny state: The activate window (selected with AltTab, or the taskbar or clicking in a visible part) do not get in the foreground. I have to manually minimize foreground windows to get to the active one. It looks like some cleanup is necessary at the end of the script. Have you thought about OnExit? Killing the script from its tray icon could cause the same problems.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
1) 2) and 6)

;changes since 1.1
; - added: OnExit routine that clean up frame gui if script exits unexpectedly
; - changed: Tooltip of control frame disappears when mouse gets moved onto it.
; - changed: font size of GUI is now 6pt (the look of the GUI doesn't change on my system with this seeting)

3) no i never treid a freez button. I will keep it as it is.

4) and 5) I have no idea how to solve this. I only use normal AHK commands. So if they can't get the data, i doubt it would be of any use if Window info would get it (with DllCall or SendMessage).

Thanks for testing it and giving feedback

EDIT: updated first post with version 1.2
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
OnExit needs a little more fine tuning. Try exiting the script from its tray icon. Alt-Tab will not bring the active window in the foreground. Restart the script and exit it from its GUI: Alt-Tab works fine. (Fonts and tooltips are perfect now on my laptop.)