|
-
Jun 11th, 2001, 07:43 PM
#1
Thread Starter
New Member
screen capture problem
I am trying to execute a screen capture. My problem is the first time I click the command button it shows the last picture. I have to click it twice to get a new picture here is my code.
*Credits to Matthew Gates for some of the code.
Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As _
Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo _
As Long)
Public Const VK_SNAPSHOT = &H2C
Public Const KEYEVENTF_EXTENDEDKEY = &H1
Public Const KEYEVENTF_KEYUP = &H2
Private Sub cmdScreen_Click()
Me.WindowState = vbMinimized
DoEvents
keybd_event vbKeySnapshot, 1, 0, 0
keybd_event vbKeySnapshot, 0, KEYEVENTF_KEYUP, 0
Form2.Picture = Clipboard.GetData(vbCFBitmap)
Form2.Show
End Sub
-
Jun 11th, 2001, 08:56 PM
#2
Try using the Cls method to clear the form.
-
Jun 12th, 2001, 09:37 AM
#3
Thread Starter
New Member
where should I put the .cls command?
-
Jun 12th, 2001, 11:31 AM
#4
VB Code:
Private Sub cmdScreen_Click()
Me.Cls
Me.WindowState = vbMinimized
DoEvents
keybd_event vbKeySnapshot, 1, 0, 0
keybd_event vbKeySnapshot, 0, KEYEVENTF_KEYUP, 0
Form2.Picture = Clipboard.GetData(vbCFBitmap)
Form2.Show
End Sub
-
Jun 12th, 2001, 05:33 PM
#5
Thread Starter
New Member
-
Jun 12th, 2001, 07:18 PM
#6
Try:
VB Code:
Form2.Picture = LoadPicture()
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
|