Another PreMessageFilter problem!

  • Thread starter Thread starter tclancey
  • Start date Start date
T

tclancey

Hi all.

I've managed to get somewhere with this, in fact just about got it sorted
except that not all mouse events are being logged.

So far I'm checking for
256, 257, 513, 514, 515, 516, 517, 518
Key down, Key up, Left and Right Click and double clicks. For the most part
this is fine but this is not catching clicks that are performed on menus or
tool bars. They must have different codes.

Has anyone got any ideas?

Cheers,
Tull.
 
Hi all.

I've managed to get somewhere with this, in fact just about got it sorted
except that not all mouse events are being logged.

So far I'm checking for
256, 257, 513, 514, 515, 516, 517, 518
Key down, Key up, Left and Right Click and double clicks. For the most part
this is fine but this is not catching clicks that are performed on menus or
tool bars. They must have different codes.

Has anyone got any ideas?

Cheers,
Tull.

Okay, here are some things to consider.

First, IMessageFilter is not reliable for intercepting all messages.
It will only see posted messages that appear in the message queue. It
does not included messages sent through SendMessage.

Second, overriding your forms WndProc is a little more reliable since
all messages targeting that window pass through that method. One
problem is that some controls create top level windows. In other
words, messages may be dispatched to a specific control's WndProc
method without being routed through the form's WndProc method.

Third, a windows message hook is the only way you can intercept *all*
messages on the thread. You see more information here.

http://support.microsoft.com/kb/318804/en-us
 
Back
Top