ArcShowDialogProcW function

Top  Previous  Next

Plugin uses the function for showing a simple message (like About popup), as well as for a dialog window.

Using the function allows decrease size of plugin code.

Plugin must remember the function pointer in ArcInitPluginW.

Syntax C++

typedef int (__stdcall *ArcShowDialogProcW)(

                _In_ LONG_PTR Session,

                _In_ wchar_t *WinCaption,

                _In_ wchar_t *FormattedText,

                _In_ wchar_t *ControlsDesc,

                _Out_opt_ wchar_t *ResultsBuffer,

                _Inout_ int *pResultsBufferLen,

                _In_ int ImageIndex

);

 

Parameters

Session [in]

Type: LONG_PTR

Session identifier.

WinCaption [in]

Type: wchar_t*

0-terminated string, window header.

FormattedText [in]

Type: wchar_t*

0-terminated string, message text in the window. The message can be formatted.

ControlsDesc [in]

Type: wchar_t*

0-terminated string, describing dialog window elements. Empty string means no dialog elements, otherwise the string has a special format.

ResultsBuffer [out, optional]

Type: wchar_t*

Pointer on a Unicode buffer (may be NULL, if values entered by user are missing or not required).

Strings are separated by 0-character. Each string is an input from the next element. So the number of strings in the buffer is equal to the number of elements CheckBox, RadioButton, ComboBox and TextBox.

For CheckBox and RadioButton it's a single character: '1' = checked , '0' = unchecked.

For ComboBox without editing it's the index of the selected item, or -1 if nothing is selected.

For ComboBox with editing and TextBox it's the entered string.

This string doesn't contain results of selection from CommandLink and Button. Their results go into results of the function itself ArcShowDialogProcW. Label and Space have no results.

pResultsBufferLen [in, out]

Type: int*

On input it's a maximum length of the buffer ResultsBuffer in unicode-characters, on output it's the size of the result buffer, including the last 0-character.

If the output value is bigger than the buffer size, the output result gets truncated. In such case 0-character may be missing in the buffer.

ImageIndex [in]

Type: int

Image in the message window:

Code

Comments

-1

Don't show

1

Information

2

Question

3

Exclamation, warning

4

Error

5

All is normal

Return value

Type: int

If the window contains controls CommandLink, the order number of one of these controls is returned (starting with 0).

If user clicked one of these buttons, the index of the button is returned with negative sign (buttons are counted left to right).

If user pressed Esc key, or clicked window closing button, -1000 is returned.