OK, I've given up searching...
I want to list the processes for ALL USERS in the Task Manager
Thanks
Printable View
OK, I've given up searching...
I want to list the processes for ALL USERS in the Task Manager
Thanks
This will give you a list of all current processes. Is this what you want?VB Code:
'in a module Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Public Const MAX_LEN = 260 Public Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long Dim lRet As Long Dim strBuffer As String If IsWindowVisible(hwnd) Then strBuffer = Space(MAX_LEN) lRet = GetWindowText(hwnd, strBuffer, Len(strBuffer)) If lRet Then Form1.List1.AddItem Left(strBuffer & " " & hwnd, lRet) End If End If EnumWinProc = 1 End Function 'on a form Private Sub Command1_Click() Call EnumWindows(AddressOf EnumWinProc, 0) End Sub
Hmm... not sure because it didn't workQuote:
Originally Posted by Hack
It pointed me in teh rigtdirection though and I found this:
http://www.vbforums.com/showthread.php?t=341153
Which is EXACTLY what I want :thumb:
Thanks!