The following script I've got from ahk help file retrieves window id and class when mouse pointer hovers onto them.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
MouseGetPos, xpos, ypos
MsgBox, The cursor is at X%xpos% Y%ypos%.
; This example allows you to move the mouse around to see
; the title of the window currently under the cursor:
SetTimer, WatchCursor, 100
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
ToolTip, ahk_id %id%`nahk_class %class%`n%title%`nControl: %control%
But if a window is minimized in taskbar it doesn't retrieve window ID properly.
I'm pretty sure there must be a way to retrieve window Information even when it's minimized in the taskbar. I just don't know it yet !
I'd really appreciate if someone can help me on this.