🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #39

Problem altering menu text

#39
From: Peter Klug
Date: Wed, 22 Jul 1992 20:53
24 lines
1523 bytes
I have an application in which I'd like to toggle the text for an item
in the menu bar.  It isn't a popup menu, simply a menu item.  Anyway,
from Volume 1 of the SDK Reference I've wound up with the following:

ModifyMenu(hmenu, MF_STRING, MF_BYCOMMAND, menuId, lpNewMenuStr)

I've read over the API for ModifyMenu several times and this seems
correct.  When I use it, it returns nil and there's no change to the
menu bar (I do call DrawMenuBar afterwards).  I've also tried it for a
menu item inside a popup menu with the same result.

If I call GetMenuString passing in the "menuId" I used in ModifyMenu,
it returns the text which is shown in the menu at that point (I tried
several IDs inside a popup menu and on the menu bar).  So apparently
I'm using the correct menuId.  Is there something wrong with my
syntax?  Is there some way I can find out why ModifyMenu is returning
nil?  Thanks.


--
*        Peter Klug         *  Peter_Klug@Software.Mitel.COM
*     Mitel Corporation     *  
*  Kanata, Ontario, Canada  *  Nostalgia ain't what it used to be.
Technical Details
Message-ID: <KLUG.92Jul22165302@klug.Software.Mitel.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!cunews!revcan!software.mitel.com!klug!klug

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!cunews!revcan!software.mitel.com!klug!klug
From: klug@Software.Mitel.COM (Peter Klug)
Newsgroups: comp.windows.ms.programmer
Subject: Problem altering menu text
Message-ID: <KLUG.92Jul22165302@klug.Software.Mitel.COM>
Date: 22 Jul 92 20:53:02 GMT
Sender: klug@Software.Mitel.COM
Distribution: na
Organization: Mitel Corporation; Kanata, Ontario, Canada
Lines: 24