Get variable from other programs

Just starting out? Need help? Post your questions and find answers here.
BabyBacon
New User
New User
Posts: 8
Joined: Wed Feb 01, 2006 11:47 pm
Location: Sweden

Get variable from other programs

Post by BabyBacon »

Hi!

I've got this program runing and it puts out a number every 30s. It is shown in a label and I guess there must be a variable holding that number (d0h?).
Im trying to get that number, but I dont know how.

Please give me a hint what to look for.

Hugs // Babybacon
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Your label is a static control and you can get its contents with GetWindowText_():

Code: Select all

w = FindWindow_(0,"A Window")
textgadget = GetWindow_(w, #GW_CHILD); You'll need to know which child 
text.s = Space(#MAX_PATH)
GetWindowText_(textgadget, @text, #MAX_PATH-1)
Debug text
All you need to know is the name of the window and which child the label is and you're set. It may be a matter of doing an EnumChildWindows_() when the label text is known and look for it. After that you'll know it's the third child on the window or whatever and you can grab it on that basis.
BERESHEIT
BabyBacon
New User
New User
Posts: 8
Joined: Wed Feb 01, 2006 11:47 pm
Location: Sweden

Post by BabyBacon »

oh thats sweet!

I probebly be back with more stupid questions later ;)
This will help for the moment... api is not an easy thing to master.

Thank you very much.
A million kisses for you // BabyBacon
Post Reply