Solved

Get the specific handle form TCurrencyEdit on another program

Posted on 2006-10-20
3
289 Views
Last Modified: 2010-04-05
How can I do to get the specific handle of TCurrencyEdit on another program?

I need this handle, to use the message WM_GETTEXT to retrieve your content.

I found many examples in the web, but all lists all the windows handles, an I need to retrieve the specific handle of TCurrencyEdit.

Any idea?
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
  • 2
3 Comments
 
LVL 28

Assisted Solution

by:TName
TName earned 500 total points
ID: 17775144
Hi, have you tried something like this?

procedure TForm1.Button1Click(Sender: TObject);
var
hForm, hEdit :HWND;
begin
 hForm:=FindWindow(nil,'TestApp');
 if hForm<>0 then begin
   hEdit := FindWindowEx(hForm, 0, 'TCurrencyEdit', nil);
   if hEdit<>0 then
      ShowMessage('Found!');
 end;
end;

'TestApp' is of course your other's application's window title.
0
 

Author Comment

by:felipesch
ID: 17775201
Oks, but the window has 3 TCurrencyEdits! How can I know what the TCurrencyEdit Handle are returned by function?
0
 
LVL 28

Accepted Solution

by:
TName earned 500 total points
ID: 17775377
procedure TForm1.Button1Click(Sender: TObject);
var
hForm, hEdit :HWND;
len,i:Integer;
aText: String;
begin
 hForm:=FindWindow(nil,'TestApp');
 if hForm<>0 then begin
   hEdit := FindWindowEx(hForm, 0, 'TCurrencyEdit', 'CurrencyEdit2');
   if hEdit<>0 then begin
      len := SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0)+1;
      SetLength(aText,len);
      SendMessage(hEdit, WM_GETTEXT, Len, longint(aText));
      ShowMessage(aText);
     end;
 end;
end;

Where CurrencyEdit2 is the Name of the edit you_re looking for.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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