Hi guys, is there a way to possibly take images of the screen by the button Print Screen every 0.5 seconds and save it as an image file (any image file) in a specific folder. Please reply.
Khanjan
Printable View
Hi guys, is there a way to possibly take images of the screen by the button Print Screen every 0.5 seconds and save it as an image file (any image file) in a specific folder. Please reply.
Khanjan
Put a timer on your form and set it to the internval that you desire. This will take a screen shot of your screen and save it to a bitmap file with each file having its own individual timestamp.VB Code:
Option Explicit 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 'Author: Dalin Nie (Edited by Matthew Gates) 'Origin: [url]http://www.vbcode.com[/url] 'Purpose: This function capture the screen or the active window of your 'computer. Programmatically and save it to a .bmp file. 'VB version: VB 6,VB 5,VB 4/32 'Save Screen As Bitmap Private Function SaveScreen(ByVal pstrFileName As String) As Boolean 'To get the Entire Screen Call keybd_event(vbKeySnapshot, 1, 0, 0) 'To get the Active Window 'Call keybd_event(vbKeySnapshot, 0, 0, 0) SavePicture Clipboard.GetData(vbCFBitmap), pstrFileName SaveScreen = True End Function Private Sub Timer1_Timer() Call SaveScreen("C:\MyFolder\Screenshot" & Format(Now, "hhmmss") & ".bmp") End Sub
Please help!!!!! When I use this code in excel base vb in my remote desktop - its not capturing the image , but opening a popup window that gives the save as option. Another messeg window comes along stating "Printing the screen print to Microsoft office document Image writer on Ne00. - A product of american system.'
please help. the code I used for taking screen shot is as follows:
Option Explicit 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 commandbutton_click()
Call keybd_event(vbKeySnapshot, 1, 0, 0)
End sub