Results 1 to 3 of 3

Thread: Print Screen

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    Print Screen

    Hi guys, is there a way to possibly take images of the screen by the button Print Screen every 0.5 seconds and save it as an image file (any image file) in a specific folder. Please reply.
    Khanjan
    Hey... If you found this post helpful please rate it.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Print Screen

    Put a timer on your form and set it to the internval that you desire. This will take a screen shot of your screen and save it to a bitmap file with each file having its own individual timestamp.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
    4. ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    5.  
    6. Private Const VK_SNAPSHOT = &H2C
    7.  
    8. 'Author: Dalin Nie (Edited by Matthew Gates)
    9. 'Origin: [url]http://www.vbcode.com[/url]
    10. 'Purpose: This function capture the screen or the active window of your
    11. 'computer. Programmatically and save it to a .bmp file.
    12. 'VB version: VB 6,VB 5,VB 4/32
    13. 'Save Screen As Bitmap
    14. Private Function SaveScreen(ByVal pstrFileName As String) As Boolean
    15.  
    16. 'To get the Entire Screen
    17. Call keybd_event(vbKeySnapshot, 1, 0, 0)
    18.  
    19. 'To get the Active Window
    20. 'Call keybd_event(vbKeySnapshot, 0, 0, 0)
    21.  
    22. SavePicture Clipboard.GetData(vbCFBitmap), pstrFileName
    23.  
    24. SaveScreen = True
    25.  
    26. End Function
    27.  
    28. Private Sub Timer1_Timer()
    29. Call SaveScreen("C:\MyFolder\Screenshot" & Format(Now, "hhmmss") & ".bmp")
    30. End Sub

  3. #3
    New Member
    Join Date
    Apr 2009
    Posts
    7

    Re: Print Screen

    Please help!!!!! When I use this code in excel base vb in my remote desktop - its not capturing the image , but opening a popup window that gives the save as option. Another messeg window comes along stating "Printing the screen print to Microsoft office document Image writer on Ne00. - A product of american system.'

    please help. the code I used for taking screen shot is as follows:



    Option Explicit 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 sub commandbutton_click()

    Call keybd_event(vbKeySnapshot, 1, 0, 0)


    End sub

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