PDA

Visualizza la versione completa : Catturare la schermata


FreeKevin
30-10-2002, 23:01
Ciao a tutti,
vorrei sapere come possibile catturare quello che viene visuallizzato a schermo da un sistema windows nt 4.0, utilizzando un programma, o realizzandolo mediante c++ o visual basic.
Se possibile vorrei sapere come eseguire un programma escludendo la possibilita di poter usare "eseguzioni automatiche" per ristrezioni!!
Grazie 10000

xegallo
31-10-2002, 00:04
teoricamente basta schiacciare il tasto printscreen o stamp della tastiera e incollare su un programma qualsiasi per elaborare immagini
altrimenti se vuoi farlo tu in vb
ti serve questo


Public Declare Function BitBlt Lib "gdi32" _
(ByVal hDCDest As Long, ByVal XDest As Long,
ByVal YDest As Long, ByVal nWidth As Long,
ByVal nHeight As Long, ByVal hDCSrc As Long,
ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc _
As Long) As Long
Private Sub PrintScreen()
Dim r As Long
Dim hWndDesk As Long
Dim hDCDesk As Long
Dim LeftDesk As Long
Dim TopDesk As Long
Dim WidthDesk As Long
Dim HeightDesk As Long

'setup the screen coordinates (upper corner (0,0) and lower corner (Width,Height)
LeftDesk = 0
TopDesk = 0
WidthDesk = Screen.Width \ Screen.TwipsPerPixelX
HeightDesk = Screen.Height \ Screen.TwipsPerPixelY

'get the desktop handle and display context
hWndDesk = GetDesktopWindow()
hDCDesk = GetWindowDC(hWndDesk)

'copy the desktop to the picture box
r = BitBlt(Picture1.hdc, 0, 0, WidthDesk, HeightDesk, hDCDesk, LeftDesk, TopDesk, _
vbSrcCopy)
r = ReleaseDC(hWndDesk, hDCDesk)
End Sub

Loading