IfmManage::fmMessageBox
This method displays an application-modal message box.
Syntax
HRESULT fmMessageBox( BSTR bstrMsg, BSTR bstrCaption, LONG uType, LONG Flags, LONG *pRes );
Parameters
- bstrMsg
- Unicode string that contains text of the message. The message can be a file name if the flag FMMB_FLG_FILENAME is set in Flags, or in HTML if the flag FMMB_FLG_HTML is set in Flags.
- bstrCaption
- Unicode string that contains the caption to place in the title bar of the message box form. If bstrCaption is NULL, the application name property of the Forms Manager is used, and the AppSmallIcon from the application is displayed for the form icon.
- uType
- Specifies one of the following types:
MB_ABORTRETRYIGNORE |
MB_NOBUTTONS |
MB_OKCANCEL |
MB_OK |
MB_RETRYCANCEL |
MB_YESNOCANCEL |
MB_YESNO |
The type flags can be combined with one of the following optional icons:
MB_APC_ICONCHECK |
MB_ICONASTERISK |
MB_ICONEXCLAMATION |
MB_ICONHAND |
MB_ICONQUESTION |
- Flags
- Specifies how the message box is displayed. It is any combination of the following values:
- FMMB_FLG_AUTODISMISS
- Automatically dismisses the message box after a specified time.
- FMMB_FLG_TTS
- Reads the message aloud using text-to-speech.
- FMMB_FLG_BEEP
- Plays an audible beep when the message box appears.
- FMMB_FLG_FILENAME
- Specifies that bstrMsg is the name of a file that is opened to retrieve the actual text of the message.
- FMMB_FLG_HTML
- Treats the message as HTML text.
- FMMB_FLG_OUTOFSTORAGE
- Creates an out-of-storage message box. If this flag is set, bstrMsg and the FMMB_FLG_FILENAME flag are ignored.
- pRes
- Pointer to a long integer that contains the user’s response. It is one of the following values, depending on the type of message box:
IDABORT |
IDCANCEL |
IDIGNORE |
IDNO |
IDOK |
IDRETRY |
IDYES |
Return Values
S_OK indicates success. E_INVALIDARG indicates that an invalid argument was entered. If an error occurs, the appropriate HRESULT value is returned.
Remarks
This method is a synchronous call that does not return until user finishes interacting with the message box.
You must call this method from the thread that created the Forms Manager object. While that thread executes this method, a dispatch loop within this method calls the sinks on the Forms Manager object. If a message is posted to the thread using the thread identifier while this method executes, the message is removed from the message queue internally.