Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.09.08;
Скачать: 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 вся ветка

Текущий архив: 2003.09.08;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.015 c
1-24405
PaveL
2003-08-27 13:26
2003.09.08
CheckBox в таблице


3-24300
Nikkkkk
2003-08-19 10:28
2003.09.08
Быстрый поиск при помощи TTable


14-24644
Kost
2003-08-20 15:57
2003.09.08
Циклы


1-24475
strimmer
2003-08-27 20:04
2003.09.08
Программа остается в памяти!


1-24518
3APA3A
2003-08-27 01:24
2003.09.08
В чем разница?