Solved

How to get the name of Active Window

Posted on 2003-11-18
3
659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Expert Comment

by:KurtVon
ID: 9771295
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
ID: 9771298
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
ID: 9771928
Simply, Use the method:

CWnd* GetActiveWindow();
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 98
Folder Comparison 12 55
Macro to save highlighted rows as a separate file 5 46
dog bark java program 15 120
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

756 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