Das Funktoniert
Code: Select all
; Show visible windows
; https://autohotkey.com/board/topic/50899-resolvedhow-to-get-all-visible-windows/
bWidth := 50, lines := 0, bkg := "F9FF59", width := A_ScreenWidth - 400 - bWidth
fontName := "Arial", fontSize := 10
excludeExact = Daily
,Program Manager
,Start
,Windows Task Manager
excludeContains = \rainmeter\Skins
; -------------------------------
WinGet, winArray, List ; Get unique ID numbers of all windows
Loop, %winArray% { ; Loop through all windows
title := "ahk_id " winArray%A_Index%
WinGet, winStyle, Style, %title% ; Get 8-digit hexadecimal number representing the window's style
WinGetTitle, title, %title%
If !(winStyle & 0x10000000) || !title
Continue
If title in %excludeExact%
Continue
If title contains %excludeContains%
Continue
box .= "`t" title, lines++
}
box := SubStr(box, 2)
Gui, Switch:New,, Visible windows (%lines%)
Gui, Switch:Font, s%fontSize%, %fontName%
Gui, Switch:Color, %bkg%
Gui, Switch:+DelimiterTab +AlwaysOnTop -MinimizeBox -MaximizeBox
Gui, Switch:Add, ListBox, w%width% r%lines% Sort vchoice, %box%
Gui, Switch:Add, Button, x+10 w%bWidth% default gSwitch, Switch
Gui, Switch:Show, AutoSize Center
Return
Switch:
Gui, Switch:Submit
If choice
WinActivate, %choice%
SwitchGuiEscape:
SwitchGuiClose:
;ein/aus mit F9
F9::SetTimer TastenDrücken,% (TastenDrücken:=!TastenDrücken)?-1:"Off"
TastenDrücken:
While, TastenDrücken
{
ControlSend,, {2}, %choice%
}
Return
AutoRepeat(Key,Duration:=0,ByRef Aktive:=True)
{
End := A_TickCount + Duration
While, Aktive And A_TickCount < End
{
SendInput, {%Key% Down}
Sleep, 300
}
SendInput, {%Key% Up}
}
Aber nur bei Editor, in einem Spiel nicht.
Woran kann das liegen?