English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] Howto execute a command without the "cmd" windows opening?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-11-04 (12:04)
From: David Allsopp <dra-news@m...>
Subject: RE: [Caml-list] Howto execute a command without the "cmd" windows opening?
> If i find a way to read the exit status of the process…

Pass a PROCESS_INFORMATION structure to CreateProcess (in order to get the hProcess for the process you created) and then use GetExitCodeProcess[1]. You can use WaitForSingleObject passing hProcess to it if you need to block until the process has actually terminated or you can loop on GetExitCodeProcess until the result is not equal to STILL_ACTIVE.


[1] http://msdn.microsoft.com/en-us/library/ms683189(VS.85).aspx
[2] http://msdn.microsoft.com/en-us/library/ms687032(VS.85).aspx