WTSEnumerateProcess populates a WTS_PROCESS_INFO structure with information pertaining to running processes on the specified host. If the hServer parameter is set to WTS_CURRENT_SERVER_HANDLE, this will run against the host which is running the software.
oLocator := CREATEOBJECT( "wbemScripting.SwbemLocator" )
oWMI := oLocator:ConnectServer()
query user [<username> | <sessionname> | <sessionID>] [/server:<servername>]
local PID, SID
local oList, oProc
oList:= oWmi:ExecQuery( "select * from Win32_Process'" )
for each oProc in oList
PID:=oProc:ProcessId
SID:=oProc:SessionId
exit
next
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 70 guests