From: Karl E. Peterson on 16 Nov 2009 18:33 Bu wrote: >>>> I go for Larry's solution. Just wondering why you can ue it only in >>>> your own code. >>>> Bu >>>> >>> > Allthoug my program will be used in a small group i changed my program > based on Mike's suggestion. > Everybody thanks on your comments > Bu ALWAYS(!) use the code that you have the most control over. NEVER(!) introduce unnecessary dependencies. -- ..NET: It's About Trust! http://vfred.mvps.org
From: Eduardo on 18 Nov 2009 15:17 mayayana escribi�: > On top of that, WMI is slow, bloated, and really > provides little of interest other than system info. > It has Windows Installer functions that are just an > inferior wrapper around existing WI APIs. It has > Registry functions that are poorly designed and > superfluous if you have the Registry API. Etc. I agree. But in a program I had to use it because I didn't find how to do something with API. I needed to find if an exe is running in other users sessions (other than the CU). And I wanted the username of who's running the process. The code that I had to use is (main part): Dim iProcess As Object Dim iProcesses As Object Dim iUser Dim iDomain Set iProcesses = GetObject("winmgmts:") _ .ExecQuery("SELECT ExecutablePath, " & _ "ProcessId from win32_process") For Each iProcess In iProcesses iProcess.GetOwner iUser, iDomain Debug.Print iUser Debug.Print iDomian Debug.Print iProcess.ExecutablePath Debug.Print iProcess.ProcessId Next iProcess
First
|
Prev
|
Pages: 1 2 3 Prev: will FileLen give an error on very large files? Next: Freehand Lasso |