LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Grabbing text from a text box in a window running in wine. (https://www.linuxquestions.org/questions/programming-9/grabbing-text-from-a-text-box-in-a-window-running-in-wine-657254/)

thefalling881 07-21-2008 02:03 PM

Grabbing text from a text box in a window running in wine.
 
Writing my program in C, and I have no idea where to start. If anyone could point me in the right direction, would be awesome.

MS3FGX 07-21-2008 02:42 PM

I am a little confused...

You want to write a Linux program that reads a text box of a Windows program running through WINE?

thefalling881 07-21-2008 03:09 PM

yeah




-----thefalling881

matthewg42 07-21-2008 03:33 PM

Maybe I'm misunderstanding. Can't you just use copy-paste?

MS3FGX 07-21-2008 07:17 PM

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.

thefalling881 07-21-2008 08:21 PM

Quote:

Originally Posted by MS3FGX (Post 3222079)
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.

matthewg42 07-21-2008 08:38 PM

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.


All times are GMT -5. The time now is 04:46 AM.