Главная страница
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.02 c
8-24556
Anat
2003-05-11 00:20
2003.09.08
Подскажите как копию рабочего стола преобразовать в BMP


14-24697
Viktor Kushnir
2003-08-17 08:34
2003.09.08
Большая печать


3-24307
Dush
2003-08-18 16:16
2003.09.08
Помогите со структурой таблицы


1-24495
servs
2003-08-22 18:59
2003.09.08
Глобальный отлов exception


1-24481
DelphiNew
2003-08-27 13:31
2003.09.08
Error