CoBrA
03-08-2004, 06:35 AM
I looked through about everypost I could find that has anything to do with screenshots to try and solve this, but I cant find a answer.
I made a program that takes screenshots of my desktop and then saves them in a folder. When I run my program and Hit my command key (Keyboard letter =X) it works fine. BUT if I open my program and then start up a game and try to take a screenshot while I am in a game, it will NOT work, It will also NOT work if I Minimize the form and hit X.
I got it to work by putting it on a timer, then starting it and going into a game real fast and it saves a screenshot fine. I just cant get it to work by pressing my command key in a game.
If its the MAIN program running, it works fine, but as soon as I try it in a game or Minimize it, or try to run it with another program running (like PSP), it wont work.
I take lots of screenshots in some of my games, so useing the PrintScreen button is a pain. (1 pic at a time)
Can anyone help me out with this? I have searched and even downloaded some free codes, but they dont help.
Is there something I am missing that would keep my program from taking a screenshot during a game or when Minimized?
Thanks for any help or code that you could help me out with.
I really need it,lol :eek:
---------------------------------------------------
Code that I am Useing
---------------------------------------------------
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 Form_KeyPress(KeyAscii As Integer)
KeyAscii = 88
Call keybd_event(vbKeySnapshot, 1, 0, 0)
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\TestPic.bmp"
End Sub
----------------------------------------------------------
Thanks
I made a program that takes screenshots of my desktop and then saves them in a folder. When I run my program and Hit my command key (Keyboard letter =X) it works fine. BUT if I open my program and then start up a game and try to take a screenshot while I am in a game, it will NOT work, It will also NOT work if I Minimize the form and hit X.
I got it to work by putting it on a timer, then starting it and going into a game real fast and it saves a screenshot fine. I just cant get it to work by pressing my command key in a game.
If its the MAIN program running, it works fine, but as soon as I try it in a game or Minimize it, or try to run it with another program running (like PSP), it wont work.
I take lots of screenshots in some of my games, so useing the PrintScreen button is a pain. (1 pic at a time)
Can anyone help me out with this? I have searched and even downloaded some free codes, but they dont help.
Is there something I am missing that would keep my program from taking a screenshot during a game or when Minimized?
Thanks for any help or code that you could help me out with.
I really need it,lol :eek:
---------------------------------------------------
Code that I am Useing
---------------------------------------------------
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 Form_KeyPress(KeyAscii As Integer)
KeyAscii = 88
Call keybd_event(vbKeySnapshot, 1, 0, 0)
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\TestPic.bmp"
End Sub
----------------------------------------------------------
Thanks