Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combobox focus event

Status
Not open for further replies.

koeicjm

Programmer
Sep 12, 2001
73
JP
I want to capture the shift+tab event when my combo got focus, it is ok when I set the combobox DROPDOWNLIST, but when the combobox set to DROPDOWN, I can not capture the event if the focus is hold by the combobox, code like this:

BOOL CMyDlg::preTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_KEYDOWN )
{
if( (pMsg->hwnd == GetDlgItem(IDC_COMBO_FIND)->m_hWnd)
{
AfxMessageBox("IDC_COMBO_FIND-mhWnd");
return TRUE;
}
else if(GetFocus()==GetDlgItem(IDC_COMBO_FIND) )
{
AfxMessageBox("IDC_COMBO_FIND-getfocus");
}
else if(pMsg->hwnd == GetDlgItem(IDC_COMBO_FIND)->GetSafeHwnd())
{
AfxMessageBox("IDC_COMBO_FIND-GetSafeHwnd");
}
else
{
//AfxMessageBox("not hit");
}
}
return CDialog::preTranslateMessage(pMsg);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top