|
-
August 20th, 2003, 07:57 AM
#1
Test whether my MDI app has the focus?
I did a search but could not find this, though I'm sure it's been answered before.
I need to be able to test whether my MDI app has the focus or not.
What's the best way to do this?
-
August 20th, 2003, 08:26 AM
#2
The following should work:
Code:
if(CWnd::GetFocus()->GetSafeHwnd() == AfxGetMainWnd()->GetSafeHwnd())
{
// Our App's main window has focus
}
-
August 20th, 2003, 09:13 AM
#3
Looks like it should, but
-
August 20th, 2003, 03:34 PM
#4
What exactly is not working? Did you look at the values returned by GetFocus()->GetSafeHwnd() and AfxGetMainWnd()->GetSafeHwnd() and looked them up in Spy++? Could it be that a child window (and not the main window) actually has the focus when you are testing?
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
|