Solved

Read a label caption in another application

Posted on 2006-10-19
5
451 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
creating manifest for my dll that called from activex 6 99
Delphi XE10, MySQL Query 4 126
find a node in VST 2 63
DBGrid or StringGrid ? 6 70
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now