{"id":239,"date":"2009-05-05T23:40:30","date_gmt":"2009-05-06T04:40:30","guid":{"rendered":"https:\/\/blog.cedeq.com\/?p=239"},"modified":"2024-03-11T00:55:36","modified_gmt":"2024-03-11T00:55:36","slug":"autohotkey-display-an-on-screen-message","status":"publish","type":"post","link":"https:\/\/blog.cedeq.com\/autohotkey-display-an-on-screen-message\/","title":{"rendered":"AutoHotkey – Display an on-screen message"},"content":{"rendered":"\n
When I use AutoHotkey to run background tasks, download files and prepare backups, I want to know what happens without wondering if it is really working or not. Also, I like to be prompted and to confirm actions before running them.<\/p>\n\n\n\n
There is a command in AutoHotkey, For instance, to show a message that confirms that I open my Calculator, I would write the following AutoHotkey script:<\/p>\n\n\n\n This dialog box would show \u00ab Calculator is open and running. \u00bb with a OK button that I must click to close it.<\/p>\n\n\n\n There are many ways to display an on-screen message with MsgBox by adding parameters, such as (in order):<\/p>\n\n\n\n Display a message box for 3 seconds<\/strong> In this case, you can use the confirmation to generate actions whether you clicked Yes or No in the message box. For example, if I want to launch Calculator after clicking on the Yes button:<\/p>\n\n\n\n For more information about the MsgBox command, please refer to AutoHotkey documentation available on the Web: http:\/\/www.autohotkey.com\/docs\/commands.htm<\/a><\/em><\/p>\n\n\n\n Edmond<\/p>\n","protected":false},"excerpt":{"rendered":" When I use AutoHotkey to run background tasks, download files and prepare backups, I want to know what happens without wondering if it is really working or not. Also, I like to be prompted and to confirm actions before running them. There is a command in AutoHotkey, MsgBox, that displays a message box on screen. … Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"yoast_head":"\nMsgBox<\/code>, that displays a message box on screen.<\/p>\n\n\n\n
Run Calculator
\nMsgBox, Calculator is open and running.
\nReturn<\/code><\/p>\n\n\n\n\n
Add a title to the message box<\/strong>MsgBox, 0, My title, Calculator is open and running.<\/code><\/p>\n\n\n\n
MsgBox, 0, My title, Calculator is open and running, 3<\/code>
Display a confirmation (Yes\/No) in the message box<\/strong>MsgBox, 4, My title, Do you want to open Calculator?<\/code><\/p>\n\n\n\n
MsgBox, 4, Calculator, Do you want to open Calculator?
\nIfMsgBox, Yes, run, calc
\nReturn<\/code><\/p>\n\n\n\n