下面的抓图程序那里错?为什么只能抓取自己程序的窗口?抓别的窗口就回显示参数错误?

Inf 2001-10-05 06:06:29
var
Bitmap : TBitmap;
acthwnd,temphwnd : HWND;
actrect : TRect;
actW,actH : integer;
actdc : LongWord;
begin
acthwnd:=GetActiveWindow();
GetWindowRect(acthwnd,actrect);
temphwnd:=GetDesktopWindow();
actdc:=GetDC(temphwnd);
Bitmap := TBitmap.Create;
actW:=actrect.Right-actrect.Left;
actH:=actrect.Bottom-actrect.Top;
Bitmap.Width:=actW;
Bitmap.Height:=actH;
Bitblt(Bitmap.Canvas.Handle,0,0,actW,actH,actdc,actrect.Left,actrect.Top,SRCCOPY);
ReleaseDC(temphwnd,actdc);
Bitmap.Free;
end;
...全文
72 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sundayboys 2001-10-05
  • 打赏
  • 举报
回复
看msdn,上边说明很清楚。你有msdn吗?没有我可以把相关内容帖出来。
Inf 2001-10-05
  • 打赏
  • 举报
回复
搞定,不过我想知道为什么会这样?分照给!
Inf 2001-10-05
  • 打赏
  • 举报
回复
up
sundayboys 2001-10-05
  • 打赏
  • 举报
回复
你将GetActiveWindow改为GetForegroundWindow试试。

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧