how to set this dialog to this

This is a discussion on how to set this dialog to this within the Windows Programming forums, part of the Platform Specific Boards category; i have a dialog that is called from a main window. but, once i call the dialog i ShowWindow(hwndParent, SW_HIDE) ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    157

    how to set this dialog to this

    i have a dialog that is called from a main window. but, once i call the dialog i ShowWindow(hwndParent, SW_HIDE) and hide the main window so that the dialog makes it look like the dialog has become the "main window" to continue from.

    but i have run into a couple of problems with this. first off, when i hide the main window, that little "menu bar title" goes away and even with the dialog box up there is no tab on the menu bar (you know, where the "Start" is found in Windows). so how do i bring that back? and also this dialog doesn't have an icon to the left of the caption. it's not crucial, but is there a way to get one there?

    here's what my dialog definition looks like so far:
    Code:
    OptDlg DIALOG 5, 5, 150, 100
    STYLE DS_MODALFRAME | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | DS_MODALFRAME
    CAPTION "Quizer Options/Settings"
    {
     DEFPUSHBUTTON "Okay", IDD_OKAY, 32, 50, 30, 14,
                   WS_CHILD | WS_VISIBLE | WS_TABSTOP
    }
    what should i do to further meet my expectations of this dialog?

    thanks!

    ps, attached is a screenshot of this dialog that i'm talking about. thanks again!
    Attached Images Attached Images  

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    First off the tab is usually for the main window and all the dialogs won't have their own tab. So, when you hide the main one the other shouldn't show. I'm not sure if you can hide the window without the tab disapearing, I've never tried it.

    Second, for the icon you need to add this line to your code:
    Code:
    SetClassLong(hwnd, GCL_HICON, (LONG) LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON)));
    hwnd - handle to your window
    hInst - instance of your program
    ID_ICON - the resource of your icon that you want to add.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    then what do you think i should do for this dialog and the bottom-tabbing?

    and thanks for the icon code!

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    what i ended up doing (for now) is this:
    Code:
    MoveWindow((HWND)GetParent(hDlg), GetSystemMetrics(SM_CXSCREEN)+1,
                            GetSystemMetrics(SM_CYSCREEN)+1, 0, 0, TRUE);
    in a nut shell, i set the main window size to 0 width and 0 height and moved it off of the screen. it is the only thing i can think of so that i can use this dialog as a seemingly "main window" and still keep the bottom tab on the start bar. if i hide the window, the tab is also hided and that's not desired.

    what do you think of my method (the above code)? i dont think it's great, but it's the only thing i can think up. it seems to me to be a sloppy way to do this, but again, i dont know of any other way.

    comments? suggestions?

    thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dialog box problem keeps haunting me
    By Bleech in forum Windows Programming
    Replies: 2
    Last Post: 08-23-2006, 02:12 AM
  2. C help for network animator
    By fastshadow in forum Tech Board
    Replies: 7
    Last Post: 03-17-2006, 03:44 AM
  3. Have a new dialog replace another one
    By axr0284 in forum Windows Programming
    Replies: 6
    Last Post: 03-10-2006, 05:23 PM
  4. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 03:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21