Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button1Click(Sender: TObject);
- var
- WndHandle: HWND;
- TextValue: string;
- TextLenght: Integer;
- begin
- WndHandle := FindWindowHandleByTitle('Notepad');
- TextLenght := SendMessage(WndHandle, WM_GETTEXTLENGTH, 0, 0);
- if TextLenght > 0 then
- begin
- SetLength(TextValue, TextLenght);
- TextLenght := SendMessage(WndHandle, WM_GETTEXT, TextLenght + 1, LPARAM(PChar(TextValue)));
- SetLength(TextValue, TextLenght);
- Memo1.Text := TextValue;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment