Link to home
Start Free TrialLog in
Avatar of DLS
DLS

asked on

Excuting other application

In C you can execute other program using system() in VB you can use shell to execute other program what about in Delphi?

for example I want to run Winzip in my application how I do that at Delphi.
ASKER CERTIFIED SOLUTION
Avatar of simonet
simonet
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of firepoint
firepoint

why not try this way;

var
  zAppName:array[0..512] of char;
  zCurDir:array[0..255] of char;
  WorkDir:String;
  StartupInfo:TStartupInfo;
  ProcessInfo:TProcessInformation;

....

CreateProcess(nil,
    zAppName,                      { pointer to command line string }
    nil,                           { pointer to process security attributes }
    nil,                           { pointer to thread security attributes }
    false,                         { handle inheritance flag }
    NORMAL_PRIORITY_CLASS,     { creation flags }

    nil,                           { pointer to new environment block }
    nil,                           { pointer to current directory name }
    StartupInfo,                   { pointer to STARTUPINFO }
    ProcessInfo) then Result := -1 { pointer to PROCESS_INF }
Alex is right, but I think you must mention the full path e.g. 'c:\program files\winzip\winzip32.exe'

Motaz
Motaz, please read the last comment I made before writing "Yours".

Alex
DLS,
This question (or similar) was discussed 5-6 days ago.
See Q_10228364 for details.
Question is named:"Launching Wordpad..."

Jo.
try TExecFile Component in Delphi SuperPage
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange