很多人用 SendKeys "{PRTSC}" 模拟截屏键 PrintScreen 的时候提示<错误:‘70‘ 拒绝的权限>,于是经常遇到人问...干脆写下来
‘声明 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) Private Const VK_SNAPSHOT = &H2C ‘截屏 Call keybd_event(VK_SNAPSHOT, 0, 0, 0) ‘设置粘贴板图像为窗体背景 If Clipboard.GetFormat(vbCFBitmap) Then Set Me.Picture = Clipboard.GetData
时间: 2024-10-10 21:46:40