|
-
Dec 7th, 1999, 04:56 AM
#1
Thread Starter
Lively Member
How do I capture the desktop in VB6
Once I have captured it how do I send it over a network?
Thanks Anyone
-
Dec 7th, 1999, 05:33 AM
#2
Member
-
Dec 7th, 1999, 10:49 AM
#3
Hyperactive Member
you mean like print screen and send the bitmap over the network or the actual links and background and all that?
-
Dec 7th, 1999, 04:08 PM
#4
Lively Member
-
Dec 7th, 1999, 04:16 PM
#5
Lively Member
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.
-
Dec 8th, 1999, 03:31 AM
#6
Thread Starter
Lively Member
Yes Capture
No like print screen
Thanks for the link
Thanks for the code
Thanks to all for your interest
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
|