VB Code:
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 KEYEVENTF_KEYUP = &H2 Private Function SaveFormPic() As Picture Dim pic As StdPicture Set pic = Clipboard.GetData(vbCFBitmap) DoEvents keybd_event vbKeySnapshot, 1, 0, 0 DoEvents Set SaveFormPic = Clipboard.GetData(vbCFBitmap) Clipboard.SetData pic, vbCFBitmap End Function Private Sub Command1_Click() SavePicture SaveFormPic, "C:\MyPic.jpg" 'picture location End Sub
hey guys, the above code works fine but only grabs the active window, how can i make it grab the desktop, thanks!




Reply With Quote