|
-
Aug 27th, 2001, 01:24 PM
#1
Thread Starter
New Member
Need help with Visual stuff
Hi!
I'm currently working on a small app so that I can remote control my home PC from my school or from a friend. Now the problem is that I want to be able to have my desktop in a window and remotly control the Mouse and Keyboard, and I can't send screenshots all the time, because it would take too long time to send. I want to send only the little piece that changes on the screen i.e. the piece where a window that I closed/moved/minimized was, so the unchanged part of the screen does not have to be send again.
How do I do this? Is it possible? Could it be done fast?
It would be very slow to take a screenshot and compare to a previous, remove the differance, take the new piece and send it. It would take a long time for the PC to process the data. Take and read a screenshot doesn't take a few milliseconds exactly. It takes about a second.
Is there any fast way to do this?
-
Aug 28th, 2001, 12:46 PM
#2
Frenzied Member
I know its possible to do, because Timbuktu Pro does it; but I'm not sure how its being done. I'm going to go research that real quick; brb
-
Aug 28th, 2001, 01:18 PM
#3
Frenzied Member
Here's what you need to do.
In the remote control form, add a picturebox control. Make sure its scalemode property is set to pixels and autoredraw is true. I will call this form the destination.
In a small form on your computer, have a picture box with a height and width equal to the screen resolution of your computer's monitor, say 800 by 600 pixels. Make sure its autoredraw is true, its visible is false, and its scalemode is pixels.
I will call this form the source.
In the source form's Declarations section, add this code:
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public img As stdpicture
Add a timer to the source form. Set its Interval property to 20. In its Timer event, write the following code:
BitBlt Picture1.hDC, 0, 0, 500, 500, GetDC(GetDesktopWindow()), 0, 0, vbSrcCopy
Set img = Picture1.Image
Now on the destination form, have a timer or button or something that will refresh the display. In there, write this code:
Picture1.PaintPicture img, 1, 1, 500, 500, 1, 1, 500, 500, vbSrcCopy
Now you will need to use some method to get the img object from the source project to the destination e.g. a class or something, but I assume you already have something like that working.
Have fun!
NOTE: this MAY not work. Its just a gamble.
-
Aug 28th, 2001, 01:39 PM
#4
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|