VB Code:
  1. Option Explicit
  2.  
  3. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
  4. ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  5.  
  6. Private Const KEYEVENTF_KEYUP = &H2
  7.  
  8. Private Function SaveFormPic() As Picture
  9.   Dim pic As StdPicture
  10.   Set pic = Clipboard.GetData(vbCFBitmap)
  11.   DoEvents
  12.   keybd_event vbKeySnapshot, 1, 0, 0
  13.   DoEvents
  14.   Set SaveFormPic = Clipboard.GetData(vbCFBitmap)
  15.   Clipboard.SetData pic, vbCFBitmap
  16. End Function
  17.  
  18. Private Sub Command1_Click()
  19.   SavePicture SaveFormPic, "C:\MyPic.jpg" 'picture location
  20. End Sub

hey guys, the above code works fine but only grabs the active window, how can i make it grab the desktop, thanks!