
21.10.2010, 11:34
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
h: THandle;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
h:=CreateWindow('EDIT', 'bla', WS_CHILD, 10, 10, 100, 20, Handle, 0, HInstance, nil);
// lpWindowName: PChar = bla
ShowWindow(h, SW_SHOW);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
buf: array [0..$ff] of Char;
l: Integer;
begin
l:=GetWindowText(h, buf, $100);
Edit1.Text:=Copy(buf, 1, l); // = bla
end;
end.
__________________
Пишу программы за еду.
__________________
|