Code:
Private Declare Function SendMessage Lib "USER32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4& ' Draw the window's client area
Private Const PRF_CHILDREN = &H10& ' Draw all visible child
Private Const PRF_OWNED = &H20& ' Draw all owned windows
Code:
Dim rv As Long
Picture2.AutoRedraw = True
rv = SendMessage(Picture1.hWnd, WM_PAINT, Picture2.hDC, 0)
rv = SendMessage(Picture1.hWnd, WM_PRINT, Picture2.hDC, PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Set Picture2.Picture = Picture2.Image
The following gives me the error "Invalid Picture"
Code:
Alpha.Picture = LoadPictureGDIplus(Picture2.Picture)