我想创建一个窗口是某个主窗口的子窗口,我想让这个窗口不具有任何颜色,也就是说我想让这个窗口的区域颜色跟主窗口的背景是一样的。我只要得到这个窗口的句柄就行了,不要它的形状,但也不能隐藏,因为我还要在这个窗口上显示图象。

解决方案 »

  1.   

    see this
    http://www.codeproject.com/dialog/modelesschild.asp
      

  2.   

    Follow these steps: Create a new dialog resource and use the Class Wizard for making a new CDialog based class for it; let's call it CDropDialog 
    In your CFormView-derived class, add a (private) member variable of type CDropDialog* as a container for the modeless dialog class, let's call it m_pModeless. In the constructor of your view, make sure you initialize m_pModeless to NULL 
    In your appropriate message handler, let's call it OnModeless, do the following: void CInterfaceView::OnModeless() 
    {
        // Display the modal dialog box
        if (!m_pModeless)
            m_pModeless = new CDropDialog;    if (!::IsWindow(m_pDlg->GetSafeHwnd()))
            m_pModeless->Create(IDD_DIALOG1, this);    m_pModeless->ShowWindow(SW_SHOW); 
    }
    In the destructor of the parent window, proof if the dialog has been closed and release the memory: CInterfaceView::~CInterfaceView()
    {
        if (m_pModeless)
        {
            if (::IsWindow(m_pModeless->GetSafeHwnd()))
                m_pModeless->EndDialog(IDCANCEL);
            delete m_pModeless;
        }
    }
      

  3.   

    wuxuan(真心英雄) ,那个地址我打不开ninny(zstudio),我想让这个窗口是基于CWnd的,最好用CreateEx()创建的SpritToT(彩虹),是MFC的,在VC6.0下实现。