Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine all current Win process
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064064
Message ID:
01064286
Views:
199
Sergey,

This is great, I followed the link and I'm learning a lot, thanks for sharing this.
Do you know the property that holds the user running the process?, I'm looking back and forth and can't find it.
Also, VFP's Intellisense is not showing the "Terminate" method you used in your example or the "name" property I found in another sample in the WMI documentation for the process object, do you have a link where all of those properties and methods are listed?

TIA

Max

>It's Windows Management Instrumentation (WMI). See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp
>
>>this works - but why?
>>What is winmgmts://localhost/root/cimv2
>>I have no evidence that it is on the PC anywhere - I see no help in VFP, Win, nor IE ???
>>
>>
>>>
FUNCTION KillAcrobat()
>>>	loCIMV2		= GetObject("winmgmts://localhost/root/cimv2")
>>>	loProcesses	= loCIMV2.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'Acrobat.exe'")
>>>	IF loProcesses.Count > 0
>>>		For Each objProcess in loProcesses
>>>			objProcess.Terminate(0)
>>>		NEXT
>>>	ENDIF
>>>
>>>	RETURN
>>>ENDFUNC
>>>

...Y soy feliz, bien feliz, asi lo grito;
Mira, que el mundo sepa, que se sepa:
Soy feliz....                       

...And I'm happy, quite happy, so do I yell it;
Look, so the world knows it, so be known:
I'm happy...
 

Ismael Rivera "Oye cosita linda"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform