Home > Software engineering >  Tabstop no effect problem in ATL/cannot make next controls access to the focus
Tabstop no effect problem in ATL/cannot make next controls access to the focus

Time:04-30

Topic main ATL my study found the Tab key to switch focus is invalid when developing a plug-in?

Should not complex, without any logic code in there, in the project of the rc file
/////////////////////////////////////////////////////////////////////////////
//
//Dialog
//

IDD_WEBLOGIN DIALOGEX 0, 0, 320, 163,
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU
The FONT 9, "MS Shell Dlg", 0, 0, 0 x0
The BEGIN
CONTROL ", "IDC_STATIC," Static ", 8,35,305,1 SS_ETCHEDHORZ,
RTEXT "user name", IDC_STATIC, 68,48,57,12 SS_CENTERIMAGE | WS_TABSTOP
RTEXT user password ", "IDC_STATIC, 68,60,57,12 SS_CENTERIMAGE | WS_TABSTOP
The EDITTEXT IDC_EDIT1, 132,48,86,12, ES_AUTOHSCROLL
The EDITTEXT IDC_EDIT2, 132,60,86,12, ES_PASSWORD | ES_AUTOHSCROLL
"Login" PUSHBUTTON, IDC_BUTTON1, 167,78,50,14
CONTROL ", "IDC_STATIC," Static ", SS_ETCHEDHORZ, 8114305, 1
RTEXT "select language", IDC_STATIC, 144139,57,12 SS_CENTERIMAGE
COMBOBOX IDC_COMBO1, 207139,93,54, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END

////////////////////////////////////////////////////////////////////////////
The main interface code
# pragma once

# include ".. "///resource. H main symbol

#include

Using the namespace ATL.

//CWebLogin

The class CWebLogin:
Public CAxDialogImpl
{
Public:
CWebLogin ()
{
}

~ CWebLogin ()
{
}

Enum {IDD=IDD_WEBLOGIN};

BEGIN_MSG_MAP (CWebLogin)
MESSAGE_HANDLER WM_INITDIALOG, OnInitDialog ()

CHAIN_MSG_MAP (CAxDialogImpl)
END_MSG_MAP ()

//handler prototype:
//LRESULT MessageHandler (UINT uMsg, WPARAM WPARAM, LPARAM LPARAM, BOOL& BHandled);
//LRESULT CommandHandler (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& BHandled);
//LRESULT NotifyHandler (int idCtrl, LPNMHDR PNMH, BOOL& BHandled);

LRESULT OnInitDialog (UINT uMsg, WPARAM WPARAM, LPARAM LPARAM, BOOL& BHandled)
{
CAxDialogImpl : : OnInitDialog (lParam uMsg, wParam, bHandled);
BHandled=TRUE;
return 1;//the system set focus
}

Virtual BOOL PreTranslateMessage (MSG * pMsg)
{
: : OutputDebugString (L "111111");
return FALSE;
};

};
I was going to intercept messages in PreTranslateMessage, but breaking point in PreTranslateMessage, seems to have no in this implementation,
Now my problem is that I want to through the Tab key or the Enter key, when after I input the user name (to) press the button the cursor to the password input box this effect,
Excuse me, how should do?



  • Related