0

How do I to get the full control of a remote computer which I know his open port number and his IP address using C++ ?

I know that I need to establish a socket connection between these two computers which I've already done. But, how to get the remote computer's screen image dynamically which gives me a live watch of what is happening?

I'm just looking for what do I need to know to deal this.

PS: I'm trying to implement this solution, I know that there is many softwares whom deal this.

OS: Windows 7 SP1.

Lucie kulza
  • 1,357
  • 6
  • 20
  • 31
  • Do you want to write yet another RDP client software or reinvent both the server _and_ the client side? – moooeeeep Mar 27 '14 at 08:09
  • @moooeeeep, both of them. – Lucie kulza Mar 27 '14 at 08:10
  • 1
    Then you probably should rather take one step at a time. During that process you can raise questions when you face a specific problem you can't solve on your own. In it's current form this question really is too broad, in my opinion. – moooeeeep Mar 27 '14 at 08:15

2 Answers2

1

If you want to just see the remote computer's screen, you can take screen captures by instructions from Here or Here.

Next you should send data of bitmap pointing by a pointer like ULONG *pBitmap over network. You can put a header before each frame data and a footer after that. In the receiving side you can detect each frame packet by headers and footers ensuring that each frame data is received completely.

After receiving a frame you should display it by whatever GUI framework you are using.

Community
  • 1
  • 1
Nejat
  • 31,784
  • 12
  • 106
  • 138
0

This is quite complex. Things like "Remote Desktop" will implement a virtual screen driver, virtual keyboard driver and virtual mouse driver. The virtual driver then does the packaging of what is going on (when enabled) and sends the data to the local computer, which has code to redraw the remote machine's graphics. The local machine on the other hand (assuming you want to control the remote machine) will send keypresses and mouse movement to the remote machine to allow control. These will be picked up by the remote machine's virtual keyboard and mouse drivers and entered into the system as if they were "real" keyboard and mouse movements.

You could do a very simple version by simply doing a screengrab and sending the data from that to your local machine over the network. You may want to do some sort of "compare this image with the before one, only send what changed" to avoid too much data across the network. One of many answers about screen shots here on SO: How can I take a screenshot and save it as JPEG on Windows?

And there are interfaces to send keyboard and mouse events to the system, such as what is described here: http://msdn.microsoft.com/en-us/library/ms171548%28v=vs.110%29.aspx

Community
  • 1
  • 1
Mats Petersson
  • 126,704
  • 14
  • 140
  • 227