Grabbing text from a text box in a window running in wine.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I assumed he wanted something automated, that is able to run and pull the text right from the window without having to actually copy and paste it. But he didn't say either way, so I guess he needs to clarify that a bit.
I assumed he wanted something automated, that is able to run and pull the text right from the window without having to actually copy and paste it. But he didn't say either way, so I guess he needs to clarify that a bit.
Yeah I want the program im writing in C to do it. So yeah, i want it to be automated.
Firstly I should say that I don't know enough about the internals of wine to know if there is a nice way to do it.
Assuming there is some mechanism for getting at such data, what criteria would your program use to decide which wine process to look at, and within that process the window and widget object to get data from?
There are products on Windows which can programatically grab stuff from widgets in Windows apps (e.g. winrunner, which can also be used to script the sending of events like mouse clicks and keyboard entry).
In my limited experience these mechanisms are hideously ugly and complicated, because Windows doesn't really provide a good mechanism for scripting generalised interaction with GUI apps.
Given that wine really does give you access to the win32 internals, you might be able to write some sort of framework for addressing widgets in windows apps, but I expect it will be a lot of work, and will probably mean having to write a lot of code which you build into wine itself.
What is the exact application which you wish to interact with, and what is the purpose?
Some apps may provide some sort of IPC mechanism which would allow another process to query them for some info. I sometimes use the dcop interface to script interaction with KDE apps. It's awesomely useful. I have never been a Windows developer and haven't used it in anger for years, so I'm afraid I cannot tell you if there is some equivalent in the Windows world.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.