Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread L
Have you tested this simple way of doing it below program test; {$mode objfpc} {$H+} uses windows; begin ShellExecute(0 , 'open', 'notepad', nil, nil, SW_SHOWNORMAL) ; ShellExecute(0 , 'open', 'notepad', nil, nil, SW_HIDE) ; end. The cmd /k may not even be needed... and it may not even work t

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread L
> > Thanks L, do you know if I ShellExecute can create a process without showing > > the command window? > > I'm sure you can hide it.. just a matter of finding the right Windows API > paramaters.. > > Probably something like.. > SW_HIDEy > > Not tested, not sure. ;-) > > > Actually, maybe cmd /c

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread L
> Thanks L, do you know if I ShellExecute can create a process without showing > the command window? I'm sure you can hide it.. just a matter of finding the right Windows API paramaters.. Probably something like.. SW_HIDE Not tested, not sure. ;-) _

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread Leonardo M. Ram
> program ShellExec; {$mode objfpc}{$H+} > > uses > pwumain, windows; > > begin > WebWriteln(' Hello! '); > ShellExecute(0 , 'open', 'cmd /k c:\winnt\notepad.exe', nil, nil, > SW_SHOWNORMAL) ; > end. > > Because cmd /k forks open a new separate cmd shell for you (not a child, > AFAIK). >

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread L
> > Hi, I'm trying to start a Win32 process and exit leaving the process > > executing. The test > > scenario > > is a CGI calling a simple Http server (the Synapse Http server demo). > >I have done this before but it has been months and I forget exactly what I did. Something like this below: pro

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread Leonardo M. Ram
> You might wish to seperate the process by creating two executables, That's already done. > and execute a program in the background so you could decide what to > do, like in a daemon way... Yes, the problem is I want to do it in a multiplatform way. In Linux I can set CommandLine := 'httpserv

Re: [fpc-pascal] Run process and exit (win32)

2007-10-23 Thread ik
"Execute" is blocking, so it will continue to execute itself until you will stop the execution. You might wish to seperate the process by creating two executables, and execute a program in the background so you could decide what to do, like in a daemon way... Ido On 10/23/07, Leonardo M. Ramé <