GetRoutedWinMsgParams
- Updated2023-02-21
- 2 minute(s) read
GetRoutedWinMsgParams
int GetRoutedWinMsgParams (int panelHandle, InterceptedWindowsMsg *messageParameters);
Purpose
Call this function to obtain the parameters specific to the most recent Windows message that was routed to a panel callback.
When the panel receives the Windows message you specify, it calls the panel callback with an event value of EVENT_WINDOWS_MSG. Call this function to receive the following data structure:
typedef struct
{
unsigned int uMsg; // Windows message code
intptr_t wParam;
intptr_t lParam;
long result;
} InterceptedWindowsMsg;
Example Code
int PanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_WINDOWS_MSG:
{
InterceptedWindowsMsg msg;
GetRoutedWinMsgParams (panel, &msg);
// Check for application activate via a Windows message
// because the top level panel does not get the CVI
// EVENT_GOT_FOCUS event if one of its child panels
// has the focus when it is activated
if ((msg.uMsg == WM_ACTIVATEAPP) && msg.wParam)
{
// application was activated, put your code here
}
}
break;
}
return 0;
}
For backwards compatibility in 32-bit programs, LabWindows/CVI also passes a pointer to the message parameters as the eventData1 parameter of the panel callback function. In 64-bit programs, however, eventData1 is 0, and you must use this function to obtain the message parameters.
(Linux) This function is not supported.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | The specifier for a particular top–level panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function. |
Output | ||
Name | Type | Description |
messageParameters | InterceptedWindowsMsg | Pass the address of an InterceptedWindowsMsg structure: typedef struct { |
Return Value
Name | Type | Description |
status | int | The status code that the function returns. 0 indicates success. A negative value indicates an error. This function may return a Programmer's Toolbox or UI Library error code. Call GetGeneralErrorString to obtain a text description of the error. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 2009 and later