IntControl (12, p1, p2, 0, 0)
IntControl 12 is used to direct WIL and its parent application (if the parent application supports this function) as to how to handle users either terminating WinBatch via the "Ctrl-Break" keystroke sequence or perhaps a menu item, or by simply exiting windows.
p1 Codes are created by adding the Exit Windows value and the Terminate WIL value together.
1) Exit Windows: Used to direct how and if Windows will exit.
p1 (choose one).
0 Pop up message box giving user a chance to either cancel bat file or continue.
1 Allow Windows to be exited with no warning.
2 Refuse any attempt to exit Windows and give optional warning. (When p2 is not "" or "0", a message box will display p2.)
e.g. IntControl(12,2,"Attention! Close all apps first",0,0)
3 Reserved
2) Terminate WIL: Used to direct WIL to allow itself to be terminated without warning or to simply refuse any termination request (such as Ctrl-Break).
p1 (chose one).
0 Provide notification message when program terminated by user.
4 Allow quiet termination.
8 Refuse to terminate.
p2 Codes: When the "Exit Windows" group code "2" is included in p1, p2 provides the message to display to the user. Use "" or "0" to clear any previously-set exit message.
Returns previous setting.
; We want to refuse any attempt to exit Windows until the WIL script ; is complete and also refuse any attempts to close the WIL script. ; Add codes 2 and 8 making 10 IntControl(12,10,"Close Net apps before exiting Windows", 0, 0 ) Message("IntControl"," Done.")