|
-
August 5th, 1999, 11:31 PM
#1
Fnding active window
Hi,
I want to create a Program, which finds active windows.
I'm using MFC.
thanks for your help!1
Black racer
-
August 5th, 1999, 11:59 PM
#2
Re: Fnding active window
If your mean active View window than by this way you may rich you active View window from anywhere.
1. In your View class create static function GetView()
2 Implement it like this
CMyView* CMyView::GetView()
{
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
CView * pView = pFrame->GetActiveView();
if ( !pView )
return NULL;
if ( ! pView->IsKindOf( RUNTIME_CLASS(CMyView) ) )
return NULL;
return (CMyView *) pView;
}
Since it static function you my call it from everywhere like this
CMyViev::GetView();
If you mean Main Window use
AfxGetMainWnd()
Hope it help
-
August 6th, 1999, 07:30 AM
#3
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
|