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. How get the handle of the window ?

How get the handle of the window ?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
5 Posts 4 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
    Anamika2005
    wrote on last edited by
    #1

    can somebody help me.. How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?

    H M D 4 Replies Last reply
    0
    • A Anamika2005

      can somebody help me.. How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Is FindWindowhelpfuls ?


      WhiteSky


      1 Reply Last reply
      0
      • A Anamika2005

        can somebody help me.. How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        What do you need to get, an HWND or a CWnd pointer? Is the dialog in your app?

        1 Reply Last reply
        0
        • A Anamika2005

          can somebody help me.. How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?

          D Offline
          D Offline
          dharani
          wrote on last edited by
          #4

          Use HWND hand= GetSafeHwnd(); CWnd* pWnd= CWnd::FromHandle();

          redindian

          1 Reply Last reply
          0
          • A Anamika2005

            can somebody help me.. How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?

            D Offline
            D Offline
            dharani
            wrote on last edited by
            #5

            You do not need CWnd to call ::GetSafeHWnd() ::GetSafeHwnd() is a win32 API CWnd::GetSafeHWnd is the same but MFC wrapped .

            redindian

            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