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. Visual Basic
  4. Access another program's controls?

Access another program's controls?

Scheduled Pinned Locked Moved Visual Basic
csharpc++question
3 Posts 3 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
    Brandon X12000
    wrote on last edited by
    #1

    Hello, I am wondering that if you could have 2 executables or programs, one accessing another one's controls, like my Vb.NET program pressing a button on notepad.exe, or menus.

    Simple Thanks and Regards, Brandon T. H. Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#. Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison

    L 1 Reply Last reply
    0
    • B Brandon X12000

      Hello, I am wondering that if you could have 2 executables or programs, one accessing another one's controls, like my Vb.NET program pressing a button on notepad.exe, or menus.

      Simple Thanks and Regards, Brandon T. H. Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#. Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Brandon T. H. wrote:

      I am wondering that if you could have 2 executables or programs, one accessing another one's controls, like my Vb.NET program pressing a button on notepad.exe, or menus.

      Yup, that's possible, the collection of those techniques would be called "interprocess communication". You can take a pick between TCP/IP, (Named) Pipes, SendKeys, Memory mapped files and many more. A good CodeProject-article would be ".NET Remoting in Simple English (Really, it's that simple)[^]". --edit not cool to see the same question twice.

      Bastard Programmer from Hell :suss:

      L 1 Reply Last reply
      0
      • L Lost User

        Brandon T. H. wrote:

        I am wondering that if you could have 2 executables or programs, one accessing another one's controls, like my Vb.NET program pressing a button on notepad.exe, or menus.

        Yup, that's possible, the collection of those techniques would be called "interprocess communication". You can take a pick between TCP/IP, (Named) Pipes, SendKeys, Memory mapped files and many more. A good CodeProject-article would be ".NET Remoting in Simple English (Really, it's that simple)[^]". --edit not cool to see the same question twice.

        Bastard Programmer from Hell :suss:

        L Offline
        L Offline
        LCARS x32
        wrote on last edited by
        #3

        Those concepts will only work if he has access to both programs' code. If you are trying to control a program you did not create or cannot modify, you will need to use API calls such as "FindWindow"/"FindWindowEx" to locate the window and child control (also considered a "window"). You can use programs like spy++ or winspector spy to figure out the class/caption of the windows and controls. Once you have the handle (intptr) to the control, you can use other API calls to send key presses and/or mouse clicks. You'll have to google those, tho. Hope that helps! Ray

        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