WS_TABSTOP in WS_CHILD Dialogs

I work with simple dialogs. A dialog box is created from a resource file. When creating the WS_CHILD dialog box, everything works fine. I can easily switch between elements (edit windows and buttons) using the VK_TAB key. But when I try to change the dialog box type to WS_POPUP, switching between the elements becomes impossible. Focus is stuck in the first element, and when I press the VK_TAB key, I get a system beep (for example, "ding"). Any suggestions?

Compiler: gcc 4.6.x

Resource example:

DIALOG_CLIENT_SETTINGS DIALOG 0, 0, 156, 132
STYLE WS_CHILD | WS_VISIBLE | DS_CONTROL // Tab key stucks when change to WS_POPUP
CAPTION "Settings"
FONT 8, "Ms Shell Dlg"
LANGUAGE LANG_NEUTRAL, 0
{
    CONTROL "Account Settings", IDC_GROUPBOX_1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 8, 4, 140, 50
    CONTROL "Login:", IDC_STATIC_1, "STATIC", SS_RIGHT | WS_CHILD | WS_GROUP | WS_VISIBLE, 16, 20, 40, 8
    CONTROL "Password:", IDC_STATIC_2, "STATIC", SS_RIGHT | WS_CHILD | WS_GROUP | WS_VISIBLE, 16, 36, 40, 8
    EDITTEXT IDC_EDIT_1, 60, 18, 80, 12, ES_LEFT | WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE, WS_EX_WINDOWEDGE
    EDITTEXT IDC_EDIT_2, 60, 34, 80, 12, ES_LEFT | WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE, WS_EX_WINDOWEDGE
    CONTROL "Cancel", IDC_BUTTON_1, "BUTTON", BS_PUSHBUTTON | BS_VCENTER | BS_CENTER | WS_CHILD | WS_TABSTOP | WS_VISIBLE, 98, 112, 50, 14
    CONTROL "Apply", IDC_BUTTON_2, "BUTTON", BS_PUSHBUTTON | BS_VCENTER | BS_CENTER | WS_CHILD | WS_TABSTOP | WS_VISIBLE, 42, 112, 50, 14
}
+4
source share
2 answers

IsDialogMessage , . , , , . - :

while(GetMessage(&Msg, NULL, 0, 0))
{
    if(!IsDialogMessage(hDialogWnd, &Msg))
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
}

, MFC, , PreTranslateMessage, :

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
   if(IsDialogMessage(pMsg))
      return TRUE;
   else 
      return CDialog::PreTranslateMessage(pMsg);
}
+5

( , - , : CFrameWnd )

,

0

All Articles