GUI ScreenIO for Windows

 ScreenIO.com


MessageBox

This API lets you display a messagebox the hard way. 

The best way to display a messagebox is shown here.

Client/Server issues

This always displays the messagebox on the client.

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY MSGBOX.


     
* ------------------------: Call the API.
*
     SET API-MESSAGEBOX TO TRUE.

     CALL 'GSWINAPI' USING WIN32API-PARMS
                           MESSAGEBOX-PARMS
                           WIN32API-B
                           WIN32API-C
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.

Parameters specific to this function

Message box button pressed by the user

Test these 88-level items to determine which button was pressed by the user.  The values are obvious.  Example:

     EVALUATE TRUE
       WHEN MB-RETURNED-ABORT
         CONTINUE
       WHEN MB-RETURNED-CANCEL
         CONTINUE
       WHEN MB-RETURNED-CONTINUE
         CONTINUE
       WHEN MB-RETURNED-IGNORE
         CONTINUE
       WHEN MB-RETURNED-NO
         CONTINUE
       WHEN MB-RETURNED-OK
         CONTINUE
       WHEN MB-RETURNED-RETRY
         CONTINUE
       WHEN MB-RETURNED-TRYAGAIN
         CONTINUE
       WHEN MB-RETURNED-YES
         CONTINUE
     END-EVALUATE

MB-TITLE

Title of your messagebox.

MB-LINE1 through MB-LINE4

Text that will be displayed in lines 1 through 4 of the messagebox.

Buttons

Set the value to TRUE to specify which buttons will appear in your messagebox.  The default is an OK button.  Example:

     SET MB-BTN-OKCANCEL TO TRUE.

MB-BTN-OK
MB-BTN-OKCANCEL
MB-BTN-RETRYCANCEL
MB-BTN-YESNO
MB-BTN-YESNOCANCEL
MB-BTN-ABORTRETRYIGNORE
MB-BTN-CANCELTRYCONTINUE

Icon

Set the value to TRUE to specify which icon will appear in your messagebox.  The default is the information (i) icon.  Example:

     SET MB-ICON-QUESTION TO TRUE.

MB-ICON-INFORMATION
MB-ICON-EXCLAMATION
MB-ICON-QUESTION
MB-ICON-STOP

Default button

Specifies which button is the default button; that is, the one that is selected if the user presses Enter.  Set the desired value to TRUE:

     SET MB-DEFAULT-BUTTON-IS-2 TO TRUE.

MB-NO-DEFAULT-BUTTON
MB-DEFAULT-BUTTON-IS-1
MB-DEFAULT-BUTTON-IS-2
MB-DEFAULT-BUTTON-IS-3
MB-DEFAULT-BUTTON-IS-4

Modality

Specifies the modality of the messagebox.  Modality is Microsoft's obtuse wording referring to the degree of control that the message box imposes on the underlying application windows, or other applications.  A message box may disable the underlying windows, forcing the user to deal with the message box before other tasks can be resumed.

Set the desired value to TRUE.

MB-MODE-TASKMODAL
MB-MODE-APPLMODAL
MB-MODE-SYSTEMMODAL

MB-HWND

The handle of the owner window; usually panel-HWND.

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom