CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Xeon's Avatar
    Xeon is offline Elite Member Power Poster
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    4,195

    Talking Special child dialogs with panes in taskbar?

    Now! As you have probably seen, some child modeless dialogs can actually have a pane in the taskbar as well.

    For example, in Visual Basic, u create 2 forms. One is the main, and the other is a secondary.

    U add a button to the main form(Form1), and when clicked, it shows Form2.
    So, the code is something like :
    Code:
    Form2.Show
    Now, when u run the program and click this button to show the 2nd dialog, you'll see that in the taskbar, a pane for this 2nd dialog actually shows up!

    I tried achieving the same in Visual C++ by adding all sortta styles, but in vain.

    To show what I'm talking about, I've attached a very darn focused VB sample to show the point.
    Click the button, and a dialog shows up.(the only code is : Form2.Show......that's all)

    Notice that there's 2 panes in the taskbar : one for the main dialog, one for the secondary dialog.
    In Visual C++, when u try to show this same kinda dialogs, there's only 1 pane on the taskbar, and that's the pane for the main dialog, no panes for secondary dialogs.

    Is it possible to achieve this in Visual C++? I've used Spy++ to help me view the style differences too, but in vain.

    Please and thanks!
    Attached Files Attached Files
    "Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria

    "I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria

  2. #2
    Xeon's Avatar
    Xeon is offline Elite Member Power Poster
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    4,195

    Talking

    Now, I managed to solve this behemoth.
    The solution is to make the modeless dialog a child of the Desktop window instead of the program.

    So, a typical code snippet looks like this :
    Code:
    void CMyProgramDlg::OnShow() 
    {
        CMyDialog* pDlg = new CMyDialog;
        pDlg->Create(IDD_DIALOG1,GetDesktopWindow());
        pDlg->ShowWindow(SW_SHOW);
    }
    "Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria

    "I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria

  3. #3
    Join Date
    Sep 2002
    Posts
    77
    The dialog will also show up in the taskbar when you apply the WS_EX_APPWINDOW style:

    Code:
    void CMyProgramDlg::OnShow() 
    {
        CMyDialog* pDlg = new CMyDialog;
        pDlg->Create(IDD_DIALOG1, this);
        pDlg->ModifyStyleEx(0, WS_EX_APPWINDOW);
        pDlg->ShowWindow(SW_SHOW);
    }

  4. #4
    Xeon's Avatar
    Xeon is offline Elite Member Power Poster
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    4,195

    Talking

    Whoa! That's something new I learnt, Alpha! Thanks a lot! U're da' bomb!!!!!!!

    No no....Bush......relax...please. When I say "u're da' bomb", I mean that a particular person is great and such. Nothing whatsoever to do with terrorism. Please.
    "Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria

    "I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria

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

Featured