Dali može ovaj cod nešto pomoći.
Hmmm.
Code:
Option Explicit
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetTopWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Sub GetShot(lWindowhWnd As Long)
Dim nLeft As Long
Dim nTop As Long
Dim nWidth As Long
Dim nHeight As Long
Dim rRect As RECT
Dim bm As BITMAP
Dim lWindowhDC As Long
Hide
picScreen.Cls
Set picScreen.Picture = Nothing
GetWindowRect lWindowhWnd, rRect
lWindowhDC = GetWindowDC(lWindowhWnd)
'// Get coordinates
nLeft = 0
nTop = 0
nWidth = rRect.Right - rRect.Left
nHeight = rRect.Bottom - rRect.Top
'// Blt to frm.picScreen
BitBlt picScreen.hDC, 0, 0, nWidth, nHeight, lWindowhDC, nLeft, nTop, vbSrcCopy
'// Del DC
ReleaseDC lWindowhWnd, lWindowhDC
'// set picture
picScreen.Picture = picScreen.Image
Show
End Sub