begin
//创建线程,同时线程函数被调用
//messagebox(Handle,''''创建线程'''',nil,MB_OK);
hthread:=CreateThread(nil,0,@ClosePopDialog,nil,0,ThreadID);
if hThread=0 then
messagebox(Handle,''''创建线程失败'''',nil,MB_OK);
end;
function ClosePopDialog(P:pointer):Longint;stdcall;
var
i:longint;
DC:HDC;
kk:hwnd;
begin
while (true) do
begin
if ((frmMain.stage = 3) ) then
begin
kk := findwindow(nil,''''Microsoft Internet Explorer'''');
if kk<>0 then //如果找到IE弹出对话框,就干掉它
begin
setActiveWindow(kk);
sendmessage(kk,wm_close,0,0);
end
end;
sleep(5000);
end;
end;
图表 1 主界面
上一页 [1] [2] [3] [4] 没有相关教程
|