PDA

Click to See Complete Forum and Search --> : Help on getting label's name and caption in a running program


CCT
Feb 14th, 2001, 04:36 PM
One can use FindWindow and GetWindowText to get controls that have windows handles in another application. However lightweight controls, such as label, line, and image, are windowless. Now that in my program I need to look at another running program's label, pick up the value to synchronize with my program. Are there ways to lookup another application's labels control's name and caption with Windows API or any utilities?

Thanks

Ph34R
Feb 14th, 2001, 05:08 PM
I know it is possible, their is a program called Windows Sniper, available at http://www.unhuman.com/

No source code, but if you only need the name of the label and code it staticaly into the code, then this is probly what i would use.

Feb 14th, 2001, 05:19 PM
That depends if the other App is written Vb or C++. It it's written in C++, the control is likely to have a handle because it's probably a Static control.

CCT
Feb 14th, 2001, 05:35 PM
Ph34R, Thanks for the info on Windows Sniper. I downloaed it and tried it. A very neat software. Unfortunately the crosshair icon can not be dragged on top of labels.

Megatron, The external running program was written in VB. The labels appeared no windows handles. I have tried Enumerate windows but found none for labels.

Any other thoughts? Thanks.

Feb 14th, 2001, 05:58 PM
I believe the Labels are drawn via the DrawText function in VB, so I don't think there's a way to retrieve the text.