-
Notifications
You must be signed in to change notification settings - Fork 1
/
显示通知.ahk
119 lines (89 loc) · 1.61 KB
/
显示通知.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
var_current_check:=0
var_msg_t:=0
showMsg(str, y = 50){
SetTimer, RemoveToolTip, 1000
if(StrLen(str) = 0){
return
}
global v_c_x
global v_c_y
global var_msg_t
if(v_c_x = 0 or v_c_y = 0){
MouseGetPos, MouseX, MouseY
v_c_x := MouseX
v_c_y := MouseY
}
if(!var_msg_t){
var_msg_t:=0
}
var_msg_t:=var_msg_t+1
if(var_msg_t > 3){
var_msg_t:=1
}
;MsgBox, %var_msg_t%
ToolTip, %str%, 900, 30*var_msg_t, var_msg_t
}
RemoveToolTip:
global var_msg_t
global var_current_check
ToolTip, %var_msg_t%, 200, 50, 19
if(var_msg_t != var_current_check){
if(var_msg_t > 0){
var_current_check:=var_msg_t
return
}
}
if(var_msg_t > 0){
loop 20{
ToolTip,,,, A_Index
}
var_msg_t:=0
}else{
ToolTip
}
ToolTip
return
*/
var_current_check:=0
var_msg_t:=0
showMsg(str, y = 50){
SetTimer, RemoveToolTip, 1000
if(StrLen(str) = 0){
return
}
global v_c_x
global v_c_y
global var_msg_t
if(v_c_x = 0 or v_c_y = 0){
MouseGetPos, MouseX, MouseY
v_c_x := MouseX
v_c_y := MouseY
}
Gui,Destroy
;y := 50 ;y is the y-coordinate of the prompting window
Gui, +AlwaysOnTop +Disabled -Caption -SysMenu +Owner +LastFound
Gui, font, s26 cFF0000 w600, Verdana
Gui, Color, FF0001
WinSet, TransColor, FF0001
Gui,Add,Text,BackgroundTrans,%str%
Gui, Show, NoActivate Y%y% NA, Title of Window
}
RemoveToolTip:
global var_msg_t
global var_current_check
;ToolTip, %var_msg_t%, 200, 50, 19
if(var_msg_t != var_current_check){
if(var_msg_t > 0){
var_current_check:=var_msg_t
return
}
}
if(var_msg_t > 0){
Gui,Destroy
var_msg_t:=0
}else{
Gui,Destroy
}
return