Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You will have to get the window handle to the application hosting the text box and then get a handle to the actual control that you want to get the text out of. Then you can send a WM_GETTEXT message to that control to read the value of the control. You will want to use some window spy application to get the details of the controls hosted in a window like the AutoIt Window Information Tool.</p> <p>I was able to find an example off of Experts Exchange detailing how perform the above reading the detail of the edit control in notepad: <a href="http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_23748618.html" rel="nofollow">http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_23748618.html</a> (Scroll to the bottom for the answers).</p> <pre><code>private const int WM_GETTEXTLENGTH = 0x000E; private const int WM_GETTEXT = 0x000D; [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, StringBuilder lParam); [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam); IntPtr notepad = FindWindow("notepad", null); IntPtr editx = FindWindowEx(notepad, IntPtr.Zero, "edit", null); int length = SendMessage(editx, WM_GETTEXTLENGTH, 0, 0); StringBuilder text = new StringBuilder(length); int hr = SendMessage(editx, WM_GETTEXT, length, text); Console.WriteLine(text); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload