Filter window messages

Archives Forums/Win32 Discussion/Filter window messages

Picklesworth(Posted 2005) [#1]
I think I have found the source of all of my problems!

In my program's window event getting thing, I have this command:
apiGetMessage(WinProcReturn,0,0,0)
After reading over documentation, I can tell that those last two zeros are the minimum and maximum values for the event I want to get. Unfortunately, I can't figure out how exactly these are used, so maybe you know: How can I call apiGetMessage to filter out mouse events and keyboard events?
How can I still get regular window events, and at the same time be getting mouse events and keyboard events?


Sarge(Posted 2005) [#2]
Do you want something like this ?
Function WaitEvent()
Local msg:MSG = New MSG
	While apiGetMessage( msg,0,0,0 )
		apiDispatchMessage(msg)
		apiTranslateMessage(msg)
	Return msg.wparam
	Wend
FlushMem()
End Function



Picklesworth(Posted 2005) [#3]
I have tried that, but the problem is that it forces my program into an interminable loop, because Windows keeps sending it messages.
I suppose I could put the entire program into the event handler though...

Unfortunately though, after doing a test with the debugger, mouse events are sent ridiculously often, so I definietly need a way to filter them.



Edit:
And the reason why I'm posting this is because my program will not recieve the event when a button is clicked (instead, it recieves WM_LButtonUp, which is useless for that), and it sometimes won't recieve the event when the menu is used. I'm guessing the two problems are connected.
The button that's giving me troubles is inside of a group box which is inside of a panel (Static control) whcih is inside of the main window. All of those gadgets are parented to the right things. If I put that button directly inside of the main window instead of within that crazy thing I had above, I do recieve the event when it is clicked. (However, this is hardly an option)