Page 1 of 1

Get variable from other programs

Posted: Mon Jan 29, 2007 4:04 pm
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

Posted: Mon Jan 29, 2007 4:33 pm
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.

Posted: Mon Jan 29, 2007 10:54 pm
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