Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tell if a service IS running
Message
 
To
02/02/2005 03:07:09
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00982963
Message ID:
00982976
Views:
18
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform