Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Kill a process
Message
De
29/03/2004 14:36:28
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00890217
Message ID:
00890562
Vues:
35
>>>seems to be what I need but I got the following error
>>>
>>>too many arguments
>>>
>>>
>>>    DECLARE SHORT GetExitCodeProcess IN WIN32API AS GetExitCodeProc ;
>>>        INTEGER hProcess, ;
>>>        @INTEGER lpdwExitCode
>>>    LOCAL nRetunCode
>>>    nReturnCode = 0
>>> 	
>>>    IF GetExitCodeProc(tnProcessToCheck, @nReturnCode)  && HERE HERE
>>>
>>
>>Hi Selim,
>>
>>The declaration is wrong. It should be no '@' in front of INTEGER
>>
>>
>>    DECLARE SHORT GetExitCodeProcess IN WIN32API AS GetExitCodeProc ;
>>        INTEGER hProcess, ;
>>        INTEGER lpdwExitCode
>>
>>    IF (GetExitCodeProc(tnProcessToCheck, nReturnCode) != 259)
>>
>>Also, for NT based system when you want to terminate a process, you must first open the process and set permission to terminate then you can terminate it.
>
>Herman,
>
>I think you've still got it wrong. See Re: Acrobat/AcroRd.exe never kill process when closed Thread #888048 Message #888113 for illustration of correct declaration and usage of GetExitCodeProcess.
>
>Mike



Ooopss sorry. I didn't looked into the code I have <*g*>
You right. This is mine:
   Declare Long GetExitCodeProcess in Kernel32 ;
      Long hProcess, Long @nExitCode

   ll_Error = (GetExitCodeProcess(ln_hProcess, @ln_ExitCode) == 0)
   If !ll_Error and (ln_ExitCode != 259)
      *** Do something
   endif
Btw, I have looked into your code. I don't think it will wait if Acrobat is already running. Have you try that ?
Herman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform