C# Problem

Started by
6 comments, last by Z3R0Bit 16 years, 2 months ago
How can I read text from a textbox or smth like that from another application. Tell me if u didn't get the idea.
Advertisement
You will need to find the Window Handle of the other application's window and then the control in order to read from it.

You probably would have to enumerate all Windows on the screen, check the name of it and then find the required control on it. It is possible, since you can just send messages to a Window Control, but it requires quite some work.

Toolmaker

Toolmaker is correct. You essentially need to enumerate top level windows (stuff that is open and visible) and get a handle to be able to do any kind of manipulation. That said, I'm not sure whether it is possible for you to access the child controls on a random application the way you are suggesting.

Well, perhaps not through .NET normally; with some jiggery pokery and DLLImports you might manage it -- but doesn't sound like a very good idea anyway...is there a good reason for doing this??

Take a look at this for ideas, perhaps.

~Shiny
------------'C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg.' -Bjarne Stroustrup
Also be careful when accesing different gui elements through other programs.GUI elements are not thread-safe meaning if two or more threads try to access a GUI element funky things will happen.You would need someking of synchronization(monitors,lock,mutex,semaphore O_O)
Deja vu!
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
thanks

I posted the exact same thing in "For Beginners". Just wanted to get more info on the topic from different parts
I think I got the basic idea on how to do what I wanted
It's against forum rules to post a thread on multiple boards. Please refrain from such things in the future.

Toolmaker

Ok, Sorry. Won't happen again

This topic is closed to new replies.

Advertisement