程序的功能很简单,用IE打开一个网页(能输入,),一分钟以内,关闭窗口。再打开,关闭,知道程序停止。

解决方案 »

  1.   

    uses shellApi
    用一个TIMER 定时  
    处理
    postmessage(thishandle,WM_CLOSE,nil);thishandle:=ShellExecute(handle,'explore','http://www.csdn.net',nil,nil,SW_Normal);
      

  2.   

    邮件已发,请查收。
    [email protected]
      

  3.   

    to flyingkiller(大飞虫) 
    你发的好象只能打开不能关闭,如果让它自动工作会死机的
      

  4.   

    何必呢,如果用来刷广告,用这种办法就太笨了,用SOCKET控件写一段代码好了,或者最简单的用TNMHTTP控件不就得了
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      lpCommandLine: PChar;
      lpStartupInfo: STARTUPINFO;
      lpProcessInformation: PROCESS_INFORMATION;
      ProcessCreateOK,FileExist: boolean;
      windowname : array [0..100] of char;
    begin
      //url := inputbox('网页','网址','www.263.net');,输入网址
      url := 'C:\Program Files\Internet Explorer\IExplore http://www.263.net';
      lpCommandLine := pchar(url);
      GetStartupInfo(lpStartupInfo);
      ProcessCreateOK := CreateProcess(nil,lpCommandLine,nil,nil,True,CREATE_NEW_PROCESS_GROUP,nil,nil,lpStartupInfo,lpProcessInformation);
      if ProcessCreateOK then
      begin
        thishandle := lpProcessInformation.hProcess;
        timer1.Enabled := true;
      end;
    end;procedure TForm1.Button2Click(Sender: TObject);
    var
      lpExitCode : Cardinal;
    begin
      GetExitCodeProcess(thishandle,lpexitCode);
      TerminateProcess(thishandle,lpexitcode);
    end;
    呵呵,我测试过了,没有问题,只要在定时器里一次调用这两个过程,肯定可以开关指定网页。你试试,如果通过的话,别忘了给分
      

  6.   

    很简单的,程序的同步调用问题,
    apache57(虾米) 已经解决了问题
    顶多加个Timer就OK了