Yes. CreateProcess is it.
This routine is handy (from the web somewhere):

  function WinExecAndWait32(Path: PChar; Visibility: Word; Timeout: DWORD): integer;
  var
    WaitResult: integer;
    StartupInfo: TStartupInfo;
    ProcessInfo: TProcessInformation;
  begin
    FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
    with StartupInfo do
    begin
      cb := SizeOf(TStartupInfo);
      dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
    { you could pass sw_show or sw_hide as parameter: }
      wShowWindow := visibility;
    end;
    if CreateProcess(nil, path, nil, nil, False,
      NORMAL_PRIORITY_CLASS, nil, nil,
      StartupInfo, ProcessInfo) then
    begin
      WaitResult := WaitForSingleObject(ProcessInfo.hProcess, timeout);
      { timeout is in miliseconds or INFINITE if
      you want to wait forever }
      result := WaitResult;
    end
    else
    { error occurs during CreateProcess see help for details }
      result := GetLastError;
  end;

HTH

Chris

> -----Original Message-----
> From: Chris Veale [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 30 September 2002 9:31 a.m.
> To: Multiple recipients of list delphi
> Subject: [DUG]: executing another application in yours?
> 
> 
> Hi.
> 
> Can anyone please tell me what the procedure is for executing 
> an application
> in your code? I know it used to be winexec for win 311 
> systems, but what has
> it become? is it the create process procedure?
> 
> Cheers
> 
> Chris
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.391 / Virus Database: 222 - Release Date: 19/09/02
> 
> 
> 
> 
> ______________________________________________________
> The contents of this e-mail are privileged and/or confidential to the
> named recipient and are not to be used by any other person and/or
> organisation. If you have received this e-mail in error, 
> please notify 
> the sender and delete all material pertaining to this e-mail.
> ______________________________________________________
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to