LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The format of the 2nd parameter about the RegisterWinMsgCallback function

Hello,

 

I'd like to know if the function can register more than 2 messages? As the function spec, if its 2nd parameter is zero, then the function returns a unique meaaage number. So if want to receive more than 2 Windows messages, can I make the 2nd parameter as such a format: "WM_QUIT, WM_DESTROY" ? thanks.

 

 

David

0 Kudos
Message 1 of 2
(3,019 Views)

David,

 

If you want to catch windows messages, you should use InstallWinMsgCallback instead of RegisterWinMsgCallback. RegisterWinMsgCallback is instead used for user defined messages.

 

You can catch two windows messages with a single callback by calling the InstallWinMsgCallback twice: once for each message. For example,

 

	status = InstallWinMsgCallback (panelHandle, WM_LBUTTONDOWN, MyCallback, VAL_MODE_INTERCEPT, NULL, &hwnd);
	status = InstallWinMsgCallback (panelHandle, WM_LBUTTONUP, MyCallback, VAL_MODE_INTERCEPT, NULL, &hwnd);

 

National Instruments
0 Kudos
Message 2 of 2
(3,002 Views)