CreateProcess

CreateProcess

Hi,
I was using 'winexec' to edit data files using notepad in my application.I read recently that winexec is good only for 16 bit and createprocess should be usedfor applications.
However I am not able to use createprocess successfully.For starters I do not know what to use for the startupinfo and process information structure.Can anyone give me an example using createprocess.
Can Shellexecute be used instead or is it also only 16 bit compatible?
--rswy

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Example code:

program ed
use dfwbase
use kernel32
implicit none
type (T_STARTUPINFO) si
type (T_PROCESS_INFORMATION) pi
call ZeroMemory (LOC(si), SIZEOF(si))
call ZeroMemory (LOC(pi), SIZEOF(pi))
si%cb = SIZEOF (si)
si%dwFlags = STARTF_USESTDHANDLES
if (CreateProcess(NULL,'notepad junk.txt'c,NULL,NULL,FALSE,0,NULL,NULL,si,pi) /= 0) then
  print *, 'Process created', pi%dwProcessId
else
  print *, 'CreateProcess error', GetLastError()
end if
end program ed

James

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya