Recent

Author Topic: RDP viewer in Pascal  (Read 6857 times)

shonay

  • Full Member
  • ***
  • Posts: 169
RDP viewer in Pascal
« on: December 26, 2016, 09:12:34 am »
Hows it going fam?

Please Any ideas on how one can go about Creating a Remote Desktop Viewer in Pascal with Mouse Control.
Any ideas
When the power of love overcomes the love of power, the world would know Peace

- Jimi Hendrix.

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: RDP viewer in Pascal
« Reply #1 on: December 26, 2016, 02:55:04 pm »
I've never done any such thing, so my answer will be very "theoretical".

First you have to make a pair of applications (transmitter and receiver).
Then you have to set up a network link between them. I'd try looking here http://wiki.freepascal.org/Networking
Then you'll have to transfer a full-screen screenshots (e.g. see  http://forum.lazarus.freepascal.org/index.php?topic=18560.0 ) across the network. You'd better optimize the process by compressing difference between the old and new image and sending this compressed stream.
Then you'll have to grab global mouse cursor position and synchronize it between the transmitter form (namely, image displaying the remote desktop) and receiver. I.e. you get the transmitter mouse location, send it to receiver and assign to the global cursor (e.g. see http://forum.lazarus.freepascal.org/index.php/topic,16257.msg87984.html#msg87984).

The "Skeleton" looks pretty simple, but the implementation seems relatively complex to me.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Thaddy

  • Hero Member
  • *****
  • Posts: 16018
  • Censorship about opinions does not belong here.
Re: RDP viewer in Pascal
« Reply #2 on: December 26, 2016, 04:17:50 pm »
Hows it going fam?

Please Any ideas on how one can go about Creating a Remote Desktop Viewer in Pascal with Mouse Control.
Any ideas

Translate X into Pascal. Very doable, very time consuming.
If I smell bad code it usually is bad code and that includes my own code.

avra

  • Hero Member
  • *****
  • Posts: 2530
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

johnsson

  • New Member
  • *
  • Posts: 22
  • Lazarus Rocks
Re: RDP viewer in Pascal
« Reply #4 on: December 28, 2016, 02:15:53 am »
I'm not doing exactly a RDP, but here is a little example of my program running against the ammy.

http://youtu.be/qiQDksOqzmI

I also tested a lot benchmark like team viewer, vnc and others.
The version displayed on video is about 3 years ago.

Btw, it's 100% Lazarus free pascal code.
Just a regular guy

dieselnutjob

  • Full Member
  • ***
  • Posts: 224
Re: RDP viewer in Pascal
« Reply #5 on: November 12, 2018, 02:11:19 pm »
I am looking for some code that I can modify (and re-release open source or whatever) so that I can run a "screen viewer / clicker / keyboard" on one computer (pref Windows) and a computer remote control daemon on another (probably Linux).  The modification I want to make is this:-

I want it to work with no dependance on TCP/IP or layer 3 networking protocol. I want to be able to connect the client to the server over an RS232 null modem or other "serial like" interface.

The reason for this is that it will be useful in environments where security policies do not allow support engineers for example to connect their own laptop to the network of the server, or maybe it is difficult to get on the network as the Ethernet ports are controlled.

Also it would be useful when you want a laptop to do two things at the same time (like home/work) but you can't connect to an internal corporate network and the public Internet at the same time.  This way you could have your corporate laptop on the corporate network and connect a Pi zero to public hotspot and export the screen over USB into a window on the laptop without risking the corporate network security.  You could also monitor your private email / web whatever without your colleagues realising what you are up to :D

Which would be the easiest open source thing that I could mess with in Lazarus/Freepascal to acheive this?

Projects that I am aware of are Checkride and Delphivnc

sulecio

  • Newbie
  • Posts: 1
Re: RDP viewer in Pascal
« Reply #6 on: February 21, 2021, 06:36:08 pm »
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
  activexcontainer, MSTSCLib_1_0_TLB,Registry;

type

  { TForm1 }

  TForm1 = class(TForm)
    ActiveXContainer1: TActiveXContainer;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private

  public

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var
  RDP: TEvsMsRdpClient2;
begin
 RDP:=TEvsMsRdpClient2.Create(self);
 RDP.ComServer.UserName:='';
 RDP.ComServer.Server:='127.0.0.2';
 RDP.ComServer.AdvancedSettings3.RDPPort:=3389;
 RDP.ComServer.Connect;
 ActivexContainer1.ComServer:= RDP.ComServer;
 ActivexContainer1.Active:=true;

end;

end.

ArminLinder

  • Sr. Member
  • ****
  • Posts: 316
  • Keep it simple.
Re: RDP viewer in Pascal
« Reply #7 on: October 05, 2024, 03:28:09 pm »
Hi all,

I wanted to give this a try, but failed to find any trace of MSTSCLib_1_0_TLB and TEvsMsRdpClient2.

Anyone who knows these?

Thnx, Armin.
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

rvk

  • Hero Member
  • *****
  • Posts: 6524
Re: RDP viewer in Pascal
« Reply #8 on: October 05, 2024, 06:18:56 pm »
I wanted to give this a try, but failed to find any trace of MSTSCLib_1_0_TLB and TEvsMsRdpClient2.

Anyone who knows these?
You probably need to create that one yourself.
Seeing the name _TLB it's probably an import of the MSTSCLib library.

You can read how to do that here (via Tools / Import / Type library)
https://wiki.lazarus.freepascal.org/LazActiveX

You can try to import the c:\windows\system32\MSTSC.dll and see what you get.
(I'm not behind a computer to try)

 

TinyPortal © 2005-2018