A Task Manager Tutorial

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
7 posts Page 1 of 1
Was this usefull?

No votes
Oh Yea!
50%
Yes
3
33%
Kinda
2
No votes
Not Really
17%
No
1
No votes
Not even close!!!

Total votes: 6

Contributors
User avatar
dradra43
New Member
New Member
Posts: 13
Joined: Sat Nov 06, 2010 9:56 pm

A Task Manager Tutorial
dradra43
Level = ★☆☆☆☆

Hello, I hope all of you are having a good day. To begin I wanna say thanks, to everyone on the forum, for showing me how to code better! cooll;

Lets begin now, first create a new project, in this lets name it... Task Manager
On your form, you'll need
  • 1 list box
    2 buttons
Name button1: TaskRefresh

Name Button2: TaskKill

Keep listbox1 the same name.

Now, re-decorate your form, anchor stuff were you want it, do whatever.

Now it is time for coding!
Above the public class form1 code paste this:
Code: Select all
Imports System.IO
In the TaskRefresh_click code:
Code: Select all
GetProcesses()
TaskKill_Click code:
Code: Select all
KillProcess()
        GetProcesses()
You should have NOTHING but error's but thats ok
Time for the next code.

Above 'End CLass' paste this:
Code: Select all
    Public Sub GetProcesses()
        ListBox1.Items.Clear()

        Dim p As Process
        For Each p In Process.GetProcesses
            ListBox1.Items.Add(p.ProcessName)
        Next
    End Sub
    Public Sub KillProcess()
        Try
            Dim p As Process

            For Each p In Process.GetProcesses
                If p.ProcessName = ListBox1.SelectedItem Then
                    p.Kill()
                End If
            Next
            GetProcesses()
            MsgBox("You just killed your sected item", vbOKOnly, "Worked")
        Catch ex As Exception
            MsgBox("Failed to close due to administrator rights!")
        End Try
    End Sub
Thank you all, have good day/morning/night. Cya next time coder's!
Image
Last edited by dradra43 on Sun Dec 05, 2010 8:00 am, edited 3 times in total.
Image
Image
Image
~VB CODER~
User avatar
dradra43
New Member
New Member
Posts: 13
Joined: Sat Nov 06, 2010 9:56 pm

It is easy to do, but the actual code is advancd...
Happy coding
Image
Image
Image
~VB CODER~
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Advanced how?
User avatar
dradra43
New Member
New Member
Posts: 13
Joined: Sat Nov 06, 2010 9:56 pm

mandai wrote:
Advanced how?
Its easy for YOU to do, it was advanced for the coding... I was gonna make everyone code it themselves, and thats why i put advanced. But it works just like default task manager. It kills items, and does everything the real one does.
Image
Image
Image
~VB CODER~
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: A Task Manager Tutorial
Agust1337
Dradra43, Don't mind Mandai he comes up with these comments.
Top-notch casual Dating
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: A Task Manager Tutorial
mandai
I think a better term may be do-it-yourself but I understand what he means now.
User avatar
VBCoder101
Just Registered
Just Registered
Posts: 1
Joined: Sun Dec 05, 2010 3:02 am

Re: A Task Manager Tutorial
VBCoder101
THANKS! This was my first program! It was very easy to understand! YOU ROCK!
Image
Image
7 posts Page 1 of 1
Return to “Tutorials”