Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tell if a service IS running
Message
 
À
02/02/2005 03:07:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00982963
Message ID:
00982976
Vues:
17
Services run as processes in the task manager. Here a function that will create a cursor of running processes.
FUNCTION enumerateProcess
lcComputer = '.'
loWMIService = Getobject('winmgmts:' ;
    + '{impersonationLevel=impersonate}!\\' + lcComputer + '\root\cimv2')
colProcessList = loWMIService.ExecQuery ;
    ('Select * from Win32_Process')
Create Cursor Process (Name c(20),Id i,Thread i,pagefile i,pagefault i,workingset c(20))
Index On Name Tag Name
For Each loProcess In colProcessList
    Insert Into Process (Name,Id,Thread,pagefile,pagefault,workingset);
        VALUES (loProcess.Name,loProcess.ProcessID,loProcess.ThreadCount,loProcess.PageFileUsage,;
        loProcess.pagefaults,loProcess.WorkingSetSize)
Next
BROWSE normal
>Does anyone know if there is a way to tell if a "service" is already running under windows?
>
>
>
>Gary.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform