[RESOLVED] Creating a Task Manager
I want to create a task manager just like the regular task manager of the windows. It should display all the running application processes and one should be able to close any process. If you offer me the code its nice and if you offer me information how to make it, it would be nicer.
Re: Creating a Task Manager
How to retrive all the running process, how to end a process, how to obtain process inforamtion etc are already talked in the forum many many time.
can you please search the forum using key words like "Retrive Process" , "Running Process" "End Process" etc ?
Re: Creating a Task Manager
Also, why do you want to re-invent the wheel? :confused:
Re: Creating a Task Manager
Try this
vb Code:
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
Private Sub Command1_Click()
Call EnumWindows(AddressOf EnumWinProc, 0)
End Sub