How to read out whole static text present on external application's Input boxes or message boxes in C#
-
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??
-
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??
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 sendWM_GETTEXT
to the handle to get the text.Best wishes, Navaneeth My blog
-
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??
-
Check out the "UI Automation" classes in the .NET framework. Google "UI Automation C#" to get started.
Actually I am Beginner To C# and i don't know how to do it can you give me one sample code about this.
-
Actually I am Beginner To C# and i don't know how to do it can you give me one sample code about this.