> How can I store on file system the screen shot of my pc, automatically
> created each 30 minutes?
> I think it is necessary:
> 1) a component for managing print screen
Try the following:
Sub ScreenShot(FileName As String, Optional ByVal Parent As Object)
If Parent Is Nothing Then
Set Parent = Forms(0)
End If
Dim Pic As PictureBox
Set Pic = Parent.Controls.Add("VB.PictureBox", "ScreenshotBox")
Dim HDC As Long
HDC = GetDC(0)
Dim W As Long, H As Long
W = Pic.ScaleX(GetDeviceCaps(HDC, HORZRES), vbPixels)
H = Pic.ScaleX(GetDeviceCaps(HDC, VERTRES), vbPixels)
Pic.BorderStyle = 0
Pic.Width = W
Pic.Height = H
Pic.AutoRedraw = True
BitBlt Pic.HDC, 0, 0, W, H, HDC, 0, 0, SRCCOPY
Pic.Refresh
ReleaseDC 0, HDC
Pic.Picture = Pic.Image
SavePicture Pic.Picture, FileName
Parent.Controls.Remove "ScreenshotBox"
End Sub
Then just something like...
ScreenShot Format$(Now,"yyyymmddhhNNss") & ".BMP"
> 2) a component for timing screen shots calls
Set a Timer control's interval to 60000. It'll fire its event once a
minute. If you don't care about slight error, just keep a counter. Every
30th time it fires, save a screenshot.
HTH
Murphy
www.ConstantThought.com