Change popup menu captions at runtime (ModifyMenu) 
Author Message
 Change popup menu captions at runtime (ModifyMenu)

There seems to be no problem in changing pulldown menu captions at
runtime, but popup menu captions refuse to, eg

AfxGetMainWnd()->GetMenu->ModifyMenu( 0, MF_POPUP | MF_STRING, ... ,
"test" );

MSDN states the 3rd parameter has to be a HMENU in this case
(GetMenu()->GetSubMenu(0)->m_hMenu) but this does not even match the
declaration of ModifyMenu() which requires an UINT and ends up in a
compile time error.

Anybody, any ideas?

Martin Koeck
---
spam prevention: please reply to forum only



Fri, 05 Oct 2001 03:00:00 GMT  
 Change popup menu captions at runtime (ModifyMenu)
Are calling DrawMenuBar after you change the text?

Keith

Quote:

>There seems to be no problem in changing pulldown menu captions at
>runtime, but popup menu captions refuse to, eg

>AfxGetMainWnd()->GetMenu->ModifyMenu( 0, MF_POPUP | MF_STRING, ... ,
>"test" );

>MSDN states the 3rd parameter has to be a HMENU in this case
>(GetMenu()->GetSubMenu(0)->m_hMenu) but this does not even match the
>declaration of ModifyMenu() which requires an UINT and ends up in a
>compile time error.

>Anybody, any ideas?

>Martin Koeck
>---
>spam prevention: please reply to forum only



Fri, 05 Oct 2001 03:00:00 GMT  
 Change popup menu captions at runtime (ModifyMenu)
Keith,

Quote:
> Are calling DrawMenuBar after you change the text?

I know I have to do that but I'm not getting that far, because I do not
know how to pass the 3rd parameter to ModifyMenu(). Docs say it needs a
HMENU but the prototype says it needs a UINT...

Any help is appreciated



Sat, 06 Oct 2001 03:00:00 GMT  
 Change popup menu captions at runtime (ModifyMenu)
Martin,

I am using it (not to change the main caption though), and am passing the
UINT of the menu item.

Keith

Quote:

>Keith,

>> Are calling DrawMenuBar after you change the text?
>I know I have to do that but I'm not getting that far, because I do not
>know how to pass the 3rd parameter to ModifyMenu(). Docs say it needs a
>HMENU but the prototype says it needs a UINT...

>Any help is appreciated



Sun, 07 Oct 2001 03:00:00 GMT  
 Change popup menu captions at runtime (ModifyMenu)
Keith,

Quote:
>I am using it (not to change the main caption though), and am passing the

 >UINT of the menu item.
this one works for me, too.
But for a popup (like the topbar) you need to pass HMENU, according to docs,
and this does not work for me.

Martin



Mon, 08 Oct 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Adding a popup- or sub-menu to a menu, runtime

2. Adding a popup- or sub-menu to a menu, runtime

3. Modifying popup menu captions

4. How to change on runtime the caption of a C++ dialog app main window

5. How to change on runtime the caption of a C++ dialog app main window

6. Changing a Dialog's CAPTION during runtime

7. Changing Caption of CPropertyPage at runtime?

8. Change caption of childwindow runtime ?

9. Changing the Caption of a Modal Dialog at Runtime

10. Changing Floating Toolbar Caption Runtime...

11. How to change the caption of a MDI frame at runtime

12. How to change caption of a menu item

 

 
Powered by phpBB® Forum Software