2011年9月2日 星期五

transparent Dialog

Override OnCtlColor


HBRUSH CDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

if(CTLCOLOR_DLG == nCtlColor)
      {
        pDC->SetBkMode(TRANSPARENT);
        return (HBRUSH)GetStockObject(NULL_BRUSH);
      }
return hbr;
}

沒有留言:

張貼留言