Results 1 to 4 of 4

Thread: [RESOLVED] Creating a Task Manager

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    Pakistan
    Posts
    388

    Resolved [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.

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    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 ?

  3. #3
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Creating a Task Manager

    Also, why do you want to re-invent the wheel?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Creating a Task Manager

    Try this
    vb Code:
    1. Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
    2.  
    3. Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, _
    4. ByVal lParam As Long) As Long
    5.  
    6. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
    7. (ByVal hwnd As Long, _
    8. ByVal lpString As String, _
    9. ByVal cch As Long) As Long
    10.  
    11. Public Const MAX_LEN = 260
    12.  
    13. Public Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
    14.     Dim lRet As Long
    15.     Dim strBuffer As String
    16.    
    17.     If IsWindowVisible(hwnd) Then
    18.         strBuffer = Space(MAX_LEN)
    19.         lRet = GetWindowText(hwnd, strBuffer, Len(strBuffer))
    20.         If lRet Then
    21.             Form1.List1.AddItem Left(strBuffer & "  " & hwnd, lRet)
    22.         End If
    23.     End If
    24.    
    25.     EnumWinProc = 1
    26. End Function
    27.  
    28. Private Sub Command1_Click()
    29. Call EnumWindows(AddressOf EnumWinProc, 0)
    30. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width