GenericMessagePopup
int GenericMessagePopup (char title[], char message[], char buttonLabel1[], char buttonLabel2[], char buttonLabel3[], char responseBuffer[], size_t maxResponseLength, int buttonAlignment, int activeControl, int enterButton, int escapeButton);
Purpose
Displays a dialog box with a defined message and optionally accepts a response string.
You can use up to three buttons and specify their labels. GenericMessagePopup returns a value indicating which button the user pressed.
Parameters
Input | ||
Name | Type | Description |
title | char [] | Title of the dialog box. |
message | char [] | Message to display in the dialog box. To display a multi-line message, embed newline characters (\n) in the message string. |
buttonLabel1 | char [] | Label on button 1. |
buttonLabel2 | char [] | Label on button 2. To hide buttons 2 and 3, pass 0 to buttonLabel2. |
buttonLabel3 | char [] | Label on button 3. To hide button 3, pass 0 to buttonLabel3. |
maxResponseLength | size_t | Maximum number of bytes the user is allowed to enter. The responseBuffer must be large enough to contain all of the user input plus one ASCII NUL byte. |
buttonAlignment | int | Determines the location of the buttons. Specify a nonzero value or select side in the function panel to align the buttons along the right-hand side of the dialog box. Specify 0 or select bottom in the function panel to align the buttons along the bottom of the dialog box. |
activeControl | int | Selects one of the buttons or the input string as the active control. The active control is the control that accepts keystrokes. The following values apply to activeControl: VAL_GENERIC_POPUP_BTN1 VAL_GENERIC_POPUP_BTN2 VAL_GENERIC_POPUP_BTN3 VAL_GENERIC_POPUP_INPUT_STRING |
enterButton | int | Selects which button has <Enter> as its shortcut key. Pass VAL_GENERIC_POPUP_NO_CTRL if no button uses <Enter> as its shortcut key. |
escapeButton | int | Selects which button has <Esc> as its shortcut key. Pass VAL_GENERIC_POPUP_NO_CTRL if no button uses <Esc> as its shortcut key. |
Output | ||
Name | Type | Description |
responseBuffer | char [] | Buffer in which to store the user response. The buffer must be large enough to hold maxResponseLength bytes plus one ASCII NUL byte. To hide the input string, pass 0. |
Return Value
Name | Type | Description | ||||||
selectedButton | int | Returns an indication of which button the user clicked.
Negative values indicate that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later