#SingleInstance force #Persistent #UseHook #InstallKeybdHook SetBatchLines -1 SetControlDelay -1 ; (-( Configuration )-) ; [Main] hk_ShowHide = #s ; Shows/Hides the ToolTip or Gui hk_Pause = Pause ; Freeze the ToolTip hk_Exit = Esc ; Exit the script ; [Logging] hk_LogOnce = ^l ; Makes one log of current stats log_Allow = false ; Must be true/false to enable logging log_Mode = Long ; Either Short or Long for respective logging log_Interval = 2500 ; Millisecond interval to log stats log_Path = %A_MyDocuments%\InfoSpy_Log.txt ; Path of logfile ; [Viewing] vm_ViewMode = ToolTip ; ToolTip|Gui vm_TTPos = 5, 5 ; (x, y) Position of tooltip. Leave blank for default position vm_GUIPos = ; (x, y) Position of gui. Leave blank for default position hk_ViewModeSwitch = +#s ; Switches the view mode (above) ; [Gui Options] gopt_UIWidth = 200 gopt_UIHeight = 300 vm_guiTrans = 200 ; Gui Transparency value (0-255) ; _________________________ ConfigValidate: If (hk_ShowHide = hk_Pause or hk_ShowHide = hk_Exit or hk_Pause = hk_Exit) { MsgBox, 16,, Two or more hotkeys are the same - they all need to be different. ExitApp } If gopt_UIWidth is not digit { MsgBox, 16,, The Gui width (gopt_UIWidth) has to be a digit. ExitApp } If gopt_UIHeight is not digit { MsgBox, 16,, The Gui width (gopt_UIHeight) has to be a digit. ExitApp } If log_Interval is not digit { MsgBox, 16,, The log interval must be a digit. ExitApp } StringReplace, vm_GUIPos, vm_GUIPos, %A_Space%,, 1 If vm_GUIPos <> ; { intCount_vm_GUIPos = 1 Loop, Parse, vm_GUIPos, `, { If intCount_vm_GUIPos <= 1 guis_x = %A_LoopField% Else guis_y = %A_LoopField% intCount_vm_GUIPos++ } } Else { guis_x := A_ScreenWidth - gopt_UIWidth guis_y := A_ScreenHeight - gopt_UIHeight } StringReplace, vm_TTPos, vm_TTPos, %A_Space%,, 1 intCount_vm_TTPos = 1 Loop, Parse, vm_TTPos, `, { If intCount_vm_TTPos <= 1 vm_TTPosX = %A_LoopField% Else vm_TTPosY = %A_LoopField% intCount_vm_TTPos++ } Hotkey, %hk_ShowHide%, ShowHide Hotkey, %hk_LogOnce%, LogAppend Hotkey, %hk_ViewModeSwitch%, ViewModeSwitch Hotkey, %hk_Pause%, Pause Hotkey, %hk_Exit%, Exit CoordMode, ToolTip, Screen CoordMode, Pixel, Screen CoordMode, Mouse, Screen SetTimer, ConstCheck, 1 ; Changing this will greatly impare quality :P Gui, +AlwaysOnTop +ToolWindow -Caption Gui, Add, Edit, vguiCtrl BackgroundTrans -Wrap %gopt_DisplayOptions% x0 y0 w%gopt_UIWidth% h%gopt_UIHeight%, InfoSpy Gui, Show, x%guis_x% y%guis_y% w%gopt_UIWidth% h%gopt_UIHeight%, InfoSpy WinSet, Transparent, %vm_guiTrans%, InfoSpy, InfoSpy Gui, Hide If log_Allow = true SetTimer, logAppend, %log_Interval% ConstCheck: ; Captured data MouseGetPos, xp, yp, mWin, mCtrl WinGetTitle, mWinTitle, ahk_id %mWin% If mWinTitle = InfoSpy { ; Prevent displaying own data ... GuiControlGet, xguiCtrldat, , guiCtrl guiCatchEX = true Return } Else PixelGetColor, pxcolour, %xp%, %yp% WinGetPos, mWASx, mWASy, mWASw, mWASh, ahk_id %mWin% DetectHiddenText, Off WinGetText, mWinTextVis, ahk_id %mWin% DetectHiddenText, On WinGetText, mWinTextHid, ahk_id %mWin% WinGetClass, mWASclass, ahk_id %mWin% ; Data query strings q0Mouse = X: %xp% Y: %yp% q0Colour = Colour: %pxcolour% q0WinCtrl = Window: ahk_class %mWASclass%`n Control: %mCtrl% ; q1Win = == `:`: Window Stats `:`: ==`nTitle:%mWinTitle%`nID: ahk_id %mWin%`nClass: ahk_class %mWASclass%`n[ Window Position ] -`nLeft (x): %mWASx%`nTop (y): %mWASY%`nWidth: %mWASw%`nHeight: %mWASh% q1Mouse = == `:`: Mouse `:`: ==`nPosition: x%xp% y%yp%`nColour: %pxcolour%`nControl: %mCtrl% q1WinOther = == `:`: Other Window Info `:`: ==`nVisible text: %mWinTextVis%`nHidden text: %mWinTextHid% ; Output display qsText = %q0Mouse%`n%q0Colour%`n%q0WinCtrl% qelabText = %q1Win%`n`n%q1Mouse%`n`n%q1WinOther% If Show <> false { If vm_ViewMode = ToolTip { Gui, Hide ToolTip, %qsText%, %vm_TTPosX%, %vm_TTPosY% } Else { ToolTip Gui, Show, NA GuiControl,, guiCtrl, %qelabText% } } Else { ToolTip Gui, Hide } Return ShowHide: ToolTip Gui, Hide If Show = true Show = false Else Show = true Return ViewModeSwitch: If vm_ViewMode = ToolTip vm_ViewMode = Gui Else vm_ViewMode = ToolTip Return logAppend: If log_Mode = Long logText= %qelabText% Else logText= %qsText% StringReplace, qelabText, qelabText, `n, `r`n, 1 FileAppend, Timestamp: %A_Now%`r`n%logText%`r`n`r`n, %log_Path% Return Pause: Pause Return Exit: ExitApp