Get Active WIndow Name
-
Hi, In my MDI application im loading one DialogBar in mainframe.But i want to show that dialog bar when some child window invokes(GroupView,TrendView).For other windows it should be in hide(GraphView).So for all functions used to invoking child window from CMainFrame im hiding the toolbae like this.
void CMainFrame::OnGroupview()
{
.
.
.
m_RecentAlarms.ShowWindow(SW_HIDE);
}For some view
void CMainFrame::OnGroupview()
{
.
.
.m_RecentAlarms.ShowWindow(SW_SHOW);
}So,when i click TrendView i get the dialog bar,then when i click GraphView the dialgobar get hided.But Again when i click TrendView I didnt get Dialogbar.Because the application is multiple window.The previous TrendView is behind the graphview,when i invoke just it show in front. So my idea is i have one thread in Mainframe,this function updates some values in all views.In that i will check whether the Active View is TrendView,if it so then dialog bar is in SW_SHOW other wise it is SW_HIDE. I used this..
CMDIChildWnd* pChild = ((CMainFrame*)AfxGetMainWnd())->MDIGetActive();
But i dont know how to get the active view is TrendView only.... Pls help me in this issue.
Anu
-
Hi, In my MDI application im loading one DialogBar in mainframe.But i want to show that dialog bar when some child window invokes(GroupView,TrendView).For other windows it should be in hide(GraphView).So for all functions used to invoking child window from CMainFrame im hiding the toolbae like this.
void CMainFrame::OnGroupview()
{
.
.
.
m_RecentAlarms.ShowWindow(SW_HIDE);
}For some view
void CMainFrame::OnGroupview()
{
.
.
.m_RecentAlarms.ShowWindow(SW_SHOW);
}So,when i click TrendView i get the dialog bar,then when i click GraphView the dialgobar get hided.But Again when i click TrendView I didnt get Dialogbar.Because the application is multiple window.The previous TrendView is behind the graphview,when i invoke just it show in front. So my idea is i have one thread in Mainframe,this function updates some values in all views.In that i will check whether the Active View is TrendView,if it so then dialog bar is in SW_SHOW other wise it is SW_HIDE. I used this..
CMDIChildWnd* pChild = ((CMainFrame*)AfxGetMainWnd())->MDIGetActive();
But i dont know how to get the active view is TrendView only.... Pls help me in this issue.
Anu
Override the
OnActivateView
method in your view classes. In each view class you can check if the activated view is the current view by comparing thepActivateView
parameter with thethis
pointer -if (pActivateView == this) ...
«_Superman_» _I love work. It gives me something to do between weekends.