Вниз
Скачать: 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.013 c
6-24599
Shluz
2003-06-27 20:41
2003.09.08
SMS своими руками ...


1-24409
Sfagnum
2003-08-25 17:21
2003.09.08
не получаеться обратиться к массиву


14-24646
SerVel
2003-08-21 18:33
2003.09.08
interrupt


1-24421
MadGhost
2003-08-26 07:46
2003.09.08
Memo1 продолжение работы.


3-24304
Sirus
2003-08-19 07:31
2003.09.08
Что лучше делать: увеличивать количество записей или ???




   Наверх