I hope this is the right forum section to provide this script?
I have improved an AHK (www.AutoHotkey.com) script
from user "icefreez" called "Simple Message, on top for a delayed time"
found at http://www.autohotkey.com/forum/viewtopic.php?p=135127#135127
I want to display an Message Box to provide some info or help to me or an user/customer.
This script show an GUI without border and (OK,Yes,No) buttons.
The time out, the font size and the font face can be choose.
I use this MsgBox with Total Commander to add menu entry without an function but provide an info to me.
Total Commander allow no empty commands so i create an own dummy command who shows an info box only.
I could use this MessaBox script to add an menu entry to show me an longer text to hint me to an trick or the right syntax of an TC command.
I could use this MessaBox in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" to provide an one time info to customers.
I could use this MessaBox with Task planer to remind me on something.
I could use this MessaBox in DOS batch.cmd to prompt some info.
Maybe it is helpful for others too? Here it is...
Here is the code (Open Source)
v.05 So.15.07.2007
Added some baubles to avoid making bad jokes with it
; Timeout > 15sec => Provide some Info to the user
; Timeout > 29sec => User info plus possibility to cancel
; Timeout > 119sec => User info plus possibility to cancel plus show start info
---
Here is the compiled exe (Open Source):
MessaBox_v05.exe (196.6 KB)
, just run it to see an help:

------------------------------------
Use it with DOS

-
Use it with an .LNK short cut

-
Use it as Total Commander button

-
Use it as Total Commander user command


-
.
I have improved an AHK (www.AutoHotkey.com) script
from user "icefreez" called "Simple Message, on top for a delayed time"
found at http://www.autohotkey.com/forum/viewtopic.php?p=135127#135127
I want to display an Message Box to provide some info or help to me or an user/customer.
This script show an GUI without border and (OK,Yes,No) buttons.
The time out, the font size and the font face can be choose.
I use this MsgBox with Total Commander to add menu entry without an function but provide an info to me.
Total Commander allow no empty commands so i create an own dummy command who shows an info box only.
I could use this MessaBox script to add an menu entry to show me an longer text to hint me to an trick or the right syntax of an TC command.
I could use this MessaBox in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" to provide an one time info to customers.
I could use this MessaBox with Task planer to remind me on something.
I could use this MessaBox in DOS batch.cmd to prompt some info.
Maybe it is helpful for others too? Here it is...
Here is the code (Open Source)
v.05 So.15.07.2007
Added some baubles to avoid making bad jokes with it
; Timeout > 15sec => Provide some Info to the user
; Timeout > 29sec => User info plus possibility to cancel
; Timeout > 119sec => User info plus possibility to cancel plus show start info
Spoiler (click to show/hide)
#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, [x]Close
}
Gui, Show, NoActivate, X0, Y0
sleep, %mySec%
Gui, Destroy
LaunchExit:
Gui, Destroy
ExitApp
Return
}
#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, [x]Close
}
Gui, Show, NoActivate, X0, Y0
sleep, %mySec%
Gui, Destroy
LaunchExit:
Gui, Destroy
ExitApp
Return
}
Here is the compiled exe (Open Source):
MessaBox_v05.exe (196.6 KB)
, just run it to see an help:
------------------------------------
Use it with DOS

-
Use it with an .LNK short cut
-
Use it as Total Commander button

-
Use it as Total Commander user command


-
.









