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. access controls in other applications from .NET (C#)

access controls in other applications from .NET (C#)

Scheduled Pinned Locked Moved C#
csharpdesigntutorial
7 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.
  • U Offline
    U Offline
    User 6277730
    wrote on last edited by
    #1

    how can access other controls such as button, textbox etc. in an other application from C#. For example I want to design a form that has a combo box with some data in it, and by choosing an Item from the combo box, that item will be copied to the search box of Internet Explorer (for example).

    D L 2 Replies Last reply
    0
    • U User 6277730

      how can access other controls such as button, textbox etc. in an other application from C#. For example I want to design a form that has a combo box with some data in it, and by choosing an Item from the combo box, that item will be copied to the search box of Internet Explorer (for example).

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Member 6289976 wrote:

      how can access other controls such as button, textbox etc. in an other application from C#.

      With extreme difficulty. Controlling another appication requires you to use Win32 API functions to search for windows, then search those windows for other windows, representing buttons and other controls, to find the one you want, get it's window handle, craft an appropriate window message to send to it and then send the message. There is also no guarantee that the control you're "talking" to will respond to the message you send. IE complicates this even further, because now you have to use an entirely different method, using IE's Document Object Model, to get at the controls on a web form.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      H 1 Reply Last reply
      0
      • U User 6277730

        how can access other controls such as button, textbox etc. in an other application from C#. For example I want to design a form that has a combo box with some data in it, and by choosing an Item from the combo box, that item will be copied to the search box of Internet Explorer (for example).

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, FWIW, you could tackle your particular example in quite some different ways: 1. for Google, you can come up with the URL that specifies your search (just try it manually and see what URL Google generates when you hit the Search button; now use Process.Start(searchURL) to launch your default web browser and have it search right away. 2. or put a WebBrowser Control on your Form and give it a Navigate() command. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


        H 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Member 6289976 wrote:

          how can access other controls such as button, textbox etc. in an other application from C#.

          With extreme difficulty. Controlling another appication requires you to use Win32 API functions to search for windows, then search those windows for other windows, representing buttons and other controls, to find the one you want, get it's window handle, craft an appropriate window message to send to it and then send the message. There is also no guarantee that the control you're "talking" to will respond to the message you send. IE complicates this even further, because now you have to use an entirely different method, using IE's Document Object Model, to get at the controls on a web form.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          H Offline
          H Offline
          hot_ice
          wrote on last edited by
          #4

          SO that's possible...... but a little hard as you say. can you mention some basic information for solving this problem. I mean what background should I have to do this. and thank you very much for your reply. :)

          D 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, FWIW, you could tackle your particular example in quite some different ways: 1. for Google, you can come up with the URL that specifies your search (just try it manually and see what URL Google generates when you hit the Search button; now use Process.Start(searchURL) to launch your default web browser and have it search right away. 2. or put a WebBrowser Control on your Form and give it a Navigate() command. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


            H Offline
            H Offline
            hot_ice
            wrote on last edited by
            #5

            thank you luc. but I just meant an example. my question was general, I mean what if I want to access a button in photoshop for example, to make a little plugin for myself... thank you again. :)

            D 1 Reply Last reply
            0
            • H hot_ice

              thank you luc. but I just meant an example. my question was general, I mean what if I want to access a button in photoshop for example, to make a little plugin for myself... thank you again. :)

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Then you'd use the SDK for PhotoShop to create the plugin. Not some screwed up method of "remote controlling" another application.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              1 Reply Last reply
              0
              • H hot_ice

                SO that's possible...... but a little hard as you say. can you mention some basic information for solving this problem. I mean what background should I have to do this. and thank you very much for your reply. :)

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                You need the Win32 API functions FindWindowEx and SendMessage at a minimum. You've got enough to Google with and find examples on how to use them.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                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