I understand this is not what you want but I've created a somewhat similar script, where a dropdown with list of open window are shown.
Code: Select all
;Ctrl+Shfit+D to activate
^+D::
DetectHiddenWindows, Off
; This will be the GUI name
WindArray := {}
SysGet, OutputVar, MonitorCount
WinName = Bring Open Window On Top
WinGet, OpenWindow, List
If !WinExist(WinName)
{
Gui,+AlwaysOnTop
Gui, Font, s11, Arial
Gui, Add, DropDownList, gShowToolTip x7 y9 w260 vWindowMove,Pick a Window||
Gui, Add, Button, x282 y8 w50 h28 gPosChoice, Open
}
Else
{
Gui, Destroy
Gui,+AlwaysOnTop
Gui, Font, s11, Arial
Gui, Add, DropDownList, gShowToolTip x7 y9 w260 vWindowMove,Pick a Window||
Gui, Add, Button, x282 y8 w50 h28 gPosChoice, Open
}
Loop, %OpenWindow%
{
id := OpenWindow%A_Index%
WinGetTitle Title, ahk_id %id%
WinGet, style, style, ahk_id %id%
WinGet, ClsID, ID, ahk_id %id%
If !(style & 0xC00000) or (title = "")
continue
WinGetClass class, ahk_id %id%
If (class = "ApplicationFrameWindow")
{
WinGetText, text, ahk_id %id%
If (text = "")
{
WinGet, style, style, ahk_id %id%
If !(style = "0xB4CF0000") ; the window isn't minimized
continue
}
}
GuiControl,,WindowMove, %Title%
WindArray.Insert(Title, ClsID)
}
Gui, Show, h45 w345, %WinName%
hwnd:=WinExist(WinName)
Return
ShowToolTip:
Gui,Submit,NoHide
;remove any previous tooltip
GoSub RemoveToolTip
if (InStr(WindowMove, "Pick a Window", true) = 0 and WindowMove!="")
{
ControlGetPos,x,y,w,h,ComboBox1,ahk_id %hwnd%
ToolTip %WindowMove%,x,y+h,10
SetTimer,RemoveToolTip,-3000
}
Return
PosChoice:
Gui, Submit, NoHide
if (InStr(WindowMove, "Pick a Window", true) = 0 and WindowMove!="")
{
;return Associative array value
IDValue:= WindArray[WindowMove]
if WinExist("ahk_id " IDValue)
{
WinActivate, Ahk_ID %IDValue%
;MoveIt(IDValue)
GoSub ^+D ; Recall it again to refresh status
}
else
{
GoSub ^+D ; Recall it again to refresh status
}
GoSub RemoveToolTip
}
Return
RemoveToolTip:
ToolTip,,,,10
Return
GuiClose:
Gui, Destroy
Return
Now you just need to find a way to create a dropdown list with search option.