' send a print screen button keypress event ' and DoEvents to allow windows time to process ' the event and capture the image to the clipboard keybd_event vbKeySnapshot, 0, 0, 0 DoEvents
' send a print screen button up event keybd_event vbKeySnapshot, 0, &H2, 0 DoEvents DoEvents
' paste the clipboard contents into the picture box ScreenCapture.Picture = Clipboard.GetData(vbCFBitmap) DoEvents DoEvents
' show the form and change the pointer to an ' hourglass while the image is processed Me.Visible = True Me.Refresh
' Screen.MousePointer = vbHourglass
' save the image to a file using the application path SavePicture ScreenCapture.Picture, App.path & "\screen.bmp" DoEvents
değişken tanımlamaya da şunu yazıyoruz;
Private Declare Sub keybd_event Lib "user32" Alias "keybd_event" ( _ ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long)
burda ScreenCapture bir picture nesnesidir. ben bu nesnenin visible özelliğini false yapıyorum ve tüm ekranı bir dosyaya atıyorum...