MessageBox

Top  Previous  Next

 

MessageBox

 

Syntax

MessageBox([in] Type, [in] Title, [in] Message, [in] Icon, [out] ReturnValVar);

 

Description

To open a message box. The message box style varies depending on the Type command argument.

 

Parameters

       Type

               The message box style to create. There are 7 styles supported:

                       0 = MB_OK

                       1 = MB_OKCANCEL

                       2 = MB_YESNO

                       3 = MB_YESNOCANCEL

                       4 = MB_ABORTRETRYIGNORE

                       5 = MB_RETRYCANCEL

                       6 = MB_CANCELTRYCONTINUE

       Title

               The message box title

       Message

               The message box string message

       Icon

               The message box icon. There are 4 icons supported:

                       0 = No icon

                       1 = MB_ICONHAND

                       2 = MB_ICONQUESTION

                       3 = MB_ICONEXCLAMATION

                       4 = MB_ICONASTERISK                

       ReturnValVar

               The variable name to receive the message box return value. The following possible return values are supported:

                       1 = IDOK

                       2 = IDYES

                       3 = IDNO

                       4 = IDCLOSE

                       5 = IDCANCEL

                       6 = IDABORT

                       7 = IDRETRY

                       8 = IDIGNORE

                       9 = IDHELP

                       10 = IDTRYAGAIN

                       11 = IDCONTINUE        

Return

       1 = success

       0 = failed

       -1 = FSCommands cannot be found

 

Example

 

FSCommand("MessageBox", "2,Warning,Do you want to quit the application?,2,RetVar");

 

This will show a message box asking "Do you want to quit the application?" and with a Yes and No button. When Yes button is pressed, a return value of 2 (IDYES) will be received by _root.RetVar variable. When No button is pressed, a return value of 3 (IDNO) will be received by _root.RetVar variable.