一般游戏打开的时候都有个更新的程序(A.exe)然后再从更新程序中启动真正的游戏登陆程序(B.exe)在游戏登陆程序(B.exe)的启动参数已经获得的情况下:请问什么用api函数可以实现自动打开游戏登陆程序(B.exe)即实现自动实现从A.exe到B.exe程序的过程

解决方案 »

  1.   

    从程序中运行程序除了winexec外,还有ShellExecute或CreateProcess
    具体有见windows SDK HELP
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,ShellAPI;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);//打开微软的计算器
    begin
       ShellExecute(Handle, 'open', PChar('C:\WINDOWS\system32\calc.exe'), nil, nil, SW_SHOW);
    end;end.
      

  3.   


    记得要引用ShellAPI
      

  4.   

    楼上忘了启动参数了b.exe需要a.exe传过来的启动参数才能启动现在启动参数有了,就是不知道怎么使用
      

  5.   

    ShellExecute(Handle, 'open', PChar('C:\WINDOWS\system32\calc.exe'), [read]参数[/read], nil, SW_SHOW); 
      

  6.   

    WinExec('cmd /kecho Parameter', SW_SHOW)