我在一个Dialog里面加了虚拟函数BOOL CTestDlg::PreCreateWindow(CREATESTRUCT& cs) ,但是我在这个函数里面设置了BreakPoint。结果却发现这个虚拟函数根本就没有被执行。
从MSN里面可以看出它只适用于framework。The following come from MSN.
ResCalled by the framework before the creation of the Windows window attached to this CWnd object.
现在提问,我怎样才能改变Dialog的窗口类。谢谢

解决方案 »

  1.   

    怎样才能改变Dialog的窗口类?
    改成什么样的类型?问题得说清楚。
      

  2.   

    估计只好再OnInitDialog中通过cwnd的函数来改了。比如想将dialog设置为总在嘴上就在OnInitDialog中加入SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);修改其它的属性,可以通过相应的函数,或者再资源视图中修改dialog的属性。
      

  3.   

    我要设定窗口得光标,而不是设定系统光标。从MSN中可以看出如果要设定窗口光标,你必须将窗口类光标设定为NULL。如下所示
    ResIf your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
    不然得话一移动光标就会恢复原样。所以我必须修改窗口类,让类光标为NULL
      

  4.   

    HCURSOR hCursor = LoadCursor(...);
    SetClassLong( m_hWnd, GCL_HCURSOR, hCursor );
    签名:jmcooler
      

  5.   

    HCURSOR hCursor = LoadCursor(...);
    SetClassLong( m_hWnd, GCL_HCURSOR, hCursor );
    签名:jmcooler