~joten/hul!
| Stable release |
0.1.0 / 02.10.2011 |
| Status |
Inactive development / not supported |
| Written in |
AutoHotkey script |
| Runtime environment |
AutoHotkey |
| Available in |
English |
| Type |
System tool |
| License |
GNU General Public License |
| Distribution |
AutoHotkey script source |
| Download from |
AutoHotkey.net (AHK, 6 KB) |
Description
hul! is a tool for finding and restoring hidden windows. It is
especially useful with bug.n in the case, when an error
occurs, while changing the views and therewith hiding windows.
Source view
NAME := "hul!"
VERSION := "0.1.0"
HELP :=
(Join
"USAGE<SPAN CLASS="AHK-Escape">`n</SPAN>
<SPAN CLASS="AHK-Escape">`n</SPAN>
Specify one, two or all of the following search criteria:<SPAN CLASS="AHK-Escape">`n</SPAN>
- Type a regular expression in the field next to 'Partial title'.<SPAN CLASS="AHK-Escape">`n</SPAN>
- Type a class name (exact match) in the field next to 'Class name'.<SPAN CLASS="AHK-Escape">`n</SPAN>
- Type a process name (e. g. the name of an exeutable, exact match) in the field next to 'Process name'.<SPAN CLASS="AHK-Escape">`n</SPAN>
<SPAN CLASS="AHK-Escape">`n</SPAN>
The search will be done on typing the search criteria.<SPAN CLASS="AHK-Escape">`n</SPAN>
<SPAN CLASS="AHK-Escape">`n</SPAN>
You may navigate between the input fields by pressing Tab (forward) or Shift+Tab (back).<SPAN CLASS="AHK-Escape">`n</SPAN>
Press Enter to go to the list box, which contains the search results.<SPAN CLASS="AHK-Escape">`n</SPAN>
Select an entry and press Enter again to restore the selected window.<SPAN CLASS="AHK-Escape">`n</SPAN>
<SPAN CLASS="AHK-Escape">`n</SPAN>
Press the Escape (Esc) key to clear all fields and go back to entering the search criteria.<SPAN CLASS="AHK-Escape">`n</SPAN>")
#NoEnv
#NoTrayIcon
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
WinGet, Main_aWndId, ID, A
IfWinExist, %NAME%
Gui, Destroy
Gui, +LastFound +0xCF0000 -0x80000000
Gui, Add, Text, yp+11, Partial Title:
Gui, Add, Edit, xp+82 yp-3 w700 gButtonSearch vGui_title,
Gui, Add, Text, xm, Class Name:
Gui, Add, Edit, xp+82 yp-3 w700 gButtonSearch vGui_class,
Gui, Add, Text, xm, Process Name:
Gui, Add, Edit, xp+82 yp-3 w700 gButtonSearch vGui_pName,
Gui, Add, ListBox, +0x100 t36 xm w800 vGui_wnds,
Gui, Add, Button, Default Hidden w800 vGui_restore, Restore
Gui, Show, AutoSize, %NAME%
Gui_wndId := WinExist()
Main_resize()
Return
#IfWinActive hul! ahk_class AutoHotkeyGUI
{
MsgBox %HELP%
}
ButtonRestore:
Main_restore()
Return
ButtonSearch:
Main_search()
Return
GuiClose:
ExitApp
Return
GuiEscape:
GuiControl, , Gui_title,
GuiControl, , Gui_class,
GuiControl, , Gui_pName,
GuiControl, , Gui_wnds, |
GuiControl, Focus, Gui_title
Return
GuiSize:
Main_resize(A_GuiWidth, A_GuiHeight)
Return
Main_resize(w = 0, h = 0) {
Global Gui_wndId
If (w = 0 Or h = 0) {
Sleep, 250
WinGetPos, x, y, w, h, ahk_id %Gui_wndId%
h += 1
WinMove, ahk_id %Gui_wndId%, , x, y, w, h
} Else {
w -= 2 * 10
w1 := w - (72 + 10)
h -= 3 * 30
GuiControl, Move, Gui_title, w%w1%
GuiControl, Move, Gui_class, w%w1%
GuiControl, Move, Gui_pName, w%w1%
GuiControl, Move, Gui_wnds, w%w% h%h%
}
}
Main_restore() {
Global Gui_wnds
GuiControlGet, wnd, , Gui_wnds
If wnd {
wndId := SubStr(wnd, 1, InStr(wnd, ": ") - 1)
WinShow, ahk_id %wndId%
WinRestore, ahk_id %wndId%
WinSet, AlwaysOnTop, On, ahk_id %wndId%
WinSet, AlwaysOnTop, Off, ahk_id %wndId%
WinMove, ahk_id %wndId%, , 0, 0, 800, 600
} Else
GuiControl, Focus, Gui_wnds
}
Main_search() {
Global Gui_class, Gui_pName, Gui_title, Gui_wndId, Gui_wnds
GuiControl, , Gui_wnds, |
GuiControlGet, title, , Gui_title
GuiControlGet, class, , Gui_class
If class
criteria .= " ahk_class " class
GuiControlGet, pName, , Gui_pName
If pName {
Process, Exist, %pName%
If ErrorLevel
criteria .= " ahk_pid " ErrorLevel
}
If Not (criteria Or title)
criteria := "A"
wndListString := ""
DetectHiddenWindows, On
WinGet, wndId, List, % criteria
Loop, % wndId {
WinGetTitle, wndTitle, % "ahk_id " wndId%A_Index%
If Not (wndId%A_Index% = Gui_wndId) And (Not title Or RegExmatch(wndTitle, title)) {
WinGetClass, wndClass, % "ahk_id " wndId%A_Index%
WinGet, wndPName, ProcessName, % "ahk_id " wndId%A_Index%
WinGet, wndStyle, Style, % "ahk_id " wndId%A_Index%
WinGetPos, wndPosX, wndPosY, wndPosW, wndPosH, % "ahk_id " wndId%A_Index%
wndListString .= "|" wndId%A_Index% ": `t" wndTitle " (" wndClass ", " wndPName ", " wndStyle ", " wndPosX ", " wndPosY ", " wndPosW ", " wndPosH ")"
}
}
DetectHiddenWindows, Off
GuiControl, , Gui_wnds, % wndListString
}
| © 2010-2012 joten, last modified 08.01.2012 |
 |