Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!usc!brutus.cs.uiuc.edu!psuvax1!rutgers!cscnj!paul From: paul@cscnj.csc.COM (Paul Moody) Newsgroups: comp.windows.ms Subject: Re: changing menu bar items Summary: SetMenu,ChangeMenu etc Message-ID: <662@cscnj.csc.COM> Date: 2 Feb 90 22:34:23 GMT References: <34071@ucbvax.BERKELEY.EDU> Organization: Computer Sciences Corp., Piscataway NJ Lines: 29 In article <34071@ucbvax.BERKELEY.EDU>, kipnis@janus.Berkeley.EDU (Gary Kipnis) writes: > > Hi, I am trying to change one of the menu items in the main menu bar. > SDK documentation says that only popup menu items can be changed using > ChangeMenuItem(), so I tried using SetClassLong() and then DrawMenuBar() > but that locked the computer up. > I also tried just loading the second version of the menu, but I didn't know > what to do with the menu handle. > > Does anyone have any suggestions? > You can change a main menu item, but it must be done MF_BYPOSITION. Position includes all main menu items preceeding what you want to change. It may be easier to create a completly new menu on the fly and copy the old to the new. Replace what you want as you go. Once complete, just swap menus. It is MUCH easier to swap menus. Just call SetMenu(hWnd, hMenu); hMenu MUST have been returned from CreateMenu, LoadMenu or LoadMenuIndirect. If you only have two menus, load both and switch between them. -- Paul Moody UUCP: rutgers!cscnj!paul Computer Sciences Corporation # the opinions expressed are entirely imaginary #