Thread: Dialogs and Menus

  1. #1
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256

    Dialogs and Menus

    Is it possible to add a menu to a dialog? If not, is it possilbe to create a dialog without a frame, kinda like a menu, but works like a dialog, receives messages like a dialog, etc.
    Last edited by Jaken Veina; 06-27-2005 at 04:38 PM.
    Code:
    void function(void)
     {
      function();
     }

  2. #2
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    310
    Quote Originally Posted by Jaken Veina
    Is it possible to add a menu to a dialog?
    Yes! Since you are using dialog... (me thinks via resource) you can create one there... see here

  3. #3
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    I have that tutorial. It says nothing about putting a menu into a dialog.
    Code:
    void function(void)
     {
      function();
     }

  4. #4
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Yes ofcourse a dialog can have a menu... you can create it using the resource editor, or you can create it at runtime just like you would with any other window

  5. #5
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    Well, how would you create it in a .rc? Or, since I found out that you can, what style do you use to remove a dialog's title bar?
    Code:
    void function(void)
     {
      function();
     }

  6. #6
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    310
    Try LoadMenu, SetMenu APIs

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>how would you create it in a .rc?<<

    Use the MENU resource definition statement within the context of a DIALOGEX resource definition statement.

    >>what style do you use to remove a dialog's title bar<<

    Remove WS_CAPTION and WS_SYSMENU from the STYLE resource definition statement of your DIALOGEX resource definition statement. Also remove the CAPTION resource definition statement.

    Full list of resource definition statements.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  8. #8
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    Thank you. I managed to figure out the second answer, though, and it does not completely remove the title bar. It only removes the buttons from it. Perhaps it is my compiler?
    Code:
    void function(void)
     {
      function();
     }

  9. #9
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    And your compiler is?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  10. #10
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    Dev-C++.
    Code:
    void function(void)
     {
      function();
     }

  11. #11
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    That shouldn't be a problem - just re-read my previous post and follow the instructions exactly.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  12. #12
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    I'll remember that. Thanks a lot. I worked everything into a single dialog after all.
    Code:
    void function(void)
     {
      function();
     }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dialogs in dos window?
    By Blackroot in forum C++ Programming
    Replies: 5
    Last Post: 01-24-2006, 07:04 PM