[windev] Windows Hooks / Menus

Lori Falck LoriF at HarveySoftware.com
Mon Mar 8 17:41:22 GMT 2010


Happy Monday everyone,

 

I have a question - and yes I know this is unorthodox.  There are no bad
intentions - I promise!  It is to add functionality to a third party app,
for in-house use only.

 

Is it possible to capture/process menu events in another application?  The
goal is to add specialized menu items to the third party app, and then
handle the events if the user clicks on one of those added selections.  

 

We're using C++, Visual Studio 2008.  I'm also trying to work it in VS6.  

 

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 into
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.

 

Questions - 

Does anyone have any experience with this?  Is it doable?

Is there another way - using ProcessMessage, for example?

Will WH_MSGFILTER allow us to get the item that was clicked on, or will it
just fire when the menu is shown?

 

Any insight is greatly appreciated.

 

Thanks!

Lori

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20100308/c674ee1e/attachment.htm


More information about the Windev mailing list