im developing an app that take screenshots of games,
at the moment i use this method, but it don't work in some windows vista/seven systems
Code:
function GetPrintScreen(wnd: HWND): TBitmap;
var
h, w: Integer;
dc: HDC;
rect: TRect;
begin
dc := GetDC(wnd);
if (dc = 0) or (not GetClientRect(wnd, rect)) then
begin
Result := nil;
Exit;
end;
w := rect.Right - rect.Left;
h := rect.Bottom - rect.Top;
Result := TBitmap.Create;
Result.Width := w;
Result.Height := h;
BitBlt(
Result.Canvas.Handle, 0, 0,
w, h,
dc, 0, 0,
SRCCOPY);
ReleaseDC(wnd, dc);
end;
so,
someone know another way to get screenshots?
Bookmarks