Thread: Adding a Menu to a Dialogbox?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    9

    Adding a Menu to a Dialogbox?

    Hello,

    I was wondering if it's possible to add a menu to my Dialogbox as I use it as the main window for my entire program.

    My RC file looks like this
    Code:
    IDD_MAIN_DLG DIALOGEX 200, 100, 329, 200
    STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
        WS_SYSMENU
    CAPTION "Removed"
    FONT 8, "MS Shell Dlg" // , 400, 0, 0x1
    BEGIN
        LTEXT           "Server Address:",IDC_STATIC,68,14,72,8
        EDITTEXT        IDC_SERVER_ADDRESS,125,10,100,12,ES_CENTER | ES_AUTOHSCROLL
        LTEXT           "From:",IDC_STATIC,18,44,72,8
        EDITTEXT        IDC_FROM,40,40,100,12,ES_CENTER | ES_AUTOHSCROLL
        LTEXT           "To:",IDC_STATIC,185,44,72,8
        EDITTEXT        IDC_TO,200,40,100,12,ES_CENTER | ES_AUTOHSCROLL
        LTEXT           "Subject:",IDC_STATIC,18,64,72,8
        EDITTEXT        IDC_FROM,45,60,250,12,ES_RIGHT | ES_AUTOHSCROLL
    The rest is not implemented yet but it is working thus far. It is invoked through this command in the main program.

    Code:
            DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN_DLG),
                      hWnd, reinterpret_cast<DLGPROC>(DlgProc));
    I'm not sure where I would specifiy a menu, I know a couple ways of creating them, but you need to load them using loadMenu and createwindowex which I don't use. If it's possible to add a menu to the dialogbox, I'd really appreciate knowing how.
    Last edited by TCM; 08-24-2004 at 09:45 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 03:41 AM