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. Which thread has created this window? [modified]

Which thread has created this window? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 3 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.
  • J Offline
    J Offline
    Joseph Marzbani
    wrote on last edited by
    #1

    How can I get the ID of a thread that has created a specific window? for clarification, see we have the handle of a window (e.g m_hWnd). Now for any reason, I'm gonna get the ID of the thread that has created this window. Please pay attention I mean a window from another application.

    Thank you masters!

    modified on Friday, September 26, 2008 3:26 AM

    T D 2 Replies Last reply
    0
    • J Joseph Marzbani

      How can I get the ID of a thread that has created a specific window? for clarification, see we have the handle of a window (e.g m_hWnd). Now for any reason, I'm gonna get the ID of the thread that has created this window. Please pay attention I mean a window from another application.

      Thank you masters!

      modified on Friday, September 26, 2008 3:26 AM

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      Is GetCurrentThreadId of any use???

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
      Never mind - my own stupidity is the source of every "problem" - Mixture

      cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>

      J 1 Reply Last reply
      0
      • T ThatsAlok

        Is GetCurrentThreadId of any use???

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>

        J Offline
        J Offline
        Joseph Marzbani
        wrote on last edited by
        #3

        Thanks, but I meant a window that belongs to another application than mine!

        Thank you masters!

        D 1 Reply Last reply
        0
        • J Joseph Marzbani

          Thanks, but I meant a window that belongs to another application than mine!

          Thank you masters!

          D Offline
          D Offline
          Daniel Kanev
          wrote on last edited by
          #4

          What exactly do you need - Process Id or Thread Id?

          1 Reply Last reply
          0
          • J Joseph Marzbani

            How can I get the ID of a thread that has created a specific window? for clarification, see we have the handle of a window (e.g m_hWnd). Now for any reason, I'm gonna get the ID of the thread that has created this window. Please pay attention I mean a window from another application.

            Thank you masters!

            modified on Friday, September 26, 2008 3:26 AM

            D Offline
            D Offline
            Daniel Kanev
            wrote on last edited by
            #5

            I think this API should do the job - GetWindowThreadProcessId http://msdn.microsoft.com/en-us/library/ms633522(VS.85).aspx[^] Please, tell me if it works for you :)

            J 1 Reply Last reply
            0
            • D Daniel Kanev

              I think this API should do the job - GetWindowThreadProcessId http://msdn.microsoft.com/en-us/library/ms633522(VS.85).aspx[^] Please, tell me if it works for you :)

              J Offline
              J Offline
              Joseph Marzbani
              wrote on last edited by
              #6

              LORD! You're an angel :-O It really works! Thank you as much as the number of letters in my last project :laugh: (It's a huge one)

              Thank you masters!

              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