Вниз
Скачать: CL | DM;

Почему не копируется текст edit-ов др.окна   Найти похожие ветки 

 
mox ©   (2003-07-08 11:45) [0]

procedure TForm1.Button1Click(Sender: TObject);
const
T1 = "WindowText";
var
Wnd: HWND;
Control: array [0..127] of char;
text1,text2: string;

procedure TypeTextIntoNextEdit(AText:string);
begin
repeat
Wnd := GetWindow(Wnd, GW_HWNDNEXT);
GetClassName(Wnd, Control, SizeOf(Control))
until Control = "Edit";
SendMessage(Wnd, WM_GETTEXT, 0, Integer(PChar(AText)));
end;

begin
Wnd := FindWindow(nil, T1);
Wnd := GetWindow(Wnd, GW_CHILD);
TypeTextIntoNextEdit(text1); ( text2) procedure TForm1.Button1Click(Sender: TObject);
const
T1 = "WindowText";
var
Wnd: HWND;
Control: array [0..127] of char;
text1,text2: string;

procedure TypeTextIntoNextEdit(AText:string);
begin
repeat
Wnd := GetWindow(Wnd, GW_HWNDNEXT);
GetClassName(Wnd, Control, SizeOf(Control))
until Control = "Edit";
SendMessage(Wnd, WM_GETTEXT, 0, Integer(PChar(AText)));
end;

begin
Wnd := FindWindow(nil, T1);
Wnd := GetWindow(Wnd, GW_CHILD);
TypeTextIntoNextEdit(text1);
TypeTextIntoNextEdit(text2) ;
form1.Caption:=text1+text2;
end;


 
Poirot ©   (2003-07-08 11:54) [1]

Use debug! step-by-step!


 
8UnG   (2003-07-08 17:03) [2]

Функция GetWindowText

Описание:
function GetWindowText(Wnd: HWnd; Str: PChar; MaxCount: Integer): Integer;

Копиpует в Str заголовок окна или текст оpгана упpавления.

Паpаметpы:
Wnd: Идентификатоp окна или оpгана упpавления.
Str: Буфеp, пpинимающий стpоку.
MaxCount: Размеp буфеpа Str.

Возвpащаемое значение:
Фактическое число скопиpованных байт или 0, если текст отсутствует.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.012 c
3-24350
Алексей Петухов
2003-08-17 12:23
2003.09.08
Insufficient memory for this operation


1-24455
ossa
2003-08-22 09:58
2003.09.08
Есть аналог static(си++) на дельфи, нужно чтоб при запуски


8-24561
LK
2003-05-12 16:26
2003.09.08
Midi API


3-24314
muzzzy
2003-08-05 14:29
2003.09.08
oracle руские буковки непоказывает


3-24309
Suharew
2003-08-19 13:05
2003.09.08
Query1.Locate




   Наверх