Skip to content

Commit

Permalink
Move to correct folder
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBestPessimist committed Dec 21, 2022
1 parent f8856ed commit 3604eea
Show file tree
Hide file tree
Showing 53 changed files with 13 additions and 291 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 0 additions & 29 deletions AutoHotkeyU64.ahk

This file was deleted.

Binary file removed AutoHotkeyU64.exe
Binary file not shown.
Binary file added AutoHotkey_2.0.0.zip
Binary file not shown.
23 changes: 0 additions & 23 deletions AutoHotkey_2.0.0/WinTitles.ahk

This file was deleted.

2 changes: 0 additions & 2 deletions AutoHotkey_2.0.0/WindowSpy.ahk

This file was deleted.

16 changes: 0 additions & 16 deletions AutoHotkey_2.0.0/lib/clipboard.ahk

This file was deleted.

Binary file removed AutoHotkey_2.0.0/resources/blueStar.ico
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions WinTitles.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class WinTitles
static ModernSkype := [WinTitles.ModernApp, "Skype"]
static ModernPhotos := [WinTitles.ModernApp, "Photos"]
static Vlc := "ahk_exe vlc.exe"
static Goland := "ahk_exe goland64.exe"
static IntellijIdea := "ahk_exe idea64.exe"
static CorsairCUE := "ahk_class CUEBorderlessWindow ahk_exe iCUE.exe"
static BattleNet := "ahk_exe Battle.net.exe"
Expand All @@ -16,7 +15,7 @@ class WinTitles
static TeamViewerSponsoredSession := "Sponsored session ahk_exe TeamViewer.exe"
static TeamViewer := "TeamViewer ahk_exe TeamViewer.exe"
static ACDSee := "ahk_exe ACDSeeProfessional2018.exe"
static MsTeams := "ahk_exe Teams.exe"
static Feces := "ahk_exe Teams.exe"
static Telegram := "ahk_exe telegram.exe ahk_class Qt5154QWindowIcon"
static SublimeText := "ahk_exe sublime_text.exe"
static tf2 := "ahk_exe hl2.exe"
Expand Down
214 changes: 2 additions & 212 deletions WindowSpy.ahk
Original file line number Diff line number Diff line change
@@ -1,212 +1,2 @@
;
; Window Spy
;

#NoEnv
#NoTrayIcon
#SingleInstance Ignore
SetWorkingDir, %A_ScriptDir%
SetBatchLines, -1
CoordMode, Pixel, Screen

txtNotFrozen := "(Hold Ctrl or Shift to suspend updates)"
txtFrozen := "(Updates suspended)"
txtMouseCtrl := "Control Under Mouse Position"
txtFocusCtrl := "Focused Control"

Gui, New, hwndhGui AlwaysOnTop Resize MinSize
Gui, Add, Text,, Window Title, Class and Process:
Gui, Add, Checkbox, yp xp+200 w120 Right vCtrl_FollowMouse, Follow Mouse
Gui, Add, Edit, xm w320 r4 ReadOnly -Wrap vCtrl_Title
Gui, Add, Text,, Mouse Position:
Gui, Add, Edit, w320 r4 ReadOnly vCtrl_MousePos
Gui, Add, Text, w320 vCtrl_CtrlLabel, % txtFocusCtrl ":"
Gui, Add, Edit, w320 r4 ReadOnly vCtrl_Ctrl
Gui, Add, Text,, Active Window Position:
Gui, Add, Edit, w320 r2 ReadOnly vCtrl_Pos
Gui, Add, Text,, Status Bar Text:
Gui, Add, Edit, w320 r2 ReadOnly vCtrl_SBText
Gui, Add, Checkbox, vCtrl_IsSlow, Slow TitleMatchMode
Gui, Add, Text,, Visible Text:
Gui, Add, Edit, w320 r2 ReadOnly vCtrl_VisText
Gui, Add, Text,, All Text:
Gui, Add, Edit, w320 r2 ReadOnly vCtrl_AllText
Gui, Add, Text, w320 r1 vCtrl_Freeze, % txtNotFrozen
Gui, Show, NoActivate, Window Spy
GetClientSize(hGui, temp)
horzMargin := temp*96//A_ScreenDPI - 320
SetTimer, Update, 250
return

GuiSize:
Gui %hGui%:Default
if !horzMargin
return
SetTimer, Update, % A_EventInfo=1 ? "Off" : "On" ; Suspend on minimize
ctrlW := A_GuiWidth - horzMargin
list = Title,MousePos,Ctrl,Pos,SBText,VisText,AllText,Freeze
Loop, Parse, list, `,
GuiControl, Move, Ctrl_%A_LoopField%, w%ctrlW%
return

Update:
Gui %hGui%:Default
GuiControlGet, Ctrl_FollowMouse
CoordMode, Mouse, Screen
MouseGetPos, msX, msY, msWin, msCtrl
actWin := WinExist("A")
if Ctrl_FollowMouse
{
curWin := msWin
curCtrl := msCtrl
WinExist("ahk_id " curWin)
}
else
{
curWin := actWin
ControlGetFocus, curCtrl
}
WinGetTitle, t1
WinGetClass, t2
if (curWin = hGui || t2 = "MultitaskingViewFrame") ; Our Gui || Alt-tab
{
UpdateText("Ctrl_Freeze", txtFrozen)
return
}
UpdateText("Ctrl_Freeze", txtNotFrozen)
WinGet, t3, ProcessName
WinGet, t4, PID
UpdateText("Ctrl_Title", t1 "`nahk_class " t2 "`nahk_exe " t3 "`nahk_pid " t4)
CoordMode, Mouse, Relative
MouseGetPos, mrX, mrY
CoordMode, Mouse, Client
MouseGetPos, mcX, mcY
PixelGetColor, mClr, %msX%, %msY%, RGB
mClr := SubStr(mClr, 3)
UpdateText("Ctrl_MousePos", "Screen:`t" msX ", " msY " (less often used)`nWindow:`t" mrX ", " mrY " (default)`nClient:`t" mcX ", " mcY " (recommended)"
. "`nColor:`t" mClr " (Red=" SubStr(mClr, 1, 2) " Green=" SubStr(mClr, 3, 2) " Blue=" SubStr(mClr, 5) ")")
UpdateText("Ctrl_CtrlLabel", (Ctrl_FollowMouse ? txtMouseCtrl : txtFocusCtrl) ":")
if (curCtrl)
{
ControlGetText, ctrlTxt, %curCtrl%
cText := "ClassNN:`t" curCtrl "`nText:`t" textMangle(ctrlTxt)
ControlGetPos cX, cY, cW, cH, %curCtrl%
cText .= "`n`tx: " cX "`ty: " cY "`tw: " cW "`th: " cH
WinToClient(curWin, cX, cY)
ControlGet, curCtrlHwnd, Hwnd,, % curCtrl
GetClientSize(curCtrlHwnd, cW, cH)
cText .= "`nClient:`tx: " cX "`ty: " cY "`tw: " cW "`th: " cH
}
else
cText := ""
UpdateText("Ctrl_Ctrl", cText)
WinGetPos, wX, wY, wW, wH
GetClientSize(curWin, wcW, wcH)
UpdateText("Ctrl_Pos", "`tx: " wX "`ty: " wY "`tw: " wW "`th: " wH "`nClient:`tx: 0`ty: 0`tw: " wcW "`th: " wcH)
sbTxt := ""
Loop
{
StatusBarGetText, ovi, %A_Index%
if ovi =
break
sbTxt .= "(" A_Index "):`t" textMangle(ovi) "`n"
}
StringTrimRight, sbTxt, sbTxt, 1
UpdateText("Ctrl_SBText", sbTxt)
GuiControlGet, bSlow,, Ctrl_IsSlow
if bSlow
{
DetectHiddenText, Off
WinGetText, ovVisText
DetectHiddenText, On
WinGetText, ovAllText
}
else
{
ovVisText := WinGetTextFast(false)
ovAllText := WinGetTextFast(true)
}
UpdateText("Ctrl_VisText", ovVisText)
UpdateText("Ctrl_AllText", ovAllText)
return

GuiClose:
ExitApp

WinGetTextFast(detect_hidden)
{
; WinGetText ALWAYS uses the "Slow" mode - TitleMatchMode only affects the
; WinText/ExcludeText parameters. In "Fast" mode, GetWindowText() is used
; to retrieve the text of each control.
WinGet controls, ControlListHwnd
static WINDOW_TEXT_SIZE := 32767 ; Defined in AutoHotkey source.
VarSetCapacity(buf, WINDOW_TEXT_SIZE * (A_IsUnicode ? 2 : 1))
text := ""
Loop Parse, controls, `n
{
if !detect_hidden && !DllCall("IsWindowVisible", "ptr", A_LoopField)
continue
if !DllCall("GetWindowText", "ptr", A_LoopField, "str", buf, "int", WINDOW_TEXT_SIZE)
continue
text .= buf "`r`n"
}
return text
}

UpdateText(ControlID, NewText)
{
; Unlike using a pure GuiControl, this function causes the text of the
; controls to be updated only when the text has changed, preventing periodic
; flickering (especially on older systems).
static OldText := {}
global hGui
if (OldText[ControlID] != NewText)
{
GuiControl, %hGui%:, % ControlID, % NewText
OldText[ControlID] := NewText
}
}

GetClientSize(hWnd, ByRef w := "", ByRef h := "")
{
VarSetCapacity(rect, 16)
DllCall("GetClientRect", "ptr", hWnd, "ptr", &rect)
w := NumGet(rect, 8, "int")
h := NumGet(rect, 12, "int")
}

WinToClient(hWnd, ByRef x, ByRef y)
{
WinGetPos wX, wY,,, ahk_id %hWnd%
x += wX, y += wY
VarSetCapacity(pt, 8), NumPut(y, NumPut(x, pt, "int"), "int")
if !DllCall("ScreenToClient", "ptr", hWnd, "ptr", &pt)
return false
x := NumGet(pt, 0, "int"), y := NumGet(pt, 4, "int")
return true
}

textMangle(x)
{
if pos := InStr(x, "`n")
x := SubStr(x, 1, pos-1), elli := true
if StrLen(x) > 40
{
StringLeft, x, x, 40
elli := true
}
if elli
x .= " (...)"
return x
}

~*Ctrl::
~*Shift::
SetTimer, Update, Off
UpdateText("Ctrl_Freeze", txtFrozen)
return

~*Ctrl up::
~*Shift up::
SetTimer, Update, On
return
#Requires AutoHotkey v2.0-beta
#Include UX\WindowSpy.ahk
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/Tippy.ahk
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
todo: better position changing: https://learn.microsoft.com/en-us/windows/win32/controls/implement-tracking-tooltips


; Show a ToolTip which follows the mouse for a specific duration.
; Multiple ToolTips are stacked vertically, so no information is hidden.
;
Expand Down
12 changes: 6 additions & 6 deletions lib/clipboard.ahk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
saveClipboard()
{
saveClipboard() {
; Try is needed because I get an error "can't open clipboard for reading" while lock screen is on
Try {
global ClipSaved := ClipboardAll
clipboard := ""
global __ClipboardSaved := ClipboardAll()
A_Clipboard := ""
}
}

restoreClipboard()
{
Try {
global ClipSaved
Clipboard := ClipSaved ; Restore Clipboard
global __ClipboardSaved
A_Clipboard := __ClipboardSaved ; Restore Clipboard
__ClipboardSaved := ""
}
}
2 changes: 1 addition & 1 deletion lib/libdebug.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Tippy>
#include <Tippy>


;------------------------------------------------
Expand Down

0 comments on commit 3604eea

Please sign in to comment.