Results 1 to 3 of 3

Thread: Api for Print Screen

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Location
    india
    Posts
    108

    Api for Print Screen

    any specific Api for Print Screen Button ..... Help me..

    i want to take Snapshot of screeen.
    Anand Thakur

  2. #2
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    This is a frequent question

    Last edited by Olly; Dec 8th, 2001 at 06:37 PM.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
    2. ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    3.  
    4. Private Const VK_SNAPSHOT = &H2C
    5.  
    6. 'Author: Dalin Nie (Edited by Matthew Gates)
    7. 'Origin: [url]http://www.vbcode.com[/url]
    8. 'Purpose: This function capture the screen or the active window of your computer. Programmatically and save it to a .bmp file.
    9. 'VB version: VB 6,VB 5,VB 4/32
    10. 'Save Screen As Bitmap
    11. Private Function SaveScreen(ByVal theFile As String) As Boolean
    12. On Error Resume Next
    13.  
    14. 'To get the Entire Screen
    15. Call keybd_event(vbKeySnapshot, 1, 0, 0)
    16.  
    17. 'To get the Active Window
    18. 'Call keybd_event(vbKeySnapshot, 0, 0, 0)
    19.  
    20. SavePicture Clipboard.GetData(vbCFBitmap), theFile
    21.  
    22. SaveScreen = True
    23. Exit Function
    24. End Function
    25. 'Usage
    26. 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