Solved

How to get the name of Active Window

Posted on 2003-11-18
3
653 Views
Last Modified: 2013-11-20
Hi All
How can we get the Name of the Active Frame In MDI application.

Mannu

0
Comment
Question by:manoj_sharma1911
3 Comments
 
LVL 11

Expert Comment

by:KurtVon
Comment Utility
It depends what you mean by "name".

CView* pView = ((CMainFrame*)AfxGetMainWnd())->GetActiveView()

gets the currently active view.  Now you can use that in several different ways:

// Get the title of the MDI child window
pView->GetParentFrame()->GetWindowText(strName);
// Get the file name
pView->GetDocument()->GetPathName();

Hope this helps.
0
 
LVL 1

Expert Comment

by:igor_sk
Comment Utility
MDIGetActive() returns the currently active MDI child window:

CMDIChildWnd* MDIGetActive( BOOL* pbMaximized = NULL ) const;

CMDIChildWnd is derived from CFrameWnd, which is derived from CWnd. So, you can use CWnd::GetWindowText() method to get the name of this window.
0
 

Accepted Solution

by:
VirtualEye earned 50 total points
Comment Utility
Simply, Use the method:

CWnd* GetActiveWindow();
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now