-
May 23rd, 2002, 11:43 AM
#1
How can I get previous windows focus ?
Hello.
I want to get previous window's focus.
My program need to know prevoius focus of anoter windows.
Thank you.
-
May 23rd, 2002, 11:46 AM
#2
The window that previously had focus is passed to CWnd::OnSetFocus(). You can store its handle (not the pointer itself!) for later use.
regards,
MiMec
-
May 23rd, 2002, 11:50 AM
#3
One way to do this is to have each control record its ID in a global variable in its OnKillFocus event handler. Then you can tell which control had the last.
Another way is to implement a OnSetFocus handler. It gets a pointer to the previous controls CWnd as an argument .
-
May 23rd, 2002, 12:46 PM
#4
Hi
Thank you.
That helps me.
One more add.. How can I get focus of previous window's component.
For example If i did input edit box on windows or dialog box that has a lot of edit boxs, then How can I know Which has the previous focus ?
Please help me ...
-
May 23rd, 2002, 01:02 PM
#5
Its the one passed to you in OnSetFocus(CWnd *pWnd);
pWnd is the previous control's window.
pWnd->GetDlgCtrlID( ) ; // to get its ID, if that's what you need
-
May 23rd, 2002, 01:07 PM
#6
Thank you So much Bill.
I really appreciate your help.
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
|