Extracting text from application GUI - windows

Is there anyway to extract text from application UI by using C++ or C# (lets say like the text on the UI of steam launcher ) ? I need extract the text in order to do some automation of the application.

Have a play around with spy++, it's a tool that comes with Visual Studio. If spy++ can dig down to see the UI elements then you can build a program that does the same.

You can do it winth winapi, there are scripting languages that makes it easier:
http://www.autoitscript.com/site/autoit/
Basicly you should locate somehow your control you want to read, spy++ is a good example, then read it either using its order in window hierarchy or class name.

Related

GUI adapter for old DOS application

I have an old DOS application which accepts some files as input, does some calculations and saves results into file system. This app uses terminal as sort of GUI, where you can choose input files, types of calculations to perform and choose where to save the result. I don't know the logics behind calculations and am not able to reuse them in a new project.
The problem is that the users of this app want a modern looking GUI which will be easier to work with.
That is why, I have an idea to create an adapter which will translate button clicks into commands in DOS and grab text output to show in modern GUI.
Is it possible and where should I start from?
It is possible. How to start from depends on your programming Tools. If you use a RAD tool like Delphi or Lazarus or Visual Besic or ... then make your GUI design first and define Events after. For a Button click it is ButtonXClick(); In the RAD tool you will find a object inspector with properties and ther values and Events and their values. Go to Events page there, look for onClick-event. Double click there in the value line and you will get an empty Event handler, wehre you can write your Code for your application.
If you dont have or use such RAD tool, take a GUI Framework for DOS. Create your frontend and write your Code which is to call in Dependance of your button clicks.

Need SendMessage Command to get List from a VB6 application

Hi I have a program that is built using VB6(I do not have the sourcecode, only executable), that has a listbox and will have couple of items in that listbox. I need to read contents of it using SendMessage. Please let me know if that is possible.
It's possible if it's a standard or at least documented listbox control. Usually one would use a "spy" program to examine the target app and obtain window titles/classes/etc. used to programmatically locate the window that is the listbox control. Then you just use SendMessage() to talk directly to the HWND of that control and get the info you need.
See similar question:
Read listbox content of from another application C#

Where can I find a list of all window class names?

I want to use the function "findwindowex" (windows API)
I wanted to know what appropriate values ​​for the parameter "ClassName".
Are the tables that are here show the possible values​​?
If not - where can I find details of all types "ClassName"?
(Am I understood? I do not know good English.)
No, those are the names of some classes registered by the system. A great many Windows applications will be built with classes registered by those applications.
If you wish to find the name of the window class used by a particular window, use GetClassName().
You need to use a tool like SPY.EXE that's included somewhere as part of the win32 SDK. It shows the classname of the window currently under your cursor.
Microsoft Spy++ I believe when you hover over the window after clicking the Find button it shows all the information about the window.

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Customizing Windows Right-Click menus with multiple levels

I understand the process needed to customize a right click menu going through the regedit etc. However I need to the ability to go multiple levels such as in applications like WinZip. Here's a picture for clarification of what I need
alt text http://img14.imageshack.us/img14/9658/multiplemenus.jpg
You need to write a Shell Extension; there is a guide for writing one in managed code (C#) here. It will involve doing a bunch of interop and implementing COM interfaces that the windows shell will consume, namely IShellExtInit and IContextMenu.
However, one could argue that writing a Shell Extension in managed code is not advisable; it will force windows explorer to load the CLR, (or any app that uses the standard windows 'Open File' dialog) - native code (C++) would be a better choice for this.

Resources