2011年3月10日
摘要: 在不能使用FindWindow等函数的前提下。var g_hwin:THandle;function EnumWindowsProc(H:HWND;lParam:LPARAM):Boolean;stdcall;var PID:DWORD;begin Result:=True; GetWindowThreadProcessId(H,PID); if PID=GetCurrentProcessId then begin g_hwin:=H; Result:=False; end;end;procedure TForm1.btn4Click(Sender: TObject);begin EnumWi 阅读全文
posted @ 2011-03-10 18:47 飘啊飘的 阅读(1443) 评论(0) 推荐(0) 编辑
摘要: function PrintWindow(SourceWindow: hwnd; Destination: hdc; nFlags: cardinal): bool; stdcall; external 'user32.dll' name 'PrintWindow'; procedure TForm1.btn3Click(Sender: TObject);var bmp : TBitmap; wnd : cardinal; rec : TRect;begin wnd := FindWindow(nil, '计算器'); GetWindowRect 阅读全文
posted @ 2011-03-10 18:13 飘啊飘的 阅读(341) 评论(0) 推荐(0) 编辑