在该程序的事件onactive/onshow/oncreate里面启动就可以拉??
procedure TForm1.Oncreate(Sender : TObject);
begin
  shellexecute( );  
end;

解决方案 »

  1.   

    写一个后台运行的程序,实时检测当前运行的程序。当发现“第一个程序”运行时,则运行“第二个程序”。
    可以参考一下API函数FindWindow。
      

  2.   

    To Easy!
    用病毒的做法!
    把EXE文件关联到你的程序文件!
    在你的程序中用Paramstr(1)获得要执行的文件名!
    然后在你的程序中启动Paramstr(1)!注册表地址:HKEY_CLASSES_ROOT\exefile\shell\open\command
      

  3.   

    同意ehom(?!) 
    对,是要用注册表
      

  4.   

    melice(melice):
    在win2000环境下为什么Paramstr(1)无值?
    我在98下成功了.
    还有winexec('fdsaf',9)的参数是什么意思?能解释一下吗?
    或是
    Shellexecute(handle
    'open'
    'notepad.exe'
    ''
    nil
    sw_shownormal);
      

  5.   

    用creatprocess这个Api函数,这样还能控制另一个程序
      

  6.   

    在文件启动时调用winexec(路径\文件名,0)即可。(路径、文件名是否成功可将其copy至开始->运行中测试)
      

  7.   

    呵呵,简单一点,把你的程序改名为别人的程序名,把别人的程序改成其它名字,你的程序启动时,就用WinExec或CreateProcess等方法启动别人的程序就行了,呵呵,只要你的程序没界面,呵呵,别人是不会知道的!
      

  8.   

    使用API函数'ExecuteProcess'执行一个应用程序,使用'TerminateProcess'终止它。
    以下是一个例子:
    var
    MyHandle: THandle;
    MyStartupInfo: TStartupInfo;
    MyProcessInfo: TProcessInformation;procedure TMyForm.ExecuteApp(MyPath: String);
    begin
    FillChar(MyStartupInfo, SizeOf(MyStartupInfo), 0);
    //清除MyStartupInfo中的数据MyStartupInfo.cb:=SizeOf(MyStartupInfo);CreateProcess(PChar(MyPath), nil, nil, nil, False, 
    DETACHED_PROCESS, nil, nil, MyStartupInfo,
    MyProcessInfo);MyHandle:=MyProcessInfo.hProcess;
    //把执行的程序的句柄赋值给MyHandle,它会在终止程序时用到
    end;procedure TMyForm.CloseApp(MyHandle: THandle);
    begin
    TerminateProcess(MyHandle, 0);
    end;
      

  9.   

    Shellexecute(handle,'open','notepad.exe','c:\winnt\system32',nil,sw_shownormal);