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 to read out whole static text present on external application's Input boxes or message boxes in C#

How to read out whole static text present on external application's Input boxes or message boxes in C#

Scheduled Pinned Locked Moved C#
tutorialcsharpquestion
5 Posts 3 Posters 2 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
    sham bhand
    wrote on last edited by
    #1

    Hello friend!! I will required the whole static text present on external application's input box or message box. For example consider Microsoft word as external application which is password protected. Suppose my file name is "Demo.docx", when I clicked on this file the "password" input box is opened as i have already mentioned my file is password protected. The "Password" input box will contain static information message as follows: Enter the password to open file "C:\...\sham\desktop\Demo.docx" So my requirement is to getting this static message present on external application's input box or message box. Is there any way to read out this message programmatically??

    N L 2 Replies Last reply
    0
    • S sham bhand

      Hello friend!! I will required the whole static text present on external application's input box or message box. For example consider Microsoft word as external application which is password protected. Suppose my file name is "Demo.docx", when I clicked on this file the "password" input box is opened as i have already mentioned my file is password protected. The "Password" input box will contain static information message as follows: Enter the password to open file "C:\...\sham\desktop\Demo.docx" So my requirement is to getting this static message present on external application's input box or message box. Is there any way to read out this message programmatically??

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      sham bhand wrote:

      Is there any way to read out this message programmatically??

      I don't think there is way to do this completly using .NET classes. You have to work with native windows functions to do this. The idea is 1 - Get the window handle for the textbox you need to read. You can use FindWindow()[^] or FindWindowEx[^] to get a window handle. 2 - use SendMessage and send WM_GETTEXT to the handle to get the text.

      Best wishes, Navaneeth My blog

      1 Reply Last reply
      0
      • S sham bhand

        Hello friend!! I will required the whole static text present on external application's input box or message box. For example consider Microsoft word as external application which is password protected. Suppose my file name is "Demo.docx", when I clicked on this file the "password" input box is opened as i have already mentioned my file is password protected. The "Password" input box will contain static information message as follows: Enter the password to open file "C:\...\sham\desktop\Demo.docx" So my requirement is to getting this static message present on external application's input box or message box. Is there any way to read out this message programmatically??

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

        Check out the "UI Automation" classes in the .NET framework. Google "UI Automation C#" to get started.

        S 1 Reply Last reply
        0
        • L Lost User

          Check out the "UI Automation" classes in the .NET framework. Google "UI Automation C#" to get started.

          S Offline
          S Offline
          sham bhand
          wrote on last edited by
          #4

          Actually I am Beginner To C# and i don't know how to do it can you give me one sample code about this.

          L 1 Reply Last reply
          0
          • S sham bhand

            Actually I am Beginner To C# and i don't know how to do it can you give me one sample code about this.

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

            Check out this link: http://msdn.microsoft.com/en-us/magazine/cc163288.aspx[^]

            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