Using Sendkeys to perforam a Screenshot without Windows API
First, As always open VB.net and follow along
--- Create a new windows Application
--- You will need to add
---- Picture Box
---- Status Bar
---- Split Button (which will be in the status bar)
---- Panel
----Timer
Add, a menu to the split button on the taskbar that says "ScreenShot"
Note: Dock the panel full, we use this so the picture box stretches with the form.
Dock the PictureBox inside the panel..
If you set it up as mentioned above, You should have something that looks like this
[IMG]http://i111.photobucke*****m/albums/n121/golmor/screen.png[/IMG]
--- Double Click the Menu Item inside your Split button and add this code
[php]
'Min Form
Me.WindowState = FormWindowState.Minimized
'Hide the form (so it isn't in the screenshot
Me.Hide()
' This enables the timer which handles the events
timer1.Enabled = True
[/php]
Now double click your timer and add this
[php]
'Press Print Screen
SendKeys.Send("{%}({PRTSC})")
'Grab the image from the keyboard
picturebox1.Image = CType(Clipboard.GetDataObject.GetData("Bitmap"), Image)
'Set the form to visible again
Me.Show()
'Normalize the form
Me.WindowState = FormWindowState.Normal
'timer stop
Timer1.Stop()
'disables the timer
Timer1.Enabled = False
[/php]