Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM 2 files follow
- REM PrintScreen.bat
- REM This file compiles PrintScreen.vb to PrintScreen.exe using the system VB.NET compiler.
- REM Simulates pressing the printscreen key which Basic's SendKeys cannot do.
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\PrintScreen.vb" /out:"%~dp0\PrintScreen.exe" /target:winexe
- pause
- -------------------------------------------------
- 'PrintScreen.vb
- Imports System.Runtime.InteropServices
- Imports System.Windows.Forms
- Public Module SendPrtScnKey
- Const KEYEVENTF_KEYDOWN As Integer = &H0
- Const KEYEVENTF_KEYUP As Integer = &H2
- Declare Sub keybd_event Lib "User32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As UInteger, ByVal dwExtraInfo As UInteger)
- Public Sub Main()
- keybd_event(CByte(Keys.PrintScreen), 0, KEYEVENTF_KEYDOWN, 0) 'press the PrintScreen key down
- keybd_event(CByte(Keys.PrintScreen), 0, KEYEVENTF_KEYUP, 0) 'release the PrintScreen key
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment