Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / November 2003



Tip: Looking for answers? Try searching our database.

screen shot

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gianluca - 29 Nov 2003 09:28 GMT
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
2) a component for timing screen shots calls
Thanks a lot for your help.
Gianluca.
Murphy McCauley - 29 Nov 2003 11:29 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.