Results 1 to 2 of 2

Thread: Help Me

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    4

    Unhappy Help Me


    Could some one tell me how to capture the contents of the screen. Is there an API or some OCX or anything??

  2. #2
    Matthew Gates
    Guest
    Try this:


    Code:
    'Author: Dalin Nie (Edited by Matthew Gates)
    'Origin: http://www.vbcode.com
    'Purpose: This function capture the screen or the active window of your computer.  Programmatically and save it to a .bmp file.
    'VB version: VB 6,VB 5,VB 4/32
    
    
    Private Declare Sub keybd_event Lib "user32" (ByVal _
    bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As _
    Long, ByVal dwExtraInfo As Long)
    
    Private Const VK_SNAPSHOT = &H2C
    
    Private Function SaveScreen(ByVal theFile As String) As Boolean
    On Error Resume Next
    
        'To Get the Entire Screen
        Call keybd_event(vbKeySnapshot, 1, 0, 0)
    
        'To get the Active Window
        'Call keybd_event(vbKeySnapshot, 0, 0, 0)
    
        SavePicture Clipboard.GetData(vbCFBitmap), theFile
    
    SaveScreen = True
    Exit Function
    End Function
    
    
    Usage
    
    
    Call SaveScreen("C:\Windows\Desktop\shot1.bmp")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width