Hello.
I want to get previous window's focus.
My program need to know prevoius focus of anoter windows.
Thank you.
Printable View
Hello.
I want to get previous window's focus.
My program need to know prevoius focus of anoter windows.
Thank you.
The window that previously had focus is passed to CWnd::OnSetFocus(). You can store its handle (not the pointer itself!) for later use.
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 .
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 ...
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
Thank you So much Bill.
I really appreciate your help.