Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Dim a
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
On Error Resume Next
MkDir "d:\zt" '建文件夹
Me.AutoRedraw = True
End Sub
Private Sub Timer1_Timer()
a = a + 1
If a = 3 Then '三秒后开始抓屏
Me.Hide
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, _
GetDC(GetActiveWindow), 0, 0, vbSrcCopy '抓屏
Me.Show
Dim sFile As String
sFile = "d:\zt\" &Format(Now, "yyyymmddhhmmss") &".BMP"
SavePicture Me.Image, sFile '保存Me.hDC
Timer1.Enabled = False
End If
End Sub
按键盘上的“Print Screen SysRq”按键可以“截全屏”,如果同时按住ALT键,是截当前激活的单个程序对话框,即“截当前窗口”。具体 *** 作:
1打开画图工具,"开始"-程序-附件-画图
2任何时候需要截图时,按键盘上的“Print Screen SysRq”按键可以“截全屏
”,如果要截当前窗口,还需要同时按住ALT键,是截当前激活的单个对话框。
3打开画图工具,将刚才截到的图“粘贴”至画图工具中,可以同时按"Ctrl"和"V"键粘贴。
4如果善用画图工具,可以“切割”出你自己想要的部分,即“只取一部分截图”,保存为各种格式的图片文件。
注意:“切割”工具,画图工具左上角最顶端的“方框”。
还有一种比较高难的:按键盘上的“Print Screen SysRq”按键,同时按住ALT键,同时按下鼠标右键,可以截取“当前激活的窗口+右键菜单”。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)