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#
  4. Get window using process Thread.

Get window using process Thread.

Scheduled Pinned Locked Moved C#
help
4 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.
  • S Offline
    S Offline
    sucil
    wrote on last edited by
    #1

    can anyone help me to get window using process thread SUCIL

    A N 0 3 Replies Last reply
    0
    • S sucil

      can anyone help me to get window using process thread SUCIL

      A Offline
      A Offline
      Alex Manolescu
      wrote on last edited by
      #2

      You can use this to get an instance to the current thread:

      Thread _currentThread = Thread.CurrentThread

      Cheer's, Alex Manolescu

      1 Reply Last reply
      0
      • S sucil

        can anyone help me to get window using process thread SUCIL

        N Offline
        N Offline
        Natza Mitzi
        wrote on last edited by
        #3

        Are you looking for the main form in your own application ? A main window in a different application? Is the other process a .NET application? Please explain

        Natza Mitzi Analysis Studio Statistical Analysis Software

        1 Reply Last reply
        0
        • S sucil

          can anyone help me to get window using process thread SUCIL

          0 Offline
          0 Offline
          0x3c0
          wrote on last edited by
          #4

          I assume that you want to get the window handle from a thread id. To do that, I would:

          1. Pass the thread id to GetProcessIdOfThread() to obtain a process id
          2. Because a process can open multiple windows, you need to return a collection. Iterate every window, getting their process ids. If it matches the id from 1., then add the window handle to the collection

          OSDev :)

          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