VB中一个非常简单的截屏代码

发表于:2007-06-21来源:作者:点击数: 标签:

   

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const theScreen = 1
Const theForm = 0

Private Sub Command1_Click()

   Call keybd_event(vbKeySnapshot, theForm, 0, 0)
   '若theForm改成theScreen则Copy整个Screen
   DoEvents
   Picture1.Picture = Clipboard.GetData(vbCFBitmap)
End Sub

原文转自:http://www.ltesting.net