views:

579

answers:

1

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!

+1  A: 

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

uosɐſ
That sample code is in C#, but especially in this case, it should be extremely easy to copy in and convert to VB.Net
uosɐſ
Most likely. Ill check out pinvoke, though I am not patient lol....
Cyclone
http://www.dreamincode.net/code/snippet2572.htm worked!!! It was a simple conversion, you were right, took about a minute. Thanks so much!!!!!!!!!
Cyclone