Help needed for Dynamic Menu Insertion using MFC/VC/SDK

Hi ,

I have a problem, and I would appreciate if you would help.

I am not able to dynamically insert my menu into any MS Office 97 products like MS Word 97, Excel 97, etc. The problem is described below :

Find all the windows at any point in time under NT environment.
Get the window handles for all windows which are used as editors (Notepad, MS Word, MS Excel, MS Powerpoint... etc).
Insert Menus dynamically into these windows.

I am able to get the handles to the windows, and i am even able to insert my menu into Notepad, and MS Word 6.0, but it fails for all MS Office 97 onwards products.

Could you please tell me where I am going wrong or is my approach to be changed??

Please tell me any other way in which I can achieve dynamic menu insertion into MS Office 97 Applications, after they have been invoked by a user?? I have an idea that MS Office 97 products use "Custom Menu Classes" but I do not have any idea what that is, and how to get a handle to these classes.

It is very important. Please let me know about anything useful.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Tommy HuiConnect With a Mentor EngineerCommented:
Sorry, but you will not be able to get a handle (HMENU) for any of the newer Office applications. The reason is if you closely at the application, the "menu" exists in a toolbar. It is not a standard menu and hence you will not be able to get an HMENU to it. A better bet would be to create an add-in that is loaded by the applications and will listen to commands. With add-ins you can modify the menus to your desire.
vimalkaulAuthor Commented:
Thanks a lot because I have been breaking my head on this issue for over a week now.

Can I ask another favour???

I haven't built any add-in earlier and I have to follow a schedule. Could you please give me an example with code?? I will be very grateful.
All Courses

From novice to tech pro — start learning today.