Имеется немодальный диалог WTL. В нем композитный контрол. Для обеспечения "диалоговости":
BOOL CMainDlg::PreTranslateMessage(MSG* pMsg)
{
if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
(pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
return FALSE;
HWND hWndCtl = ::GetFocus();
if(IsChild(hWndCtl))
{
// find a direct child of the dialog from the window that has focus
while(::GetParent(hWndCtl) != m_hWnd)
hWndCtl = ::GetParent(hWndCtl);
// give control a chance to translate this message
if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0)
return TRUE;
}
return IsDialogMessage(pMsg);
}
Нажимаю TAB и когда дело доходит до функции АПИ GetNextDlgTabItem в методе:
CComCompositeControl<>::PreTranslateAccelerator(LPMSG pMsg, HRESULT& hRet)
{
...
case VK_TAB:
// prevent tab from looping inside of our dialog
if((dwDlgCode & DLGC_WANTTAB) == 0)
{
HWND hWndFirstOrLast = ::GetWindow(m_hWnd, GW_CHILD);
if (::GetKeyState(VK_SHIFT) >= 0) // not pressed
hWndFirstOrLast = GetNextDlgTabItem(hWndFirstOrLast, TRUE);
if (hWndFirstOrLast == hWndCtl)
return FALSE;
}
break;
...
}
Win98 вешается.
Кто-нибудь знает почему и как с этим бороться?