#SingleInstance force
#NoTrayIcon
;^!e::exitapp ; Ctrl+Alt+e exits script
;Little script for some nice Message Boxes. Code from icefreez. Enhanced from Stefan. v0.4
;Syntax: mb.exe TimeOut-in-seconds "Text to display" [Font-Size "Font to use" Format-Bold-or-not]
If 1 =
1 = 30
mySec = %1%
If 2 =
{
myMsg = `nUpps, no parameters from you?`n
myMsg = %myMsg%Use %A_ScriptName% as an command line tool or use an link to %A_ScriptName% with this parameters.`n
myMsg = %myMsg%I use it in Total Commander to provide help messages. Or in HKLM\RunOnce to inform an customer. OR...`n`n
myMsg = %myMsg%Syntax:`t`t%A_ScriptName% sec "Message"`n
myMsg = %myMsg%Example:`t%A_SCRIPTNAME% %1% "My message is here"`n`n
myMsg = %myMsg%And "My message is here" will displayed over everything for %1% seconds in default font Arial in size 12.`n`n
myMsg = %myMsg%You can use ``n for line feed and ``t for tab.`n
myMsg = %myMsg%Advanced Syntax:`t%A_ScriptName% sec "Message" Fontsize "Font name" b-for-bold `n`n
myMsg = %myMsg%Visit
www.AutoHotkey.com and
www.DonationCoder.com for more. (Stefan in 2007)`n`n
}
ELSE
myMsg = %2%
If 3 =
3 = 12
mySize = %3%
If 4 =
4 = Arial
myFont = %4%
If 5 = b
myFormat = wbold
fivesecdisp(mySec,mySize,myMSG,myFont,myFormat,v6)
exitapp ;exits script
fivesecdisp(sec,siz,text,myFont,myFormat,v6){
mySec := sec * 1000
myCloseTime =
myCloseTime += sec, seconds
FormatTime, myCloseTime, %myCloseTime%, HH:mm:ss
; Timeout > 15sec => User info
; Timeout > 29sec => User info plus possibility to cancel
; Timeout > 119sec => User info plus possibility to cancel plus show start info
If sec >14 ; Give the user some info if the time out is set longer then a few seconds
{
myInfo = Closing myself automatically in %sec% seconds at %myCloseTime%
myY = y20
}
ELSE
myY = y10
If sec >29 ;Give the user the possibilty to exit the app if the time out is set too long
{
myInfo = Closing myself automatically in %sec% seconds at %myCloseTime%
myY = y25
}
If sec >119 ;Give the user the possibilty to exit the app if the time out is set too long
{
myInfo = Closing myself automatically in %sec% seconds at %myCloseTime%`nStartet from %A_SCRIPTFULLPATH%
myY = y30
}
Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui, Color, dddddd ;changes background color
Gui, Font, 000000 s8 , Arial
Gui, Add, Text, x20 y2, %myInfo%
Gui, Font, 000000 s%siz% %myFormat%, %myFont% ;Arial ;Lucida Console ;Comic Sans MS
;MS Sans Serif ;Times ;Verdana ;changes font color, size and font
Gui, Add, Text, x20 %myY%, %text% ;the text to display
If sec > 29
{
Gui, Font, 000000 s8 , Arial
Gui, Add, Text, cBlue gLaunchExit,
}
Gui, Show, NoActivate, X0, Y0
sleep, %mySec%
Gui, Destroy
LaunchExit:
Gui, Destroy
ExitApp
Return
}