May 17th, 2000, 07:24 AM
I'm making a program to control/monitor another computer over a network because I use two computers while programming at school sometimes, and don't want to have to move from computer to computer. I have most of the code done, and the rest is just a matter of when I get around to it. But their is to two things I need help with. Here is the first:
1) I use this code to capture the screen image:
Private Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName$, ByVal lpDeviceName$, ByVal lpOutput$, ByVal lpInitData&)
Private Declare Function DeleteDC& Lib "gdi32" (ByVal hDC&)
Private Declare Function StretchBlt& Lib "gdi32" (ByVal hDestDC&, ByVal x&, ByVal Y&, ByVal nWidth&, ByVal nHeight&, ByVal hSrcDC&, ByVal XSrc&, ByVal YSrc&, ByVal nSrcWidth&, ByVal nSrcHeight&, ByVal dwRop&)
Sub CopyScreen(canvas As Object)
Dim screendc&
canvas.AutoRedraw = True
screendc = CreateDC("DISPLAY", "", "", 0&)
templong = StretchBlt(canvas.hDC, 0, 0, canvas.Width, canvas.Height, screendc, 0, 0, Screen.Width, Screen.Height, &HCC0020)
templong = DeleteDC(screendc)
canvas.AutoRedraw = False
End Sub
This code works great because it is fast, but how do I transfer the image over winsock, I'll probably need to convert it to a string, then back, but I don't want to have to save it to the hard drive.
2) SendKeys works fine for sending Text, but what if I want to send other keys to the computer, like F1, or Page Up, etc?
1) I use this code to capture the screen image:
Private Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName$, ByVal lpDeviceName$, ByVal lpOutput$, ByVal lpInitData&)
Private Declare Function DeleteDC& Lib "gdi32" (ByVal hDC&)
Private Declare Function StretchBlt& Lib "gdi32" (ByVal hDestDC&, ByVal x&, ByVal Y&, ByVal nWidth&, ByVal nHeight&, ByVal hSrcDC&, ByVal XSrc&, ByVal YSrc&, ByVal nSrcWidth&, ByVal nSrcHeight&, ByVal dwRop&)
Sub CopyScreen(canvas As Object)
Dim screendc&
canvas.AutoRedraw = True
screendc = CreateDC("DISPLAY", "", "", 0&)
templong = StretchBlt(canvas.hDC, 0, 0, canvas.Width, canvas.Height, screendc, 0, 0, Screen.Width, Screen.Height, &HCC0020)
templong = DeleteDC(screendc)
canvas.AutoRedraw = False
End Sub
This code works great because it is fast, but how do I transfer the image over winsock, I'll probably need to convert it to a string, then back, but I don't want to have to save it to the hard drive.
2) SendKeys works fine for sending Text, but what if I want to send other keys to the computer, like F1, or Page Up, etc?