Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if process is running in Windows NT
Message
De
13/02/2004 18:07:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00877304
Message ID:
00877330
Vues:
15
What API call I should use for this in NT ?

Or is there some other method to determine if Apache server is running
in NT (my appl does not know the web server port) ?

>Andrus,
>
>The CreateToolhelp32Snapshot API function is not supported under WinNT.
>
>>I want to determine if Apache server if running in Windows NT.
>>I try to use Nadya Nosonovsky code from 04/12/2002 Message ID:729491
>>
>>?ProcessIsRun('Apache')
>>
>>In Windows NT 4.0 DECLARE command in this code causes error
>>
>>cannot find entry point CreateToolhelp32Snapshot in the dll
>>
>>How to create a code which works in NT also ?
>>
>>
>>Function ProcessIsRun
>>Lparameters lcProcName
>>
>>Declare INTEGER CreateToolhelp32Snapshot IN Win32api INTEGER dwFlags, INTEGER th32ProcessID
>>Declare INTEGER Process32First IN Win32api INTEGER lhSnapshot, STRING lppe
>>Declare INTEGER Process32Next IN Win32api INTEGER lhSnapshot, STRING lppe
>>Declare INTEGER CloseHandle IN kernel32 INTEGER hObject
>>
>>Local lnRetCode, lppe, lhSnapshot
>>
>>lcProcName = UPPER(lcProcName)
>>lppe = CHR(44) + CHR(1) + REPLICATE(CHR(0), 298)
>>
>>lhSnapshot = CreateToolhelp32Snapshot(2, 0)
>>lnRetCode = Process32First(lhSnapshot, @lppe)
>>
>>Do WHILE lnRetCode <> 0
>> If lcProcName $ UPPER(SUBSTR(lppe, 37, 256))
>>   lnRetCode = 1
>>   Exit
>>   Endif
>>  lnRetCode = Process32Next(lhSnapshot, @lppe)
>>  Enddo
>>CloseHandle(lhSnapshot)
>>Return lnRetCode
>>
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform