Intercepting Word's message pump

D

David Thielen

Hi;

I am working on intercepting Word's message pump to determine when the user
clicks on a menu so I can enable/disable items in the drop down menu. (I'll
post the code once I get it working.)

I am intercepting the pump using NativeWindow. And I can get the OpusApp
window handle. But here is where I am hitting a problem.

The OpusApp window gets no specific messages as the menu is first clicked.
It gets a WM_PARENTNOTIFY (WM_LBUTTONDOWN) when it is clicked with the mouse
- but that message is fired a lot. And it gets a WM_ENTERIDLE if it's poped
up with ALT-T (Tools menu) but that fires after the menu is displayed.

I then looked at the menu child window. It gets a WM_CAPTURECHANGED message
when the menu is clicked on or accessed via ALT-T. So this will work. But is
this the best way to do this?

And if so, will this window always have a caption of "Menu Bar", even in non
English versions of Word? And a class of MsoCommandBar? And does this hold
back to Word 2000?

Also, I thought there was a WM_ message when a menu was about to be dropped
down. But I can't find it in the WM_ list of messages and I can't find a
window firing a message like this.

??? - thanks - dave
 
D

David Thielen

Problem - the WM_CAPTURECHANGED is fired after the window is drawn. There is
no message the menu window gets before anything is drawn.

This is not looking good - I can't find a way to always know the menu is
about to be drawn as WM_ENTERIDLE also occurs after the menu is drawn.

Any ideas?
 
P

Peter Huang [MSFT]

Hi

Word Addin customization is mainly based on the Word's Object Modal.
Using the Win32 API call to subclass Word Application and customizing the
Word application will cause unexpected behavior, because Word has its own
implementation and its imeplement is not public.

I think you may try Microsoft Consult Service to see if that helps.
http://www.microsoft.com/services/microsoftservices/default.mspx


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top