Bueno, eh soluciònado una parte. Pero el problema es, que al tomar la foto al programa, se ve toda negra. Ya que la ventana esta en DirectX 9.0
Código Delphi
[-]function Tibia.WindowSnap(windowHandle: HWND; bmp: TBitmap): boolean;
var
r: TRect;
user32DLLHandle: THandle;
printWindowAPI: function(sourceHandle: HWND; destinationHandle: HDC; nFlags: UINT): BOOL; stdcall;
begin
result := False;
user32DLLHandle := GetModuleHandle(user32) ;
if user32DLLHandle <> 0 then
begin
@printWindowAPI := GetProcAddress(user32dllhandle,'PrintWindow') ;
if @printWindowAPI <> nil then
begin
GetWindowRect(windowHandle, r) ;
bmp.Width := r.Right - r.Left;
bmp.Height := r.Bottom - r.Top;
bmp.Canvas.Lock;
try
result := printWindowAPI(windowHandle, bmp.Canvas.Handle, 0) ;
finally
bmp.Canvas.Unlock;
end;
end;
end;
end;
Toma la imagen y todo, pero queda negra el contenido. P.S Uso delphi 2010