This should capture your themed window
Code: Select all
#CAPTUREBLT = $40000000
Procedure CapWindow(Hwnd)
Protected Rect.rect
Protected SrcDc,DestDc,Image,Result,W,H
If hwnd
SrcDc = GetDC_(0)
If SrcDc
GetWindowRect_(Hwnd,@Rect)
W = Rect\Right-Rect\Left
H = Rect\Bottom - Rect\Top
If W
Image = CreateImage(#PB_Any,W,H,32)
If Image
DestDc = StartDrawing(ImageOutput(Image))
If DestDc
Result = BitBlt_(DestDc,0,0,W,H,Srcdc,Rect\Left,Rect\Top,#SRCCOPY | #CAPTUREBLT);
If Result
ProcedureReturn Image
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndProcedure
Delay(2000)
winshot=CapWindow(GetForegroundWindow_())
SetClipboardImage(winshot)
If winshot
FreeImage(winshot)
EndIf