1

I have the main-frame, when someone is pressing a button I open a CDialogEX.

After I open it, it get's an empty task-bar tab, with no title or icon...

i want it to open as a child window of the main-frame and without task-bar tab.

i have tried using styles and stuff, but nothing works.

any ideas?

eladyanai
  • 1,063
  • 2
  • 15
  • 34

2 Answers2

3

I'm guessing you are passing NULL as the parent window. Pass the window handle of your main application's window. When you pass NULL the created window is an unowned top-level window and they get taskbar buttons.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • you'r idea was good, but the thing that solved my problem was that somone put in the StyleEX() function: WS_EX_APPWINDOW Forces a top-level window onto the taskbar when the window is visible. FLAG... i have just removed it and it is working... as for the parent, i did as you said. – eladyanai Sep 12 '11 at 14:01
0

Some bibliography for you:

Now the real work. Declare a

CWnd m_wndHidden;

in your class.

Then implement the following method

BOOL CMyMDIChildFrame::PreCreateWindow(CREATESTRUCT& cs) 
{ 
     if (!__super::PreCreateWindow(cs))
         return FALSE;

     // Create hidden window
     if (!::IsWindow(m_wndHidden.m_hWnd))
     {
        pstrOwnerClass = AfxRegisterWndClass(0);
        if (!m_wndHidden.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP,
                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                NULL, 0))
            return FALSE;
     }

    cs.hwndParent = m_wndHidden.m_hWnd;
    return TRUE;
}

The first and last link I provided are based on this approach.

sergiol
  • 4,122
  • 4
  • 47
  • 81