0

I am attempting to send the PrintScreen key, obviously, which ought to work no matter the window it is focused on. How can I make this trigger the printscreen action like it normally would? This is in VB.net. Thanks for the help!

I have googled this, and couldn't find any results that worked.

EDIT: Somehow, this worked, once. But now it is not working at all!

Cyclone
  • 17,939
  • 45
  • 124
  • 193
  • To clarify, the end result from sending the printscreen key *ought to be* triggering a printscreen, which usually copies the static bitmap to the clipboard. – Cyclone Sep 06 '09 at 19:05

1 Answers1

1

I would guess that your EDIT note about a successful attempt is actually just that you had manually hit PRNTSCRN previously and that your clipboard still had it in there when you ran you program, which put nothing in the clipboard, but then read your manually taken screenshot out again.

Your approach to get a snapshot of the screen won't work - you have to use some pinvoke stuff, which isn't that hard to piece together if you're patient. http://www.pinvoke.net/ is a great resource.

OOO, and I have never tried this, but this article seems confidently written. http://www.dreamincode.net/code/snippet2572.htm

Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
  • That sample code is in C#, but especially in this case, it should be extremely easy to copy in and convert to VB.Net – Jason Kleban Sep 06 '09 at 19:16
  • http://www.dreamincode.net/code/snippet2572.htm worked!!! It was a simple conversion, you were right, took about a minute. Thanks so much!!!!!!!!! – Cyclone Sep 06 '09 at 19:25