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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to get handle to a window

how to get handle to a window

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
10 Posts 7 Posters 1 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.
  • B Offline
    B Offline
    B0606115
    wrote on last edited by
    #1

    hi! i want to use handle to a window in one of my function but do not know how to get handle to a window kindly help me. thanx in advance

    R CPalliniC R _ 4 Replies Last reply
    0
    • B B0606115

      hi! i want to use handle to a window in one of my function but do not know how to get handle to a window kindly help me. thanx in advance

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      B0606115 wrote:

      i want to use handle to a window in one of my function but do not know how to get handle to a window

      Well, what do you have? A CWnd*? Nothing? You could probably benefit from ::FindWindow()[^] or ::EnumWindows()[^].

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      • B B0606115

        hi! i want to use handle to a window in one of my function but do not know how to get handle to a window kindly help me. thanx in advance

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        What window? Is one of your application windows? Please provide details. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        L 1 Reply Last reply
        0
        • B B0606115

          hi! i want to use handle to a window in one of my function but do not know how to get handle to a window kindly help me. thanx in advance

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          You approach the window gently, and say: "Hi Window, may I please have your handle? Thanks!". Seriously though, you need to provide more information than that to get an answer that can be of use. :)

          It is a crappy thing, but it's life -^ Carlo Pallini

          K 1 Reply Last reply
          0
          • CPalliniC CPallini

            What window? Is one of your application windows? Please provide details. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            what details do you want? the handle perhaps??? :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


            R 1 Reply Last reply
            0
            • L Luc Pattyn

              what details do you want? the handle perhaps??? :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


              R Offline
              R Offline
              Roger Stoltz
              wrote on last edited by
              #6

              Luc Pattyn wrote:

              what details do you want? the handle perhaps???

              :laugh: Or he probably need a "handle" with that... ;P

              "It's supposed to be hard, otherwise anybody could do it!" - selfquote
              "High speed never compensates for wrong direction!" - unknown

              CPalliniC 1 Reply Last reply
              0
              • R Roger Stoltz

                Luc Pattyn wrote:

                what details do you want? the handle perhaps???

                :laugh: Or he probably need a "handle" with that... ;P

                "It's supposed to be hard, otherwise anybody could do it!" - selfquote
                "High speed never compensates for wrong direction!" - unknown

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #7

                Roger Stoltz wrote:

                Or he probably need a "handle" with that...

                Exactly. :laugh:

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                In testa che avete, signor di Ceprano?

                1 Reply Last reply
                0
                • B B0606115

                  hi! i want to use handle to a window in one of my function but do not know how to get handle to a window kindly help me. thanx in advance

                  _ Offline
                  _ Offline
                  _AnsHUMAN_
                  wrote on last edited by
                  #8

                  See if the following helps you. CWnd::GetSafeHwnd - Returns m_hWnd, or NULL if the this pointer is NULL.

                  You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

                  1 Reply Last reply
                  0
                  • R Rajesh R Subramanian

                    You approach the window gently, and say: "Hi Window, may I please have your handle? Thanks!". Seriously though, you need to provide more information than that to get an answer that can be of use. :)

                    It is a crappy thing, but it's life -^ Carlo Pallini

                    K Offline
                    K Offline
                    krish_kumar
                    wrote on last edited by
                    #9

                    Brother.. Give details correctly... Normally in visual programming all controls like list control,button everything is considered as a window. Specify the need ... ------------ Thanking you ------------

                    R 1 Reply Last reply
                    0
                    • K krish_kumar

                      Brother.. Give details correctly... Normally in visual programming all controls like list control,button everything is considered as a window. Specify the need ... ------------ Thanking you ------------

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      But the OP should help us help him. He needs to give us more information. I can ask him the following: Which window's handle do you need? Is that window a part of your application? Is it the window of an application that you are spawning? Is it a control that is within a window that you own? There are too many unknowns for us to answer. These guys are very helpful, but the OP needs to be precise. He should read the guidelines[^] :) [Post edited: I realised you weren't the OP :rolleyes: ]

                      It is a crappy thing, but it's life -^ Carlo Pallini

                      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