2007-08-15 19:14首先要说的是,你的抓的这个窗口不在所有窗体的最上面,而且是不用把这个窗口置于最上,截图!要用到的API,需要声明;function PrintWindow(hwnd:HWND;hdcBlt:HWND;nFlags:word ):boolean;stdcall;external 'user32.dll';具体方法过程;procedure PrintBakWnd(H:THandle); //H为要抓拍的窗口的句柄var DC:HDC; H1:HBITMAP; DC1:HDC; ScreenMap:TBitmap; R:TRect;begin DC:=GetWindowDC(H); GetWindowRect(H,R); H1:=CreateCompatibleBitmap(DC,r.Right-r.Left,r.Bottom-r.Top); DC1:=CreateCompatibleDC(DC); SelectObject(DC1,H1); PrintWindow(H,DC1,0); ScreenMap:=TBitmap.Create; ScreenMap.Handle:=H1; ScreenMap.SaveToFile('c:/'+FormatDateTime('YYYYMMDD-HHMMSS',Now)+'.bmp'); ScreenMap.Free; DeleteDC(DC); DeleteDC(DC1); CopyFile()end; http://hi.baidu.com/rockzhang/blog/item/e307ebf83358980dd9f9fd3e.html