// WM_GETDLGCODE: if the control wants it for itself, don't process it
// (except for Ctrl-Tab combination which is always processed)
- LONG lDlgCode;
+ LONG lDlgCode = 0;
if ( bProcess && !bCtrlDown ) {
lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
}
if ( bProcess ) {
switch ( msg->wParam ) {
case VK_TAB:
- if ( lDlgCode & DLGC_WANTTAB )
+ if ( lDlgCode & DLGC_WANTTAB ) // this is FALSE for Ctrl-Tab
bProcess = FALSE;
else
bForward = !(::GetKeyState(VK_SHIFT) & 0x100);
{
// Generate a LEAVE event
m_mouseInWindow = FALSE;
- MSWOnMouseLeave(pt.x, pt.y, 0);
+
+ int state;
+ if (::GetKeyState(VK_SHIFT) != 0)
+ state |= MK_SHIFT;
+ if (::GetKeyState(VK_CONTROL) != 0)
+ state |= MK_CONTROL;
+
+ // Unfortunately the mouse button and keyboard state may have changed
+ // by the time the OnIdle function is called, so 'state' may be
+ // meaningless.
+
+ MSWOnMouseLeave(pt.x, pt.y, state);
}
}
UpdateWindowUI();