Thanks!
CreateProcess
WinExec
ShellExecute
For more info on the calls above, refer to the Win32 SDK help file (included
with Delphi).
Yours,
- - - - - - - - - - - - - - - - - - - - - - -
Alex Simonetti Abreu
Belo Horizonte, MG, Brazil
Check out Resource Explorer --- The best of its kind.
Athena's Home: http://www.bhnet.com.br/~simonet
- - - - - - - - - - - - - - - - - - - - - - -
Enrique Martinez Caro wrote in message <73kktn$dp...@forums.borland.com>...
Uses windows;
winExec ('notepad.exe', SW_SHOW);
PhR
I had a few problems with WinExec (slow), so I had to use CreateProcess. Though
complex, I reduced it to a single function so that it can be used easily.
(Note : the result of the function is just there because you can have it ...
otherwise, it does not need to be used.)
uses Windows;
function ExecCommandLine(CommandLine: string): TProcessInformation;
implementation
function ExecCommandLine(CommandLine: string): TProcessInformation;
var StartUpInfos: TStartUpInfo;
begin
StartUpInfos.cb:= SizeOf(StartUpInfos);
StartUpInfos.lpReserved:= nil;
StartUpInfos.lpDesktop:= nil;
StartUpInfos.lpTitle:= nil;
StartUpInfos.dwFlags:= 0;
StartUpInfos.cbReserved2:= 0;
StartUpInfos.lpReserved2:= nil;
CreateProcess(nil, PChar(CommandLine), nil, nil,
False, CREATE_DEFAULT_ERROR_MODE + CREATE_NEW_CONSOLE +
NORMAL_PRIORITY_CLASS,
nil, nil, StartUpInfos, Result);
end;
Alexandre GUILLIEN