GetUserEvent
int GetUserEvent (int waitMode, int *panelOrMenuBarHandle, int *controlOrMenuItemID);
Purpose
Obtains the next commit event or programmer-defined event from the GetUserEvent queue. A commit event occurs when the user changes the state of a hot or validate control or selects a menu item.
Place programmer-defined events in the GetUserEvent queue by calling QueueUserEvent. Refer to QueueUserEvent for the range of valid programmer-defined event codes.
![]() |
Notes
|
Example Code
The following example code demonstrates how to use this function to respond to commit events.
.
.
.
InstallPopup (panelHandle);
while (done == FALSE)
{
/* Wait for a commit event to occur on one of the user interface controls */
GetUserEvent (1, &eventPanel, &eventCtrl);
/* Run code corresponding to what button the user clicked */
switch (eventCtrl)
{
case PANEL_OKBUTTON:
SaveFunc ();
done = TRUE;
break;
case PANEL_QUITBUTTON:
QuitFunc ();
done = TRUE;
break;
}
}
.
.
.
Parameters
Input | ||
Name | Type | Description |
waitMode | int | If you specify a nonzero value or select wait in the function panel, GetUserEvent does not return until a commit event or programmer-defined event occurs. If you specify 0 or select no wait in the function pane, GetUserEvent returns immediately, whether or not a commit event or programmer-defined event has occurred. |
Output | ||
Name | Type | Description |
panelOrMenuBarHandle | int | The handle of the panel or menu bar on which the event occurred. Returns –1 if waitMode is zero and no event has occurred. |
controlOrMenuItemID | int | Returns the ID of the control or menu item on which the commit event occurred. Returns –1 if waitMode is zero and no event has occurred. |
Return Value
Name | Type | Description | ||||||
eventStatus | int | The event, if any, that occurred.
|
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later