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. Mainframe HWND from process ID

Mainframe HWND from process ID

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

    Is it possible to obtain the main window handle of a running application if I have the process ID? I actually got the handle by enumerating the windows and searching by the window title. But, I feel like there must be a better way. Thanks for any help

    C 1 Reply Last reply
    0
    • B Bugra Barin

      Is it possible to obtain the main window handle of a running application if I have the process ID? I actually got the handle by enumerating the windows and searching by the window title. But, I feel like there must be a better way. Thanks for any help

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      You can make the invert process using GetWindowThreadProcessId.. But for find that you need go to "Process and Thread Functions" in MSDN.... Carlos Antollini. Pi Five[^]Creator Sonork ID 100.10529 cantollini

      B 1 Reply Last reply
      0
      • C Carlos Antollini

        You can make the invert process using GetWindowThreadProcessId.. But for find that you need go to "Process and Thread Functions" in MSDN.... Carlos Antollini. Pi Five[^]Creator Sonork ID 100.10529 cantollini

        B Offline
        B Offline
        Bugra Barin
        wrote on last edited by
        #3

        I actually want to do just the reverse of what GetWindowThreadProcessId does. But, that gives me an idea, thanks..

        T 1 Reply Last reply
        0
        • B Bugra Barin

          I actually want to do just the reverse of what GetWindowThreadProcessId does. But, that gives me an idea, thanks..

          T Offline
          T Offline
          Tim Smith
          wrote on last edited by
          #4

          It can't be done since it isn't unique (one process having 2 or more main windows). But if you are sure you have a unique window, the brute force method should work. Tim Smith I'm going to patent thought. I have yet to see any prior art.

          A 1 Reply Last reply
          0
          • T Tim Smith

            It can't be done since it isn't unique (one process having 2 or more main windows). But if you are sure you have a unique window, the brute force method should work. Tim Smith I'm going to patent thought. I have yet to see any prior art.

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            Thanks

            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