death
Dec 7th, 1999, 03:56 AM
How do I capture the desktop in VB6
Once I have captured it how do I send it over a network?
Thanks Anyone
Bob Baddeley
Dec 7th, 1999, 09:49 AM
you mean like print screen and send the bitmap over the network or the actual links and background and all that?
ycsim
Dec 7th, 1999, 03:08 PM
Goto to this link
http://www.vb-world.net/tips/tip101.html
SteveS
Dec 7th, 1999, 03:16 PM
Firstly you must get the hDC of the Desktop by using the following functions.
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Then to capture the Desktop, use BitBlt
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Long) As Integer
Usage:
Create a New Project
Paste in the 3 Declartions (Private if in Form Level Code)
Add 1 Picture Box
Add the following Sub
Private Sub Form_Load()
Dim DeskhWnd As Long, DeskDC As Long
'Get the hWnd of the desktop
DeskhWnd& = GetDesktopWindow()
'Get the hDC of the desktop
DeskDC& = GetDC(DeskhWnd&)
BitBlt Picture1.hDC, 0&, 0&, Screen.Width, Screen.Height, DeskDC&, 0&, 0&, SRCCOPY
End Sub
That's it, you should now have the Desktop copied into the PictureBox.
Hope this helps,
Steve.
death
Dec 8th, 1999, 02:31 AM
Yes Capture
No like print screen
Thanks for the link
Thanks for the code
Thanks to all for your interest