|
-
May 21st, 1999, 04:26 AM
#1
GetFocus() don't behave properly?!
I have a dialog with a combobox on it. And in PreTranslateMessage() I want to check if the focus is on the combobox. So I do the following:
void CMyDialog::PreTranslateMessage(MSG* pMsg)
{
int ret = CDialog::PreTranslateMessage();
if(pMsg->message==WM_KEYUP)
if(GetDlgItem(IDC_COMBO) == GetFocus())
{
// do something
}
return ret;
}
the second if always return FALSE. Where do I fail?
-
May 21st, 1999, 05:06 AM
#2
Re: GetFocus() don't behave properly?!
The focus is received by inside edit of combbox, not combo.
Sincerely, Mihai
-
May 21st, 1999, 05:22 AM
#3
Re: GetFocus() don't behave properly?!
So how should I write it then?
-
May 21st, 1999, 07:42 AM
#4
Re: GetFocus() don't behave properly?!
Try this:
void CMyDialog::PreTranslateMessage(MSG* pMsg)
{
const int ret = CDialog::PreTranslateMessage();
if (pMsg->message==WM_KEYUP)
{
if (GetDlgItem(IDC_COMBO)->GetWindow(GW_CHILD) == CWnd::GetFocus())
{
// do something
}
}
return ret;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|