HDC应该是一个DC的句柄,但是在Delphi里面是怎么使用的?在使用之前要用uses引入什么文件嘛??因为我的Delphi程序老是编译通不过,显示未定义:Undeclared identifier: 'HDC'原代码就是网上找的一段对窗口截图的Delphi代码:
var
  dc: HDC;
  bmp: TBitmap;
begin
  dc := GetDC(0);
  bmp := TBitmap.Create;
  try
    bmp.Width := Screen.Width;
    bmp.Height := Screen.Height;
    bmp.PixelFormat := pf24Bit;
    BitBlt(bmp.Canvas.Handle, 0, 0, bmp.Width, bmp.Height, dc, 0, 0, SRCCOPY);
    bmp.SaveToFile('c:\tmep.bmp');
  finally
    bmp.Free;
    ReleaseDC(0, dc);
  end;
end;