в общем есть 2 проги. вот исходник первой:
PHP код:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(Edit1.Text);
end;
end.
а вот исходник второй:
PHP код:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
var
HndControl, HndControl1 :HWnd;
StrClass :PChar;
StrBase :string;
begin
HndControl := FindWindow(nil, 'Proxy Hunter');
if (HndControl <> 0) then
begin
StrClass:='Edit1'; //Edit тоже пробовал - нифига
HndControl1:=FindWindowEx(HndControl, 0, StrClass,'');
if (HndControl1 <> 0) then
begin
StrBase:='Hello, World!';
Sleep(1000);
SEndMessage(HndControl1, WM_Settext,0,Integer(StrBase));
end else ShowMessage('Id not found!');
end
else ShowMessage('Window has not found!');
end;
end.
как видно из исходников, 2я прога должна найти окно 1й, и ввести в Edit1 текст. Окно она находит, а Эдит почему-то не может
помогите плз разобраццо!