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. How can I get handle (IntPtr) to a "sub"-form in another application?

How can I get handle (IntPtr) to a "sub"-form in another application?

Scheduled Pinned Locked Moved C#
questioncsharpwinforms
26 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.
  • Richard Andrew x64R Richard Andrew x64

    You need to put a breakpoint inside the "myDelegate" callback to see if ANY windows are being found, not just ones that match your substring. But first, verify that it is indeed finding the correct process. Compare the ProcessId to the one shown by Task Manager. EDIT: I'm sorry I didn't see that you had already tried the breakpoint inside the callback. The only thing I can think of at this moment is to make sure it is finding the correct process.

    The difficult we do right away... ...the impossible takes slightly longer.

    A Offline
    A Offline
    arnold_w
    wrote on last edited by
    #21

    It is finding the right bash.exe process (there is only 1 running) and it successfully finds its 3 threads. As you said, the filtering with the substrings happens later and by then there are no handles at all to filter.

    Richard Andrew x64R 1 Reply Last reply
    0
    • A arnold_w

      It is finding the right bash.exe process (there is only 1 running) and it successfully finds its 3 threads. As you said, the filtering with the substrings happens later and by then there are no handles at all to filter.

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #22

      I have one last thing. I'm not familiar with bash, is it a command line program?

      The difficult we do right away... ...the impossible takes slightly longer.

      A 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        I have one last thing. I'm not familiar with bash, is it a command line program?

        The difficult we do right away... ...the impossible takes slightly longer.

        A Offline
        A Offline
        arnold_w
        wrote on last edited by
        #23

        Yes, I think it's some kind of command prompt that is standard for Unix systems, but it exists for Windows also. I've seen some of my colleagues (those that prefer typing over interacting with GUI:s) type

        $ git.exe checkout develop

        when they want to checkout in Git.

        Richard Andrew x64R 1 Reply Last reply
        0
        • A arnold_w

          Yes, I think it's some kind of command prompt that is standard for Unix systems, but it exists for Windows also. I've seen some of my colleagues (those that prefer typing over interacting with GUI:s) type

          $ git.exe checkout develop

          when they want to checkout in Git.

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #24

          Bingo! That must be why you're not finding any Windows. I can think of two possibilities at this point. 1. It might be that you need to find bash's parent process and enumerate the windows of that process instead. 2. It might be that the Linux Subsystem is interfering somehow.

          The difficult we do right away... ...the impossible takes slightly longer.

          A 1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            Bingo! That must be why you're not finding any Windows. I can think of two possibilities at this point. 1. It might be that you need to find bash's parent process and enumerate the windows of that process instead. 2. It might be that the Linux Subsystem is interfering somehow.

            The difficult we do right away... ...the impossible takes slightly longer.

            A Offline
            A Offline
            arnold_w
            wrote on last edited by
            #25

            When I closed my bash.exe command prompt, I could see that the following processes disappeared: backgroundTaskHost, bash, conhost, git-bash, mintty and RuntimeBroker. When I tried mintty instead of bash, then it worked great! Again, thanks for your help!

            Richard Andrew x64R 1 Reply Last reply
            0
            • A arnold_w

              When I closed my bash.exe command prompt, I could see that the following processes disappeared: backgroundTaskHost, bash, conhost, git-bash, mintty and RuntimeBroker. When I tried mintty instead of bash, then it worked great! Again, thanks for your help!

              Richard Andrew x64R Offline
              Richard Andrew x64R Offline
              Richard Andrew x64
              wrote on last edited by
              #26

              Happy to help! :)

              The difficult we do right away... ...the impossible takes slightly longer.

              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