Sidebar

Using Directory Opus
Configuration
Programming
Reference Section
reference:plugins:plugin_sdk:utility_functions:showrequestdlg

ShowRequestDlg(
     LPSHOWREQUESTDLGDATA:lpDlgData
)
→ int

Arguments

lpDlgData

[in] A pointer to a SHOWREQUESTDLGDATA structure that defines the dialog.

Return value

Returns a value corresponding to the button the user selected.

The return code corresponds to the button selected by the user. For example, assume the buttons specified in the input structure are %%Ok|Skip|Retry|Abort%%. The left-most button (in this example, Ok) corresponds to 1, the next button to 2, and so on. When there is more than one button, the right-most (Abort in this example) is designated as 0.

Description

The ShowRequestDlg function is used to display a generic Opus-style message dialog, which can optionally display a text field and a Boolean checkmark button.

The SHOWREQUESTDLGDATA structure has the following fields:

  • UINT cbSize
    Set this to the size of the structure before calling this function.
  • HWND hwndParent
    The parent window handle for the dialog.
  • LPCTSTR pszTitle
    Dialog box title, or NULL for a default title.
  • HICON hIcon
    A handle to an icon to display in the dialog box. You can also use one of the pre-defined icons by specifying the following values:
HICON_WARNINGA warning icon
HICON_ERRORAn error icon
HICON_INFOAn information icon

Set to NULL to have no icon displayed.

  • LPCTSTR pszMessage
    The message text to display in the dialog. Use \n (a LF character) as a line break. Long lines will be automatically wrapped to a sensible width.
  • LPCTSTR pszButtons
    The buttons to display in the dialog. You can specify one or more buttons by separating their labels with a vertical bar character. Use an ampersand to mark the hotkey for a button. For example, Ok|&Skip|&Retry|Abort. Set to NULL for a default Ok button.
  • LPTSTR pszStringBuf
    This should point to a buffer if you want the user to be able to enter a text string in the dialog. If this buffer is initialized the string field will be pre-set with this as the initial value. Set to NULL if you don't want the user to be able to enter a string.
  • int cchStringBufMax
    If pszStringBuf is non-NULL this specifies the size of the buffer in characters.
  • DWORD dwFlags
    Flags that control the dialog. Valid flags are:
SHOWREQF_NAMEFILTERFilter input string for valid filename characters
SHOWREQF_SELECTALLSelect entire string contents on initialization
SHOWREQF_PASSWORDPassword input
SHOWREQF_DEFAULTCANCELSet cancel (right-most) button as the default
  • PFNCHECKINPUT pfnCheckInputString
    Optional callback function to check the user's text input. Ignored if pszStringBuf is NULL.
  • LPARAM lParamCheckInput
    User-data for input callback function.
  • LPCTSTR pszBoolOption
    Use this to specify the label for the optional Boolean checkmark button. If set to NULL the checkmark is not displayed.
  • BOOL fBoolOption
    On input this specifies the initial state of the Boolean checkmark. On return, this will contain the updated state of the checkmark.

There are a number of pre-defined button combinations that can be specified as values for the pszButtons field. These will be automatically shown in the current language Opus is using. For example, BUTTONS_OKCANCEL is equivalent to Ok|Cancel. See the plugin support.h header file for a full list of these.