Skip to main content

The code below defaults to YES when the WOWMESSAGEBOX displays.  So the user can

press ENTER or click YES for "YES"

or

click NO for "NO".

 I'm trying to display the WOWMESSAGEBOX with no default so the user will be forced to click YES or NO in order to contunue.

Any ideas?  Thanks!!

              INITIALIZE MESSAGE-BOX-FLAGS.
              SET MB-DEFBUTTON3 MB-YESNO MB-TASKMODAL TO TRUE.
              CALL WOWMESSAGEBOX USING WIN-RETURN 0
               "Continue Entering This Order?"
               "WARNING"
               MESSAGE-BOX-FLAGS.


#COBOL
#RMCOBOL

The code below defaults to YES when the WOWMESSAGEBOX displays.  So the user can

press ENTER or click YES for "YES"

or

click NO for "NO".

 I'm trying to display the WOWMESSAGEBOX with no default so the user will be forced to click YES or NO in order to contunue.

Any ideas?  Thanks!!

              INITIALIZE MESSAGE-BOX-FLAGS.
              SET MB-DEFBUTTON3 MB-YESNO MB-TASKMODAL TO TRUE.
              CALL WOWMESSAGEBOX USING WIN-RETURN 0
               "Continue Entering This Order?"
               "WARNING"
               MESSAGE-BOX-FLAGS.


#COBOL
#RMCOBOL

This functionality is similar to the MessageBox functionality in Visual Basic 6.  If you research eliminating the default button in VB6, you will discover that it is not possible to eliminate having a default button.

A workaround is to create a form that emulates the message box functionality.  At that point you have much more control over the behavior.  


The code below defaults to YES when the WOWMESSAGEBOX displays.  So the user can

press ENTER or click YES for "YES"

or

click NO for "NO".

 I'm trying to display the WOWMESSAGEBOX with no default so the user will be forced to click YES or NO in order to contunue.

Any ideas?  Thanks!!

              INITIALIZE MESSAGE-BOX-FLAGS.
              SET MB-DEFBUTTON3 MB-YESNO MB-TASKMODAL TO TRUE.
              CALL WOWMESSAGEBOX USING WIN-RETURN 0
               "Continue Entering This Order?"
               "WARNING"
               MESSAGE-BOX-FLAGS.


#COBOL
#RMCOBOL

By "default", do you mean the button that's operated if the user simply presses the enter key?  I looked at the underlying Windows API and it's not possible to produce a native Windows message box that doesn't have the keyboard focus set to a control.  

You could add a third button to the message box that does nothing when clicked, or create your own message box-like dialog that does exactly what you want -- maybe a dialog with a hidden button that does nothing but has the focus. Any other native message box solution would require subclassing the window and adding a C-language hook, which is much more complicated and fragile than using a custom dialog.