![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
wm_GetText ???
maxistent © (2004-10-09 18:13:00)Люди, привет! Кто знает, как использовать wm_GetText? Там нужны какие-то указатели... SendMessage(MyHandle, wm_GetText, ?, ?) :(
DVM (2004-10-10 22:50:00) [1]function GetTextFromWindow(hWnd: HWND): string;
var
TextLength: Integer;
Text: PChar;
begin
TextLength := SendMessage(hWnd, WM_GETTEXTLENGTH, 0, 0);
if TextLength = 0 then Result := ''
else
begin
GetMem(Text, TextLength + 1);
SendMessage(hWnd, WM_GETTEXT, TextLength + 1, longint(Text));
Result := Text;
FreeMem(Text);
end;
end; // End of function GetTextFromWindow
maxistent (2004-10-10 19:09:00) [2]А-а-а... понятно. Спасибо.
GuAV (2004-10-10 16:45:00) [3]WM_GETTEXT
wParam = (WPARAM) cchTextMax; // number of characters to copy
lParam = (LPARAM) lpszText; // address of buffer for text
maxistent (2004-10-10 16:42:00) [4]после этого:
procedure TForm1.Button1Click(Sender: TObject);
var
textbuffer : PChar;
begin
GetMem(textbuffer, 5);
SendMessage(MyHandle, WM_GETTEXT, 0, Longint(textbuffer));
Form1.Caption:=StrPas(TextBuffer);
end;
у Формы в заголовке закорючки какие-то... Как быть?
XProger (2004-10-09 21:36:00) [5]
var
textbuffer : PChar;
....
GetMem(textbuffer, TEXTBUFFERSIZE);
SendMessage(MemoHandle, WM_GETTEXT, 0, Longint(textbuffer));