다음을 통해 공유


CWnd::IsWindowEnabled

지정 여부 CWnd 마우스 및 키보드 입력의 경우 가능 합니다.

BOOL IsWindowEnabled( ) const;

반환 값

0이 아닌 경우 CWnd 사용할 수 있습니다. 그렇지 않으면 0입니다.

예제

//change the background color of an edit control on the dialog
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
   HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

   if (pWnd->GetDlgCtrlID() == IDC_MYEDIT)
   {
      if (pWnd->IsWindowEnabled())
      {
         // Red brush for the background...
         pDC->SetBkColor(RGB(255, 0, 0));
         // m_pRedBrush is the CBrush object initialized with a red brush  
         // using CreateSolidBrush 
         return(HBRUSH)m_RedBrush.GetSafeHandle();
      }
      else
      {
         // Blue brush for the background...
         pDC->SetBkColor(RGB(0, 0, 255));
         // m_pBlueBrush is the CBrush object initialized with a blue  
         // brush using CreateSolidBrush 
         return (HBRUSH)m_BlueBrush.GetSafeHandle();
      }
   }

   return hbr;
}

요구 사항

헤더: afxwin.h

참고 항목

참조

CWnd 클래스

계층 구조 차트

IsWindowEnabled