How to capture the screen 
Author Message
 How to capture the screen

I want to know if someone able to capture the screen, I tried to send
the "print screen key" with sendkey, but it's doesn't work.

I want to save the capture in BMP file.



Sat, 17 Mar 2001 03:00:00 GMT  
 How to capture the screen
Try...
http://tips.kbcafe.com/tips/kb.cgi?tips=234
Randy



Quote:
> I want to know if someone able to capture the screen, I tried to send
> the "print screen key" with sendkey, but it's doesn't work.

> I want to save the capture in BMP file.



Mon, 19 Mar 2001 03:00:00 GMT  
 How to capture the screen

Here is an example, have fun

In a module, declare the following functions to do a screen capture

Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As
Long) As Long
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

Then, create a form and place this in the load event:

Private Sub Form_Load()
'this will capture the screen and place it on the form.
Dim i, j, k As Long
Dim w, h As Integer
w = Screen.Width / Screen.TwipsPerPixelX
h = Screen.Height / Screen.TwipsPerPixelY
Me.AutoRedraw = True     'make the form's graphics persistent
Me.Visible = False             ' hide the form so that we can get the screen
behind it
i = GetDesktopWindow()     'get the hwnd of the screen
j = GetDC(i)                         ' get a device context for it
k = BitBlt(Me.hdc, 0, 0, w, h, j, 0, 0, vbSrcCopy) 'bit blit the device
context graphic to the form
k = ReleaseDC(j, i)                            'clean it up
Me.Visible = True                             'show it
End Sub

.



Tue, 20 Mar 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to Capture the Screen and capture and poke keypresses

2. how capture the screen to file

3. Preventing a user from capturing a screen saver image

4. Help, Capturing Console screen with Attributes

5. How can i capture the screen ?

6. Can VBS capture On-Screen Error Msgs?

7. How can I capture the screen picture???

8. How to capture 3270 screen with vb ?

9. How can I capture the screen picture???

10. VB5: Capturing The Screen to BMP

11. How can I capture the screen picture???

12. VB5: Capturing The Screen to BMP

 

 
Powered by phpBB® Forum Software