MiniGUI API Reference (MiniGUI-Processes)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Functions
Message box operations

Functions

MG_EXPORT int GUIAPI MessageBox (HWND hParentWnd, const char *pszText, const char *pszCaption, DWORD dwStyle)
 Displays a message box within one, two, or three push buttons. More...
 
MG_EXPORT void GUIAPI MessageBeep (DWORD dwBeep)
 Makes a sound of beep. More...
 

Detailed Description

Function Documentation

void GUIAPI MessageBeep ( DWORD  dwBeep)

Makes a sound of beep.

This function makes a sound of beep. We ignore dwBeep argument so far.

Parameters
dwBeepThe beep type, ignored so far.
See also
Beep, Ping, Tone

Referenced by DialogBoxIndirectParam().

int GUIAPI MessageBox ( HWND  hParentWnd,
const char *  pszText,
const char *  pszCaption,
DWORD  dwStyle 
)

Displays a message box within one, two, or three push buttons.

This function displays a message box within one, two, or three buttons, and returns the identifier of the button clicked by the user. You can pass dwStyle argument with different values to control the number of buttons, the button titles, and so on.

Parameters
hParentWndThe handle to the hosting main window.
pszTextThe message text will be displayed in the message box.
pszCaptionThe caption of the message box.
dwStyleSpecifies the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
     To indicate the buttons displayed in the message box, specify 
     one of the following values.
     - MB_OK\n
       Create a message box within only one button whose title is "OK".
     - MB_OKCANCEL\n
       Create a message box within two buttons whose title are "OK" 
       and "Cancel" respectively.
     - MB_YESNO\n
       Create a message box within two buttons whose title are "Yes" 
       and "No" respectively.
     - MB_RETRYCANCEL\n
       Create a message box within two buttons whose title are "Retry" 
       and "Cancel" respectively.
     - MB_ABORTRETRYIGNORE\n
       Create a message box within three buttons whose title are 
       "Abort", "Retry" and "Ignore" respectively.
     - MB_YESNOCANCEL\n
       Create a message box within three buttons whose title are 
       "Yes", "No" and "Cancel" respectively.
     - MB_CANCELASBACK\n
       Title "Cancel" replaced with title "Previous".

     To display an icon in the message box, specify one of the following
     values.
     - MB_ICONHAND\n
       Display a hand/stop icon in the message box.
     - MB_ICONQUESTION\n
       Display a question mark icon in the message box.
     - MB_ICONEXCLAMATION\n
       Display a exclamation mark icon in the message box.
     - MB_ICONASTERISK\n
       Display an information icon in the message box.
     - MB_ICONINFORMATION\n
       Display an information icon in the message box.
     - MB_ICONSTOP\n
       Display a hand/stop icon in the message box.

     To indicate the default button, specify one of the following values.
     - MB_DEFBUTTON1\n
       The first button is the default button. 
     - MB_DEFBUTTON2\n
       The second button is the default button. 
     - MB_DEFBUTTON3\n
       The third button is the default button. 

     To indicate the default text alignment, specify one of the following
     values.
     - MB_ALIGNCENTER\n
       The message box is center aligned.
     - MB_ALIGNTOPLEFT\n
       The message box is upper-left aligned.
     - MB_ALIGNBTMLEFT\n
       The message box is lower-left aligned.
     - MB_ALIGNTOPRIGHT\n
       The message box is upper-right aligned.
     - MB_ALIGNBTMRIGHT\n
       The message box is lower-right aligned.

     To indicate the default align based on hosting window, specify the following value.
     - MB_BASEDONPARENT\n
       A flag indicates that the alignments above are based on the 
       hosting window, not the desktop. 
Returns
The identifier of the button clicked by user, can be one of the following values:
  • IDOK
    The "OK" button clicked.
  • IDCANCEL
    The "Cancel" or "Previous" button clicked.
  • IDABORT
    The "Abort" button clicked.
  • IDRETRY
    The "Retry" button clicked.
  • IDIGNORE
    The "Ignore" button clicked.
  • IDYES
    The "Yes" button clicked.
  • IDNO
    The "No" button clicked.
Note
This function will call GetSysText to translate the button titles to localized text.
See also
GetSysText, DialogBoxIndirectParam

Referenced by DialogBoxIndirectParam().