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 child window's handles(HWND)

Get child window's handles(HWND)

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • C Offline
    C Offline
    Chintan
    wrote on last edited by
    #1

    hello.......how to get Child frame's handles from Main frame in MDI application? Thanxs..... C.R.Naik

    M 1 Reply Last reply
    0
    • C Chintan

      hello.......how to get Child frame's handles from Main frame in MDI application? Thanxs..... C.R.Naik

      M Offline
      M Offline
      Martyn Pearson
      wrote on last edited by
      #2

      You can use code similar to this. Basically, you go through each of the application document templates, to get each of the open documents. For each document (which could have multiple views), you go through each of the views, and then get the parent frame.

          POSITION posTemplate = theApp.GetFirstDocTemplatePosition();
          while (posTemplate)
          {
              CDocTemplate * pTemplate = theApp.GetNextDocTemplate(posTemplate);
              
              POSITION posDocument = pTemplate->GetFirstDocPosition();
              while (posDocument)
              {
                  CDocument * pDocument = pTemplate->GetNextDoc(posDocument);
      
                  POSITION posView = pDocument->GetFirstViewPosition();
                  if (posView)
                  {
                      CView * pView = (CSpecExView *)pSpecExDoc->GetNextView(posView);
                      CFrameWnd * pChildFrame = pView->GetParentFrame();
                  }
              }
          }
      

      Hope this helps!

      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