diff options
author | George Hazan <ghazan@miranda.im> | 2017-10-25 19:46:52 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-10-25 19:46:52 +0300 |
commit | 7f6f2d5cc5fcead74127d77edcaf678d5a38522a (patch) | |
tree | c495c51c61aafc4a5480ed6cb08472ba55fb8dcf /src/mir_core | |
parent | 083bf4917323edb4b73489d8261393a99f3edea1 (diff) |
we don't send messages to disabled buttons
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/CCtrlButton.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mir_core/src/CCtrlButton.cpp b/src/mir_core/src/CCtrlButton.cpp index 0ed43e8466..94f07e77f7 100644 --- a/src/mir_core/src/CCtrlButton.cpp +++ b/src/mir_core/src/CCtrlButton.cpp @@ -38,7 +38,8 @@ BOOL CCtrlButton::OnCommand(HWND, WORD, WORD idCode) void CCtrlButton::Click() { - ::SendMessage(m_parentWnd->GetHwnd(), WM_COMMAND, MAKELONG(m_idCtrl, BN_CLICKED), 0); + if (Enabled()) + ::SendMessage(m_parentWnd->GetHwnd(), WM_COMMAND, MAKELONG(m_idCtrl, BN_CLICKED), 0); } bool CCtrlButton::IsPushed() const @@ -48,5 +49,6 @@ bool CCtrlButton::IsPushed() const void CCtrlButton::Push(bool bPushed) { - ::SendMessage(m_hwnd, BM_SETCHECK, (bPushed) ? BST_CHECKED : BST_UNCHECKED, 0); + if (Enabled()) + ::SendMessage(m_hwnd, BM_SETCHECK, (bPushed) ? BST_CHECKED : BST_UNCHECKED, 0); } |