Embarcadero findwindow Chrome

319 views Asked by At

I want to copy some selected text from Chrome screen by clicking on a button on a Delphi program. I know I can do it with a code like this but I can't do it for Chrome cause I can't find the name for Chrome. Can anyone tell me how to do that on Chrome as I preselect some parts of text on Chrome? The code I ty is this:

procedure TForm1.Button1Click(Sender: TObject);
var
NpWnd, NpEdit: HWnd;

begin
Memo1.Clear;
NpWnd := FindWindow('Notepad', nil);
if NpWnd <> 0 then
begin
  NpEdit := FindWindowEx(NpWnd, 0, 'Edit', nil);
  if NpEdit <> 0 then
  begin
  SendMessage(NpEdit, WM_COPY, 0, 0);
  Memo1.Text := Clipboard.AsText;
end;
end;
end;

Thanks in advance Ali Murat

0

There are 0 answers