winexec(pChar(OpenDialog1.FileName),SW_SHOWNORMAL);

解决方案 »

  1.   

    winexec(pChar(OpenDialog1.FileName),SW_SHOWNORMAL);
    试过了,可以打开microsoft的一些应用程序以及象金山毒霸之类的,但是始终打不开foxmail的应用程序
      

  2.   

    uses ShellApi;
    ShellExecute(handle,'Open',pChar(FileName),nil,nil,SW_SHOWNORNAL);
      

  3.   

    在WIN2000中不应该用WINEXEC,因为她是16位的,应该用CREATPROCESS,它才是32位的,具体使用可以看帮助
      

  4.   

    打开foxmail可能需要同时打开其他的东东程序,可以采用
    winexec('11.exe,foxmail.exe',1)打开
      

  5.   

    //CreateProcess的使用示例
    Function LaunchApp(pExePath,WorkDir:String;WaitFlag:Boolean):Boolean;
    var ExePath : array[0..512] of char;
        StartupInfo:TStartupInfo;
        ProcessInfo:TProcessInformation;
    begin
      StrPCopy(exePath, pExePath);
      FillChar(StartupInfo,Sizeof(StartupInfo),#0);
      StartupInfo.cb := Sizeof(StartupInfo);
      StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
      StartupInfo.wShowWindow := 1;
      if not CreateProcess(nil,
                          ExePath,
                          nil,
                          nil,
                          false,
                          CREATE_NEW_CONSOLE or
                          NORMAL_PRIORITY_CLASS,
                          nil,
                          nil,
                          StartupInfo,
                          ProcessInfo) then  begin
        Result:=False;
        Exit;
      end else begin
        if WaitFlag then
          WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
        Result:=True;
      end;
    end;
      

  6.   

    if not FileExists(AppFile) then Exit;
      FillChar(StartupInfo, SizeofStartupInfo),#0);      
      if not CreateProcess(PChar(AppFile), nil, nil, nil, True,NORMAL_PRIORITY_CLASS,
           nil, nil, StartUpInfo, ProcessInfo) then
         ShowMessage('Create Process Error!')
      else
         WaitforSingleObject(ProcessInfo.hProcess, INFINITE);////AppFile是你指定的可执行文件