使用VC向导生成一个SDI程序,我想改变客户区的color为RGB(192,192,192),请问我该如何实现?

解决方案 »

  1.   

    笨的:
    得到客户区域,,rectFileRect(&brush,&rect)
      

  2.   


    DWORD SetClassLong(
      HWND hWnd,       // handle of window
      int nIndex,      // index of value to change
      LONG dwNewLong   // new value
    );
    hWnd设置成窗口的句柄
    nIndex设置成GCL_HBRBACKGROUND
    dwNewLong设置成你要的颜色
      

  3.   

    SetBkColor();
    OnEraseBkgnd(); //I like this method :)
    SetClassLong();
      

  4.   

    FillRect()需要相关的HDC,SetClassLong()需要相关的HWND。