Solved

Get the specific handle form TCurrencyEdit on another program

Posted on 2006-10-20
3
287 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
  • 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

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View Settings Question 15 122
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 75
Delphi...Split view - idea? 1 113
Delphi Seattle StructureView color 1 21
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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