|
-
Aug 13th, 2002, 04:30 PM
#1
Thread Starter
Hyperactive Member
SendKeys PrntScrn
Is there a way to use sendkeys to do a print screen?
-
Aug 13th, 2002, 04:31 PM
#2
So Unbanned
No.
You can use bitblt though.
-
Aug 13th, 2002, 04:32 PM
#3
Thread Starter
Hyperactive Member
-
Aug 13th, 2002, 04:34 PM
#4
So Unbanned
-
Aug 13th, 2002, 04:41 PM
#5
The picture isn't missing
try:
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Call keybd_event(vbKeySnapshot, 0, 0, 0)
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 13th, 2002, 05:01 PM
#6
Thread Starter
Hyperactive Member
Originally posted by BuggyProgrammer
try:
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Call keybd_event(vbKeySnapshot, 0, 0, 0)
That's GREAT.......
Now I just need to find some way to get it to work in VBA....
-
Aug 13th, 2002, 05:03 PM
#7
The picture isn't missing
i tested, it works. make sure
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
is at the TOP of everything.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 13th, 2002, 05:11 PM
#8
Thread Starter
Hyperactive Member
It does work!!!!!
how would I then save it.
C:\test.....
??
I found some code but it does not work in Access.
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 Sub Command1_Click()
'1 is the screen. Replace it with 0 and you'll get the form
keybd_event vbKeySnapshot, 0, 0&, 0&
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "C:\Test.bmp"
Clipboard.Clear
End Sub
Last edited by texas; Aug 13th, 2002 at 05:25 PM.
-
Aug 13th, 2002, 06:36 PM
#9
Lively Member
VB Code:
Private Declare Function GetDesktopWindow Lib "USER32" () As Long
Private Declare Function GetDC Lib "USER32" (ByVal hWnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Sub SaveDesktop(FilePath As String)
Dim A As Long
Dim s As Long
A = GetDesktopWindow()
s = GetDC(A)
Picture1.Width = Screen.Width / Screen.TwipsPerPixelX
Picture1.Height = Screen.Height / Screen.TwipsPerPixelY
BitBlt Picture1.hDC, 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, s, 0, 0, vbSrcCopy
SavePicture Picture1.Image, FilePath
End Sub
Does it without loosing your clipboard data
-
Aug 14th, 2002, 09:31 AM
#10
Thread Starter
Hyperactive Member
Did you get that to work in Access?
If so what did you reference?
-
Aug 14th, 2002, 09:34 AM
#11
Lively Member
i dont know if it would work in access...didnt try it
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
|