What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Text extraction from a Window?

Text extraction from a Window?
Author: Message:
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. Text extraction from a Window?
Hi folks,

I'm writing a shell jscript for WSH and want to know if it's possible to extract the text in child controls from other Windows applications that are running. Some examples would be obtaining the text from a button in a dialog box, reading the text values from the nodes in a treeview or combobox, etc.

Enumerating existing processes is the first step, which i've done, now i want to dig down into those processes...

Ideas?

  -Zero
12-03-2008 05:43 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Text extraction from a Window?
Not with WSH, however using the FindWindow and FindWindowEX API functions you can find child windows and read the text using GetWindowText etc.
12-03-2008 06:23 PM
Profile E-Mail PM Find Quote Report
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. RE: Text extraction from a Window?
Can you give me a little more info on that API? I've never heard of it before and I'm not sure where to even begin reading about it.
12-03-2008 07:43 PM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Text extraction from a Window?
It's all on MSDN!
You need to use Interop.Call and Interop.Allocate to work with these Win32 API functions, which might be scary at first sight. Have a look at some more complex scripts and see how those use the Win32 API.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-04-2008 12:52 PM
Profile E-Mail PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Text extraction from a Window?
what are you doing it for? there's probably a better way :p
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-04-2008 01:11 PM
Profile PM Web Find Quote Report
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. RE: Text extraction from a Window?
thnx for the good advice Matti - could you point me at some example scripts that use Interop?
12-04-2008 05:02 PM
Profile E-Mail PM Web Find Quote Report
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. RE: Text extraction from a Window?
Is Interop part of the MPL infrastructure or is it something that can be used in JScript's in general?
12-04-2008 05:12 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Text extraction from a Window?
quote:
Originally posted by Zero
Is Interop part of the MPL infrastructure or is it something that can be used in JScript's in general?
The Win32 API can be used in a lot of programming languages however JScript and VBScript do not have access to it. Interop calling in Plus! Scripting is provided by Messenger Plus! Scripting Engine without it you couldn't do it unless you created an ActiveX Object.

Cheers.
12-04-2008 05:46 PM
Profile E-Mail PM Find Quote Report
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. RE: Text extraction from a Window?
That's awesome info, Matty! Thanks for your excellent input.
12-04-2008 08:46 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On