MessageBox() - More than 3 Buttons possible?

To add comments, please log in or register
emches
50
emches  

Hello,

according to the documentation (https://docs.mql4.com/constants/io_constants/messbconstants)

"The main flags of the MessageBox() function define contents and behavior of the dialog window. This value can be a combination of the following flag groups:"

But when I try this:

int PlaceTrade = MessageBox(MessageBoxMsg+"\n"+"\n","Place Order?",0x00000004|0x00000001);
 if(PlaceTrade==6){ Print("MB: YES Button Pressed");}  // -------------- Message BOX returns YES
 if(PlaceTrade==7){ Print("MB: NO Button Pressed");}  // -------------- Message BOX returns NO
 if(PlaceTrade==1){ Print("MB: OK Button Pressed");}  // -------------- Message BOX returns OK
 if(PlaceTrade==2){ Print("MB: Cancel Button Pressed");}  // -------------- Message BOX returns Cancel

I get a Box with "Retry" and "Cancel".

Same result when i try with MB_YESNO | MB_OKCANCEL


Anybody know how to get the combined flags to work?
MessageBox - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference
MessageBox - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
This section contains return codes of the MessageBox() function. If a message window has a Cancel button, the function returns IDCANCEL, in case if the ESC key or the Cancel button is pressed. If there is no Cancel button in the message...
Demos Stogios
223
Demos Stogios  
emches:

Hello,

according to the documentation (https://docs.mql4.com/constants/io_constants/messbconstants)

"The main flags of the MessageBox() function define contents and behavior of the dialog window. This value can be a combination of the following flag groups:"

But when I try this:

I get a Box with "Retry" and "Cancel".

Same result when i try with MB_YESNO | MB_OKCANCEL


Anybody know how to get the combined flags to work?

Hello,

I guess it means that we can have a combination of flags from the "following three groups", so one of each group: button, icon, default button

emches
50
emches  

I thought the same, however the last line on that page shows this:

MB_DEFBUTTON4

0x00000300

The fourth button is default


So there must be a way to get a fourth button somehow.

Demos Stogios
223
Demos Stogios  
emches:

I thought the same, however the last line on that page shows this:

MB_DEFBUTTON4

0x00000300

The fourth button is default


So there must be a way to get a fourth button somehow.

It looks like a Windows case, I read this https://blogs.msdn.microsoft.com/oldnewthing/20081219-00/?p=19773

greets

What is the mysterious fourth message box button?
What is the mysterious fourth message box button?
  • 2008.12.19
  • Raymond Chen - MSFT
  • blogs.msdn.microsoft.com
When you call the function, you pass flags specifying which of a fixed set of button patterns you want (for example, Yes/No and OK/Cancel) and which button you want to be the default ( through .) Wait a second. What's with this ? None of the button patterns are four-button patterns. The highest number of buttons you can specify is three...
whroeder1
17940
whroeder1  
Please use the link button Use the link button See the difference? https://blogs.msdn.microsoft.com/oldnewthing/20081219-00/?p=19773
          Messages Editor
emches
50
emches  
Demos Stogios:

It looks like a Windows case, I read this https://blogs.msdn.microsoft.com/oldnewthing/20081219-00/?p=19773

greets

Thanks for your comments and the info/link. I'll read that later on.

Regards

To add comments, please log in or register