1

I have used Window Inspector and Spy++ to try and find a specific Textbox in a 3rd party app. It seems I found the box, as the Rect coordinates match what I expected.

But how do I get the text from this Textbox? I can possibly filter through all the details that Spy++ and Window Inspector give me, but I can't seem to find a way of getting the entire "pool of information" Window Inspector and Spy++ give me.

The Window at Textbox details below:

Window

Children: 0x000601f4 • Class: "#32770" • Rect: X=539, Y=513, W=450, H=358 • Style: 0x40000044 • StyleEx: 0x00000000 • Min: False • Max: False • PID: 5124 • Path: 'C:\Program Files (x86)\My App\My App.exe'

`

Textbox

0x00010660 • Class: "Edit" • Rect: X=550, Y=599, W=429, H=224 • Style: 0x503100c4 • StyleEx: 0x00000204 • Min: False • Max: False • PID: 5124 • Path: 'C:\Program Files (x86)\My App\My App.exe'

2

1 Answer 1

2
+25

Hope I'm not misunderstanding the question. It should be simple enough

For Windows Inspector the textbox contents should be under Text (normal):

Windows Inspector

For Spy++ the textbox contents should be under Caption

enter image description here

5
  • Good sense of direction, but what I'm trying to find is the IntPtr handle of the TextBox. It seems the handle is a "child-of-a-child-of-a-child..." essentially deeper into the "treeview" of handles and I can only get a list of top level (parent) branches of handles. Commented Sep 12, 2022 at 10:24
  • sorry, maybe I'm still not getting it, but the Windows Handle/Handle in the pictures is the IntPtr of the textbox, not its parent form. Commented Sep 12, 2022 at 14:22
  • You are correct, it is the handle of the textbox, but how do I find this handle on C#? I can hard-code it, but next time I restart the app owning the textbox, it will be a different handle. Commented Sep 12, 2022 at 16:22
  • I can get the text if I hard-code the IntPtr, but this pointer will change each time I open the app, so I need to find a way of going through each IntPtr. Can I do a system-wide search of all IntPtrs and check their Rect property? Commented Sep 12, 2022 at 16:54
  • I see what you are asking now, I'm not sure how to do it but I'm sure its possible but perhaps you should clarify the question as when I read it its not clear that you asking for a programmatic approach outside of the spy++/inspector. Commented Sep 12, 2022 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.