Pelles C forum

C language => Beginner questions => Topic started by: Turbinaz on December 06, 2008, 05:05:43 PM

Title: win32 programm
Post by: Turbinaz on December 06, 2008, 05:05:43 PM
How to call another menu?..
Example i have a main menu..with some options ...then

i need something like this

case 6002:
(the function to call the other menu)


plz..i realy need this
Title: Re: win32 programm
Post by: TimoVJL on December 08, 2008, 07:56:34 AM
Look at TrackPopupMenu() function.
Title: Re: win32 programm
Post by: Turbinaz on December 08, 2008, 11:34:34 PM
i made this but still dont work      

case 6002:
TrackPopupMenu(IDR_MNU_SLB);
break;  



gettin this errors
C:\Documents and Settings\Turbinazz\Os meus documentos\Pelles C Projects\Futebol\main.c(372): error #2140: Type error in argument 1 to 'function'; found 'int', expected 'HMENU'.
C:\Documents and Settings\Turbinazz\Os meus documentos\Pelles C Projects\Futebol\main.c(372): error #2070: Insufficient number of arguments to 'function'.
Title: Re: win32 programm
Post by: mbucklaew on December 09, 2008, 02:17:51 AM
I'm not sure if this is what you need but take a look at this zip file.  In particular you'll want to look at the menu resource (IDR_MNU_MAIN) in the main.rc file and then the Main_OnCommand function in main.c

Hope it helps...

Mike
Title: Re: win32 programm
Post by: Turbinaz on December 09, 2008, 02:29:45 PM
case IDM_CHOICE3SUB3:
            MessageBox(NULL,"Choice 3 Subchoice 3","Menu Choice Selected",MB_OK);
         break;
when u do this..isnt it possible to open another menu? because it appears only the meessage box with that text..i need is to open another menu with  other choices related to that menu...like this....game->action.when u do this should appear another menu with the list of the games like: A->......;B->........
Title: Re: win32 programm
Post by: mbucklaew on December 10, 2008, 02:34:49 AM
Try this one.  Click on the "Games" menu choice and see how that works.  That is what I orginally thought you needed.  Then click on "More Games" to see how the Popup menu works.  In the source you'll see the functions CreatePopupMenu, AppendMenu and TrackPopupMenu used.  You will probably want to use some logic to position the popup rather than the hard-coded coordinates I used for the example.

**I'm just getting back into c and Windows programming after a long time.  I'm probably making mistakes but I hope this gets you closer to what you want.**

Mike
Title: Re: win32 programm
Post by: Turbinaz on December 10, 2008, 09:50:28 AM
Can anyone help me????

I need to dynamic change the text in one label that I have on a frame, whit the selection on a menu from a frame.
 
Title: Re: win32 programm
Post by: Turbinaz on December 10, 2008, 09:55:17 AM
soo....there is no code possible to open another menu? with the game characteristics?...like a submenu...
Title: Re: win32 programm
Post by: Turbinaz on December 10, 2008, 02:00:31 PM
mbucklaew can you send me your email plz...if you do i can send you my program...cause it´s 12mb (already compressed)
Title: I orginally though
Post by: ashiq on January 21, 2009, 10:47:17 AM
That is what I orginally thought you needed.  Then click on "More Games" to see how the Popup menu works.  In the source you'll see the functions CreatePopupMenu, AppendMenu and TrackPopupMenu used.