Permalink
Browse files

Rewrite Active Window Info in script, remove AutoScriptWriter

  • Loading branch information...
1 parent 8240f26 commit 3299a2cbc879b70059a2602fbeb3dcdcaa8500e4 @fincs committed Jul 6, 2013
Showing with 114 additions and 14 deletions.
  1. +1 −5 README.md
  2. +1 −2 source/toolbar.properties
  3. +112 −0 source/tools/ActiveWindowInfo.ahk
  4. +0 −7 source/tools/Rebranded/README.txt
View
@@ -28,12 +28,8 @@ Building SciTE4AutoHotkey
In order to do so, follow the instructions in the *scipatches* folder. When done building, copy SciTE.exe and SciLexer.dll to the /source folder.
-Afterwards, download the current portable build in order to get some files from it:
-
-* SciTE/tools/Rebranded/\*.\* -> source/tools/Rebranded/
-
GenDocs v3.0 must be placed in a SciTE/tools/GenDocs/ folder.
You must also build the [documentation](https://github.com/fincs/SciTE4AHK-Docs) and place it in the source folder.
-The latest AutoHotkey Unicode binary (v1.1.11.00 at the time of writing) also needs to be placed in the source folder.
+The latest AutoHotkey Unicode 32-bit binary also needs to be placed in the source folder, as `InternalAHK.exe`.
@@ -3,8 +3,7 @@
; Do NOT edit this file, use UserToolbar.properties instead!
;
-=Active Window Info|tools\Rebranded\Au3Spy.exe
-=Auto Script Writer|tools\Rebranded\AutoScriptWriter.exe
+=Active Window Info|%LOCALAHK% tools\ActiveWindowInfo.ahk||%ICONRES%,9
=autohotkey.net Tool|%LOCALAHK% tools\AhkNetTool.ahk||%ICONRES%,9
=TillaGoto|%LOCALAHK% tools\TillaGoto.ahk||%ICONRES%,16
-
@@ -0,0 +1,112 @@
+;
+; Active Window Info
+;
+
+#NoEnv
+#NoTrayIcon
+#SingleInstance Ignore
+SetWorkingDir, %A_ScriptDir%
+SetBatchLines, -1
+CoordMode, Pixel, Screen
+
+IfExist, ..\toolicon.icl ; Seems useful enough to support standalone operation.
+ Menu, Tray, Icon, ..\toolicon.icl, 9
+
+VarSetCapacity(rect, 16)
+isUpd := true
+txtNotFrozen := "(Win+A to freeze display)"
+txtFrozen := "(Win+A to unfreeze display)"
+
+Gui, New, hwndhGui AlwaysOnTop
+Gui, Add, Text,, Window Title and Class:
+Gui, Add, Edit, w320 r2 ReadOnly vCtrl_Title
+Gui, Add, Text,, Mouse Position:
+Gui, Add, Edit, w320 r3 ReadOnly vCtrl_MousePos
+Gui, Add, Text,, Control Under Mouse Position:
+Gui, Add, Edit, w320 r3 ReadOnly vCtrl_MouseCur
+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,, Active Window Info
+SetTimer, Update, 250
+return
+
+Update:
+Gui %hGui%:Default
+curWin := WinExist("A")
+if (curWin = hGui)
+ return
+WinGetTitle, t1
+WinGetClass, t2
+GuiControl,, Ctrl_Title, % t1 "`nahk_class " t2
+CoordMode, Mouse, Screen
+MouseGetPos, msX, msY, msWin, msCtrlHwnd, 2
+CoordMode, Mouse, Relative
+MouseGetPos, mrX, mrY,, msCtrl
+CoordMode, Mouse, Client
+MouseGetPos, mcX, mcY
+GuiControl,, Ctrl_MousePos, % "Absolute:`t" msX ", " msY " (less often used)`nRelative:`t" mrX ", " mrY " (default)`nClient:`t" mcX ", " mcY " (recommended)"
+PixelGetColor, mClr, %msX%, %msY%, RGB
+mClr := SubStr(mClr, 3)
+mText := "`nColor:`t" mClr " (Red=" SubStr(mClr, 1, 2) " Green=" SubStr(mClr, 3, 2) " Blue=" SubStr(mClr, 5) ")"
+if (curWin = msWin)
+{
+ ControlGetText, ctrlTxt, %msCtrl%
+ mText := "ClassNN:`t" msCtrl "`nText:`t" textMangle(ctrlTxt) mText
+} else mText := "`n" mText
+GuiControl,, Ctrl_MouseCur, % mText
+WinGetPos, wX, wY, wW, wH
+DllCall("GetClientRect", "ptr", curWin, "ptr", &rect)
+wcW := NumGet(rect, 8, "int")
+wcH := NumGet(rect, 12, "int")
+GuiControl,, Ctrl_Pos, % "x: " wX "`ty: " wY "`tw: " wW "`th: " wH "`nClient:`t`tw: " wcW "`th: " wcH
+sbTxt := ""
+Loop
+{
+ StatusBarGetText, ovi, %A_Index%
+ if ovi =
+ break
+ sbTxt .= "(" A_Index "):`t" textMangle(ovi) "`n"
+}
+StringTrimRight, sbTxt, sbTxt, 1
+GuiControl,, Ctrl_SBText, % sbTxt
+GuiControlGet, bSlow,, Ctrl_IsSlow
+SetTitleMatchMode, % bSlow ? "Slow" : "Fast"
+DetectHiddenText, Off
+WinGetText, ovVisText
+DetectHiddenText, On
+WinGetText, ovAllText
+GuiControl,, Ctrl_VisText, % ovVisText
+GuiControl,, Ctrl_AllText, % ovAllText
+return
+
+GuiClose:
+ExitApp
+
+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
+}
+
+#a::
+Gui %hGui%:Default
+isUpd := !isUpd
+SetTimer, Update, % isUpd ? "On" : "Off"
+GuiControl,, Ctrl_Freeze, % isUpd ? txtNotFrozen : txtFrozen
+return
@@ -1,7 +0,0 @@
-Here, some hacked up versions of AutoHotkey's AutoIt-legacy tools would go. Obviously they can't be stored on github.
-
-File list:
-
-- ASWHook.dll
-- Au3Spy.exe
-- AutoScriptWriter.exe

0 comments on commit 3299a2c

Please sign in to comment.