The utility is very simple, as the name suggests it shows the dialog box with specified caption, message, icon and one or several buttons. If you look at the source code you'll see that it just a call of the system MessageBox function (more about it here).
One of the cool feature is that you can pin the MessageBox to another running application, and block it until the user click one of the buttons.
Here is an example:
- Run windows calculator (calc.exe),
- Open cmd shell and change directory to where you unzip the emsgbox.exe,
- run following command:
emsgbox.exe /n calc.exe /c Calculator Info /m 2+2=5 /t 48The calulcator will be blocked until you click OK button.
The button number which user has clicked is placed in %errorlevel% environment variable (or $lasterrorcode - powershell), however this method works only if you write a batch script or in the cmd shell when you use emsgbox.exe as follow:
start /wait emsgbox.exe /n calc.exe /c Calculator Info /m 2+2=5 /t 48
echo %errorlevel%
(as I said if you use it in batch script you don't have to use "start /wait" statement)
Link to the project/download page:
0 comments:
Post a Comment