次の方法で共有


CWnd::IsWindowEnabled

更新 : 2007 年 11 月

CWnd がマウスやキーボードからの入力を許可しているかどうかを指定します。

BOOL IsWindowEnabled( ) const;

戻り値

CWnd が許可している場合は 0 以外を返します。それ以外の場合は 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

その他の技術情報

CWnd のメンバ