Board index » delphi » launch a ms-dos application from delphi ?

launch a ms-dos application from delphi ?

I want to write a little program with delphi which would the following :
when  u click on the icon,
it first launches the apache server, then mysql  (without showing it to u)
then, access  the data stored in it and give u the info it had retrieved
from the database in a memo component.

I know how to access to a mysql server but not how to launch it nor apache.
Can anyone help me please (under win98) ?

 

Re:launch a ms-dos application from delphi ?


Use WinExec, ShellExecute or CreateProcess. If you search groups.google.com
you will find several examples for these functions.

Quote
"acey" <kanari...@yahoo.fr> wrote in message news:9q1n5p$pi1$1@wanadoo.fr...
> I want to write a little program with delphi which would the following :
> when  u click on the icon,
> it first launches the apache server, then mysql  (without showing it to u)
> then, access  the data stored in it and give u the info it had retrieved
> from the database in a memo component.

> I know how to access to a mysql server but not how to launch it nor
apache.
> Can anyone help me please (under win98) ?

Re:launch a ms-dos application from delphi ?


Does this help? It launches an exe or a document by path - doesn't take much
imagination looking at the code to see how to add a parameter string to it,
too. The 1 as the last parameter is the open mode for the application - go
and check out ShellExecute in the help.

D

uses
  SysUtils, Forms, ShellAPI; // and maybe a couple of others

function LaunchDocument(Path: string): boolean;
var
  zFileName: array[0..511] of Char;
  zParams, zDir: array[0..79] of Char;
begin
  LaunchDocument:=(ShellExecute(Application.MainForm.Handle, nil,
   StrPCopy(zFileName, Path), StrPCopy(zParams, ''),
   StrPCopy(zDir, ''), 1))>=32
end;

Quote
"acey" <kanari...@yahoo.fr> wrote in message news:9q1n5p$pi1$1@wanadoo.fr...
> I want to write a little program with delphi which would the following :
> when  u click on the icon,
> it first launches the apache server, then mysql  (without showing it to u)
> then, access  the data stored in it and give u the info it had retrieved
> from the database in a memo component.

> I know how to access to a mysql server but not how to launch it nor
apache.
> Can anyone help me please (under win98) ?

Other Threads