使用delphi能否获取其他软件程序中memo控件中的数据?

2025-02-22 16:17:02
推荐回答(2个)
回答1:

//给你个简单的例子

procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

var

    m_Point :  TPoint;

    winhwnd : hwnd;

      nmancount,ch :array[0..255] of char;

      textLength : integer;

    i : integer;

begin

    if Button = mbLeft then

    begin

        GetCursorPos(m_Point);

        winhwnd:=WindowFromPoint(m_Point);

        edit3.Text := inttostr(winhwnd) ;

        //Button1.Cursor := crDefault;

        GetClassName(winhwnd,@nmancount,256);

        edit1.Text := string(nmancount);

        textLength := getwindowtextLength(winhwnd);

        getwindowtext(winhwnd,@ch,256);

        edit2.Text := string(ch);

    end;

end;

回答2:

这个应该是可以。