Results 1 to 2 of 2

Thread: print screen in windows 2000

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    INDIANA
    Posts
    43

    print screen in windows 2000

    What is the api call to print screen? The old api I used on winnt does not seem to work.

    Thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Try this
    VB Code:
    1. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    2. Private Const VK_MENU As Byte = &H12
    3. Private Const VK_SNAPSHOT As Byte = &H2C
    4. Private Const KEYEVENTF_KEYUP = &H2
    5.  
    6. Private Sub cmdPrintScreen_Click()
    7. Dim lHeight As Long
    8.     Clipboard.Clear
    9.     Call keybd_event(VK_SNAPSHOT, 1, 0, 0)
    10.     DoEvents
    11.     Call keybd_event(VK_SNAPSHOT, 1, KEYEVENTF_KEYUP, 0)
    12.     Printer.Print
    13.     lHeight = (Printer.ScaleWidth / Screen.Width) * Screen.Height
    14.     Printer.PaintPicture Clipboard.GetData, 0, 0, Printer.ScaleWidth, lHeight
    15.     Printer.EndDoc
    16. 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