Reputation: 2733
I am a beginner on win32-platform, and there is some question about
BOOL GetMessage(LPMSG lpMsg,HWND hWnd,UINT wMsgFilterMin,UINT wMsgFilterMax) ;
I don't know what does it wMsgFilterMin
and wMsgFilterMax
means ? Thank you .....
Upvotes: 0
Views: 1363
Reputation: 942255
First off, keep in mind that GetMessage() only returns posted messages. There are not many of them, mouse and keyboard messages, WM_INPUT, WM_TIMER, WM_PAINT, WM_QUIT. Plus any that your own code delivers by calling PostMessage(), WM_USER+ messages.
Using the filter is pretty unusual, you normally pass 0 and 0 so nothing gets filtered. You might consider passing WM_PAINT to flush all pending paint requests. I can think of no good reason to ever filter mouse or keyboard messages. But a definite use-case is your own posted messages. Commonly used to deliver notifications from a worker thread to the UI thread for example. You may want to filter them so they get processed before any of the regular messages.
Just put this in your back pocket. You may have a use for it some day.
Upvotes: 2
Reputation: 20406
range from wMsgFilterMin to wMsgFilterMax to filter.
message number: WM_XX, e.g. WM_CREATE (0x0001), WN_PAINT (0x000f), range from 0x0001 to 0x000f messages will be returned.
If you need only one kind of message, then make wMsgFilterMin equals wMsgFilterMax.
If no filtering (return all message types), then put both wMsgFilterMin and wMsgFilterMax 0.
Upvotes: 0