자신의 카운트 다운이 정말 좋으면 MsgBox로 작동하는 GUI를 만들 수 있습니다. 이 예에서
, 우리는 4 개 매개 변수가 있습니다.
- 창
- 메시지
- 초
- 사라질 때 호출 할 레이블의 이름의 수의 제목입니다.
다음은 코드가 일반적인 MsgBox에서이 코드로 변경되는 방식입니다.
MsgBoxTimed("Title", "Msg", 10, "Foo")
return
Foo:
OtherCode
return
이 기능에
MsgBox, Title, Msg
OtherCode
return
동일한 파일에 있어야합니다, 또는 #Include
d
MsgBoxTimed(title, msg, seconds, complete="") {
static init = false, _seconds, _complete
global Msg92, Seconds92
if (!init)
{
init := true
Gui, 92:Font, s24
Gui, 92:Add, Text, vMsg92 Center w360, %msg%
Gui, 92:Font, s30 cRed
Gui, 92:Add, Text, vSeconds92 Center w360, %seconds%
}
_seconds := seconds
_complete := complete
GuiControl, 92:, Msg92, %msg%
Gui, 92:Show, w400 h150, %title%
Update92:
GuiControl, 92:, Seconds92, %_seconds%
_seconds -= 1
if (_seconds > 0) {
SetTimer, Update92, -1000
}
else {
Gui, 92:Hide
if (_complete)
SetTimer, %_complete%, -1
}
return
}
당신은'tooltip'을 고려 했습니까? –
화면 어디에서나 팝업을 만들려면 [SplashTextOn] (http://www.autohotkey.com/docs/commands/SplashTextOn.htm)을보십시오. – MCL