Para probar, incluye el siguiente código en un proyecto nuevo.
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Sub Form_Load()
Caption = "Haz click sobre la ventana"
End Sub
Private Sub Form_Click()
Dim DhWnd As Long, DhDC As Long, Img As RECT
DhWnd = GetDesktopWindow
DhDC = GetDC(DhWnd)
GetWindowRect DhWnd, Img
BitBlt Me.hDC, 0&, 0&, Me.Width, Me.Height, DhDC, 0&, 0&, &HCC0020
ReleaseDC DhWnd, DhDC
End Sub
Posted
dom, ago 20 2000 0:21
by
Maverick