Click here to Skip to main content
6,595,444 members and growing! (18,684 online)
Email Password   helpLost your password?
General Programming » Internet / Network » General     Intermediate License: The GNU General Public License (GPL)

Remote Control PCs

By Andy Bantly

Two projects that work together to remote control PCs across a LAN
C++ (VC6), Windows, MFC, Dev
Version:10 (See All)
Posted:23 May 2000
Updated:21 Oct 2009
Views:141,989
Bookmarked:105 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
82 votes for this article.
Popularity: 8.11 Rating: 4.24 out of 5
3 votes, 7.0%
1

2
4 votes, 9.3%
3
4 votes, 9.3%
4
32 votes, 74.4%
5

Introduction

Here are the original two projects that work together to remote control PCs across the LAN. The projects work under Windows NT 4.0 and Windows 95 (with proper socket setup). It is not completely stable, but it serves as a learning aid.

Project 1, ServerWindow, is a Microsoft VC 6.0 project that is the Server component.
Project 2, ClientWindow, is a Microsoft VC 6.0 project that is the Client component.

There are many goals of the project:

  1. To show an implementation of sockets version 2.0 programming
  2. To show how to write an object oriented C++ project using the Win 32 SDK
  3. To show how to mix C/C++ source code
  4. To show how to utilize a powerful component of Windows message handling using Message Crackers, in an object oriented environment
  5. To show how to capture a desktop display in a device dependant bitmap (DDB) format and convert it to a device independent bitmap (DIB) format
  6. To show how to implement two types of data compression schemes, in assembly language, that work well for graphics and are very fast
  7. To combine all these aspects together in a project that allows remote controlling of a remote PC

Update

Here is the updated solution that contains two projects that work together to remote control PCs across the LAN. These projects work with Windows XP and above. This is a working system that is a redux of the two articles:

The system relies heavily upon Windows message based processing. At the network layer, CTCPSocket relies on SOCKET events as provided by the O/S and it then forwards them onto the message pump of the window that is expecting those messages. It has operator overloading, using << and >>, for sending and receiving data. The data is described by its own class and is strongly typed. The client captures the keyboard and mouse and deploys it using the API function SendInput. The system takes a simplistic approach to detecting updates in the desktop. It divides the screen into 64 rectangles and uses WM_TIMER to process a single rectangle. It was designed for future integration with a mirror driver; however it does really well on its own, for what it is. The graphics are wrapped up in a class that simplifies the programs boilerplate interaction with the boring aspects of bitmaps. This includes operators that allow you using the variable directly in GDI based functions. I even added in my own take of an adaptive Arithmetic Encoding algorithm. It achieves adaptive status by being a 2 pass algorithm. In the first pass, it generates the frequency table for the symbols. In the second pass, it encodes each symbol and then removes the symbol from the frequency table. This has the effect of always giving the most frequent data the shortest bit width, and that is the nature of an adaptive algorithm. Eventually, I plan on adding in support to make use of the Video For Windows functions of ICImageCompress and ICImageDecompress. The Arithmetic Encoding was the fruit of another effort. If you see my previous articles, then you will know that I like to write compression and decompression routines. In the previous articles, I coded Huffman and RLE as assembly level functions. I stopped my assembly work when 64 bit compilers stopped supporting inline assembly :(. There is no support for those previous compressors, though they are faster. I also don't have the time to write in assembler anymore and I never was anything more than just dangerous with it.  

I hope you enjoy reading the source code as much as I have enjoyed writing it. The code should be easy on the eyes; I strive for simplistic code. I don't subscribe to the hard to write / hard to read philosophy.  

* Disclaimer: I have never put much effort into the proper use of the C++ keywords public, private, protected, friend, and const.  If you are personally offended by my stylistic approach or believe that I should make proper use of these keywords, please present your thoughts as constructional criticism.  :)  

History

  • 20th October, 2009:
    • This update adds MDI support to the system. The client component can now make multiple connections to many servers.
  • 17th October, 2009: Source code updated
    • The server now supports multiple monitor configurations. It captures the entire “virtual desktop”. Previously it only captured the primary desktop.
  • 9th October, 2009: Source code update that addresses three issues:
    • Binaries are added to the ZIP, in the Target Directory, for people to try out the system immediately
    • Receiving data is faster now
    • Experimental support for Video for Windows ICImageCompress and ICImageDecompress has been added
  • 14th September, 2009:
    • Updated to use a multithreaded arithmetic encoder. It uses 4 threads to concurrently encode the DIB data. It previously was just single threaded. It improves compression by about 40%.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPL)

About the Author

Andy Bantly


Member

Location: United States United States

Other popular Internet / Network articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 62 (Total in Forum: 62) (Refresh)FirstPrevNext
GeneralUpdate to the article PinmemberAndy Bantly11:52 5 Oct '09  
GeneralRe: Update to the article Pinmemberaspdotnetdev13:43 14 Oct '09  
GeneralRe: Update to the article PinmemberAndy Bantly18:36 14 Oct '09  
GeneralRe: Update to the article Pinmemberaspdotnetdev18:39 14 Oct '09  
GeneralModern Update to the Remote Control System Pinmemberandybantly5:36 4 Oct '09  
GeneralRe: Modern Update to the Remote Control System PinmemberHari Om Prakash Sharma20:12 15 Oct '09  
GeneralRe: Modern Update to the Remote Control System PinmemberAndy Bantly3:07 16 Oct '09  
GeneralMy vote of 1 Pinmembergzlonghair0:40 25 May '09  
QuestionHow to apply IME...? Pinmemberlayus23:19 22 Apr '09  
General[Message Deleted] Pinmemberit.ragester23:00 2 Apr '09  
Generalthank you for Andy Bantly Pinmemberhenry369522:22 18 Nov '08  
GeneralDoes it work on XP ? Pinmembergndnet17:39 20 Apr '08  
GeneralRe: Does it work on XP ? Pinmemberwyb28725:44 8 Jun '08  
GeneralRe: Does it work on XP ? Pinmemberhenry369522:16 18 Nov '08  
Questionhow to get copy file from another node..? PinmemberKhathar1:36 7 May '07  
GeneralReally amazing! Can you give me a copy of the project comment document? PinmemberSuperChen111120:36 30 Jan '07  
GeneralRe: Really amazing! Can you give me a copy of the project comment document? Pinmemberhenry369522:18 18 Nov '08  
QuestionRemote PC Pinmemberhan qiao16:20 17 Jan '07  
QuestionDll Convert PinmemberCode_Warrior3:56 4 Dec '06  
Generalshouldn't this be in the Free Tools section? PinmemberMihai Moga2:02 17 Apr '06  
GeneralCan anyone help me? PinmemberPetiao15:56 23 Feb '06  
Generalthx for sharing!! PinmemberPetiao16:18 22 Feb '06  
GeneralReally amazing PinmemberLaxman923:33 16 Jan '06  
GeneralVery Nice Work Andy - One question PinmemberSwelborn7:39 20 Oct '05  
GeneralCAN YOU HELP ME Pinmember_REU_12:59 24 Jun '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 21 Oct 2009
Editor: Deeksha Shenoy
Copyright 2000 by Andy Bantly
Everything else Copyright © CodeProject, 1999-2009
Web17 | Advertise on the Code Project