|
-
Jun 25th, 2000, 10:35 PM
#1
Thread Starter
Fanatic Member
Is it possible to use Sendkeys to imitate someone pressing the "Print Screen" key? I haven't been successful trying to do it and then pasting the contents of the clipboard into a Rich Text Box.
Thanks.
-
Jun 25th, 2000, 11:48 PM
#2
You cannot send Print Screen key to an App. It says so in the MS Help file too.
-
Jun 26th, 2000, 03:15 AM
#3
Thread Starter
Fanatic Member
Thanks Megatron, but
that doesn't help. I also read in Help that you can't send the Print Screen key to an App. My question is, "How do you use the statement?
Can it even be used at all and, if so, how? If not, why was the statement included in the SendKeys Help information?
Thanks.
-
Jun 26th, 2000, 03:20 AM
#4
Yes but, go to the very bottom of the Help File and it will also say this.
Note You can't use SendKeys to send keystrokes to an application that is not designed to run in Microsoft Windows. Sendkeys also can't send the PRINT SCREEN key {PRTSC} to any application.
-
Jun 26th, 2000, 03:48 AM
#5
Thread Starter
Fanatic Member
Going in circles ...
Megatron, I've read that, but my question from my previous post remains [quote]How do you use the
statement?
Can it even be used at all and, if so, how? If not, why was the statement included in the SendKeys Help information?[/code]
Whoever responds, please answer the above question.
-
Jun 26th, 2000, 04:07 AM
#6
Lively Member
I got it!
You can use the keybd_event API to do a print screen:
Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_SNAPSHOT = &H2C
Private Sub Command1_Click()
keybd_event VK_SNAPSHOT, 0, 0, 0
End Sub
when command1 is clicked, it will send an image of the window to the clipboard. If you want the whole screen's image copied, replace the call with this:
Code:
keybd_event VK_SNAPSHOT, 1, 0, 0
For more info:
http://msdn.microsoft.com/library/wc...dkr/uif_kl.htm
[Edited by delker on 06-26-2000 at 05:09 PM]
-
Jun 26th, 2000, 05:44 AM
#7
Thread Starter
Fanatic Member
Thanks ....
Delker, you were right. Your code did exactly what I was looking for. Megatron, thanks for your help also.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|