🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #13924

Re: changing menu bar items

#13924
From: Paul Moody
Date: Fri, 02 Feb 1990 22:34
29 lines
1610 bytes
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			#
Technical Details
Message-ID: <662@cscnj.csc.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!usc!brutus.cs.uiuc.edu!psuvax1!rutgers!cscnj!paul
References: <34071@ucbvax.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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