Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Word's Menu Bar

Status
Not open for further replies.

StewartJ

Programmer
Apr 3, 2002
74
GB
I have a document management application in VB6 running on NT4 SP6. I embed an instance of Word in my VB form using the SetParent API and disable its system menu so that I have full control of size, position, etc. I also want to get at its user menu so as to control what the user can do depending on her/his security settings. In Word, the menu is on a floating bar that is a child window. While I can see the window using EnumChildWindows API, I cannot detect the menu handle with GetMenuBarInfo. My callback function from EnumChildWindows includes the line :

l_lReturnValue = GetMenuBarInfo(ByVal hWndWindow, ByVal OBJID_MENU, ByVal 0, l_uMenuBarInfo)

but l_uMenuBarInfo always comes back empty.

OBJID_MENU is a constant &HFFFFFFFD (decimal -3).

Any suggestions would be appreciated.

(Incidentally, I also want to do this with Excel and possibly other apps so I am looking for a generic solution).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top