当通过setwindowlong来设置背景brush的时候,怎么样是其立刻起作用

解决方案 »

  1.   

    楼主是不是想问SetClassLong这个啊?
      

  2.   

    通过setwindowlong来设置背景brush?什么意思?
      

  3.   

    http://www.mybole.com.cn/bbs/printpage.asp?BoardID=2&ID=1501
      

  4.   

    对,应该是setclasslong,setwindowlong设置不了hbrush。
      

  5.   

    MSDN原话:
    Certain window data is cached, so changes you make using SetWindowLong will not take effect until you call the SetWindowPos function汉语意思是,只有运行 SetWindowPos 函数后,SetWindowLong才会生效
      

  6.   

    //这个例子是动态设置鼠标的,希望有所帮助
    if(m_hAniCursor == NULL)
    m_hAniCursor = LoadCursorFromFile("d:\\path\\sample.ani");
    BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
    // TODO: Add your message handler code here and/or call default
    if(m_hAniCursor!=NULL)
    SetCursor(m_hAniCursor);
    /*or
    if(m_hAniCursor!=NULL)
    SetClassLong(GetSafeHwnd(), GCL_HCURSOR, (LONG)m_hAniCursor);*/return TRUE;
    //return CDialog::OnSetCursor(pWnd, nHitTest, message);
    }
    //在需要设置鼠标显示的地方调用SetCursor()就可以了。