Solved

Read a label caption in another application

Posted on 2006-10-19
5
473 Views
Last Modified: 2010-04-04
I need to read a caption of a label in another application.

How can I do this?

Thanks.

Felipe.
0
Comment
Question by:felipesch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17765866
you should be able to adapt the following code to work for tlabel without much hassle: http://www.delphi3000.com/articles/article_3067.asp (free registration recuired)
you should also follow the recommendations from the comments and use ChildWindowFromPoint if teh label is inside another control.
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 17766199
If you  download WinHandles.zip you will have a sample application with all source code that allows you to get all text from most any component, button, edit or whatever in another application whether written in Delphi or not. Check out the code, run the sample and you can see how this is done!

Here is the location:

ftp://jcitssystems.com/pub/DelphiExamples/WinHandles.zip

A bit advanced.

JJ
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 500 total points
ID: 17766537
TLabel is a NON-WINDOWED control, ie no HWND. So what you guys are posting isn't going to fly.....

Regards,
Russell
0
 
LVL 28

Expert Comment

by:2266180
ID: 17768343
you know russel, now that you posted that it hit me and really hard. because tell you the truth, the first thing I wanted to write is that TLabel is a windowed control and so you can use blabla functions and then I thought I'd better just google something up.
what was is my mind at that time is beyond me...
0
 
LVL 28

Expert Comment

by:TName
ID: 17770192
Felipe, did you write the other application yourself or can you make changes to it?
If yes, you could replace the label (e.g. with a TStaticText control which is a windowed control) , and then the mentioned methods would apply.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month3 days, 13 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question