Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get Active WIndow Name

Get Active WIndow Name

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anu_Bala
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • A Anu_Bala

      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

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      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 the pActivateView parameter with the this pointer -

      if (pActivateView == this) ...

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++)

      Polymorphism in C

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups