Results 1 to 3 of 3

Thread: OD Menus

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Unhappy OD Menus

    If I cannot set an ID for a top menu, how am I supposed to be able to manipulate the way it is created just like the other sub-menus?
    Let's say in this code
    Code:
    				switch(di->itemID)
    				{
    				case ID_COLOR1:
    					SetTextColor(di->hDC,color);
    					break;
    				case ID_COLOR2:
    					SetTextColor(di->hDC,color);
    					break;
    				case ID_COLOR3:
    					SetTextColor(di->hDC,color);
    					break;
    				case hMenu:
    					color = RGB(00,00,255);
    					SetTextColor(di->hDC,color);
    					break;
    				}
    How would I be able to add a case hMenu, without getting an error? I even saw VB programs change the text xcolor of their top-menus. What should I do. I tried a whole bunch of stuff(such as typecasting), but with no result Thanks for helping
    Amon Ra
    Amon Ra
    The Power of Learning.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try using the ID of the menu itself (defined when you made the resource file).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Unhappy Well...

    I prefered to use the API to create my menus. here is the code
    Code:
    			hMenu = CreateMenu();
    			hPopupMenu1 = CreatePopupMenu();
    
    			AppendMenu(hPopupMenu1, MF_STRING | MF_OWNERDRAW ,ID_FIRST, "");
    			AppendMenu(hPopupMenu1, MF_STRING | MF_OWNERDRAW,ID_SECOND, "");
    
    			AppendMenu(hPopupMenu1, MF_STRING | MF_OWNERDRAW,ID_COLOR1, "");
    			AppendMenu(hPopupMenu1, MF_STRING | MF_OWNERDRAW,ID_COLOR2, "");
    			AppendMenu(hPopupMenu1, MF_STRING | MF_OWNERDRAW,ID_COLOR3, "");
    			AppendMenu(hMenu,MF_POPUP ,(unsigned int)hPopupMenu1,"Voila");
    
    			SetMenu(hwnd, hMenu);
    			DrawMenuBar(hwnd);
    			UpdateWindow(hwnd);
    You see for the last one, there is no ID_****. I tried to change the last line like this:

    Code:
    AppendMenu(hMenu,MF_POPUP | MF_OWNERDRAW ,(unsigned int)hPopupMenu1,"Voila");
    Now, I could actually control the top level menu just like the other ones by putting an if() in my message handling. The problem is that now, the change applied to all the sub-menus as well.
    Amon Ra
    Amon Ra
    The Power of Learning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width