Remote PC Control
A while back I wrote a program to take control of a remote computer (sort of like "PC Anywhere"). The server just allowed a client to connect and had a simple dialog. The client had a fullscreen dialog and within the window, I drew the screen that the server had visible. The part I never completed was the actual remote control.
I planned on allowing a client move over the server screen to move the servers cursor, and other such stuff.
Anyway, the problem I was unable to overcome and forced me to desert the project is the time it takes to capture the screen and send it to the client.
I tried many things to speed up the process, but I couldn't figure a way to do it. There must be a quick way somehow...
When I abandoned it, the program was doing this:
-every 1 second server captures the screen to a DIB (using DibLib)
-then it is converted to jpeg (using jpeglib) because the DIB is massive in size (actually the jpeg is still many kB as I remember)
-then it is compressed (using zlib)
-then it is sent (via a socket of course) to the client where it is decompressed, converted from jpg->dib, then painted to the screen
It may seem like overkill, but I really was trying everything I could to speed up the process. As you can imagine, doing all this didn't speed things up much and all those steps once a second isn't very useful.
Any tips you can offer will be greatly appreciated. With any luck someone can give me good enough info that I can work on the project again. Otherwise, *shrugs shoulders with palms facing up* eh.
Instead of sending the hole screen capture, just send the changes or differences. i.e. if part of the screen is updated since the last capture send the rect of that part of the screen etc...
You could try sub classing all windows on the desktop and intercept the WM_PAINT's and keep a record of coordinates of the rectangle that encloses the update region's etc... Then capture and send only the retangle bitmaps after the region is painted.
Or you could study the VncViewer code
That is a very good idea Scarlet.. A good fresh thought I wasn't able to come up with on my own...
I have never heard of realvnc before, knutso.. I was pleasantly surprised to find what that link has to offer.
Thanks much to both of you. Much obliged.