|
-
Feb 5th, 2003, 07:48 AM
#1
Menus and visibility...
How is it that menus are made visible/invisible in C++? Do you just use RemoveMenu/InsertMenu, and keep track of the menu's position when its removed, or is there an easier way?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 5th, 2003, 09:45 AM
#2
Frenzied Member
I remember from a long time ago when I wrote my own dynamic menu in VB using the API that it had some flags like visible etc.
But I'm not really sure
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Feb 5th, 2003, 09:50 AM
#3
Thanks, I'm using this for VB, as a matter of fact. I'll take another look through the docs then.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 5th, 2003, 10:07 AM
#4
Nope, it would appear not.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 6th, 2003, 07:42 AM
#5
Okay, I've got jim mcnamara over at galahtech, and he said that I can use SetWindowLong to add/remove the WS_VISIBLE property once I have the hWnd of the menu. So, anyone know how to get that?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 7th, 2003, 05:36 PM
#6
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 9th, 2003, 03:49 PM
#7
One last bump...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 9th, 2003, 07:44 PM
#8
Frenzied Member
Hi, I'm in a hurry now, so I can't go into detail, but the use of SetWindowLong is relativly simple.
You should get the style of the menu first (with GetWindowLong), then modify the result of GetWindowLong, and set the modified style with SetWindowLong
It has to be something like this:
Code:
DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
dwStyle = dwStyle | WS_VISIBLE; //Not sure if it should be | or & , I'm too tired :) but I think this is the right way...
SetWindowLong(hWnd, GWL_STYLE , dwStyle);
Something like that... If you need more help I can probably help you tomorrow
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Feb 9th, 2003, 08:13 PM
#9
Yeah, it wasn't the actual changing of the style that was bugging me, it was how to get the hWnd of a menu. Everything else I have a pretty good grip on.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 10th, 2003, 04:16 PM
#10
Frenzied Member
I've been looking for you but I couldn't find any info on how to hide a menu-item (only with MFC), maybe just try passing the HMENU handle of the menu-item (Use GetMenu and then GetSubMenu to get it), but I think it won't work.. If I have time I'll try to find out for ya
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Feb 10th, 2003, 04:24 PM
#11
I gave the HMENU handle a shot, just out of desperation, and it had no effect.
It would be great if you could find something. I've been sifting through MSDN and google and have found nothing. I don't mind just using RemoveMenu to "hide" it and just keep track of what position the menu had, but if there is a better way, I'd rather go with that.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 10th, 2003, 04:46 PM
#12
Frenzied Member
Yeah I've been looking for an hour or so... I still think there must be some way though... well removing and readding is possible of course, maybe that's how the VB & MFC function do it?
I'll keep you updated if I find something, made me curious
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|