[windev] Windows Hooks / Menus
Tim Lesher
tlesher at gmail.com
Mon Mar 8 18:08:49 GMT 2010
On Mon, Mar 8, 2010 at 12:41, Lori Falck <LoriF at harveysoftware.com> wrote:
> Ideally, we'd like to find the target window and thus it's calling thread,
> and set a hook on that thread only. We've got a DLL that sets the hook on
> WH_MSGFILTER and have it working on a Notepad window - at least we get in=
to
> the callback function when a menu is activated in Notepad (for proof of
> concept). Now we just need to figure out the parameters and work with
> them.
> And ultimately only process the message when a certain menu item is
> clicked.
>
>
That's exactly how I'd do it.
> Will WH_MSGFILTER allow us to get the item that was clicked on, or will it
> just fire when the menu is shown?
>
Your message hook proc should get exactly the MSG structure that will be
unpacked and sent through the window proc chain, so it includes everything
you need to decipher it.
Caveat: I haven't used this feature since before Vista, so I don't know how
or if the added security features there have changed the way it works.
-- =
Tim Lesher <tlesher at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20100308/81f60bce=
/attachment.htm
More information about the Windev
mailing list