-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ahk
95 lines (89 loc) · 2.59 KB
/
test.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
$F1:: AltTab()
$F2:: AltTabMenu()
; AltTab-replacement for Windows 8:
AltTab() {
; list := ""
; WinGetList(,), id, list
; Loop, %id%
; {
; this_ID := id%A_Index%
; IfWinActive, ahk_id %this_ID%
; continue
; WinGetTitle, title, ahk_id %this_ID%
; If (title = "")
; continue
; If (!IsWindow(WinExist("ahk_id" . this_ID)))
; continue
; WinActivate, ahk_id %this_ID%
; WinWaitActive, ahk_id %this_ID%, , 2
; break
; }
ids := WinGetList(, , "")
for this_id in ids
{
WinActivate this_id
this_class := WinGetClass(this_id)
this_title := WinGetTitle(this_id)
Result := MsgBox(
(
"Visiting All Windows
" A_Index " of " ids.Length "
ahk_id " this_id "
ahk_class " this_class "
title " this_title "
Continue?"
), , 4)
if (Result = "No")
break
}
}
; AltTabMenu-replacement for Windows 8:
AltTabMenu() {
; list := ""
; Menu, windows, Add
; Menu, windows, deleteAll
; WinGet, id, list
; Loop, %id%
; {
; this_ID := id%A_Index%
; WinGetTitle, title, ahk_id %this_ID%
; If (title = "")
; continue
; If (!IsWindow(WinExist("ahk_id" . this_ID)))
; continue
; Menu, windows, Add, %title%, ActivateTitle
; WinGet, Path, ProcessPath, ahk_id %this_ID%
; Try
; Menu, windows, Icon, %title%, %Path%, , 0
; Catch
; Menu, windows, Icon, %title%, %A_WinDir%\System32\SHELL32.dll, 3, 0
; }
; CoordMode, Mouse, Screen
; MouseMove, (0.4 * A_ScreenWidth), (0.35 * A_ScreenHeight)
; CoordMode, Menu, Screen
; Xm := (0.25 * A_ScreenWidth)
; Ym := (0.25 * A_ScreenHeight)
; Menu, windows, Show, %Xm%, %Ym%
}
; ActivateTitle:
; SetTitleMatchMode 3
; WinActivate(, A_ThisMenuItem)
; return
;-----------------------------------------------------------------
; Check whether the target window is activation target
;-----------------------------------------------------------------
; IsWindow(hWnd) {
; WinGet, dwStyle, Style, ahk_id %hWnd%
; if ((dwStyle & 0x08000000) || !(dwStyle & 0x10000000)) {
; return false
; }
; WinGet, dwExStyle, ExStyle, ahk_id %hWnd%
; if (dwExStyle & 0x00000080) {
; return false
; }
; WinGetClass, szClass, ahk_id %hWnd%
; if (szClass = "TApplication") {
; return false
; }
; return true
; }