.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> General >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Simple Task Manage Like Application in VB.NET

Posted By:Hefin Dsouza       Posted Date: August 12, 2009    Points: 25    Category: General    URL: http://www.dotnetspark.com  
 

This is a Simple Task Manager like Application Created using the process Class.

You can use code from this application to implement in your own application.

This Application contains Code to Get the list of
1)Running Applications And Display Details In a List View:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ToolStripStatusLabel2.Text = Process.GetProcesses.Length.ToString
ListView1.Items.Clear()
For i = 0 To Process.GetProcesses.Length - 1
Try
ListView1.Items.Insert(i, Process.GetProcesses.GetValue(i).ProcessName)
tms = Process.GetProcesses.GetValue(i).TotalProcessorTime.Hours.ToString & ":" & Process.GetProcesses.GetValue(i).TotalProcessorTime.Minutes.ToString & ":" & Process.GetProcesses.GetValue(i).TotalProcessorTime.Seconds.ToString
ListView1.Items.Item(i).SubItems.Add(Process.GetProcesses.GetValue(i).ID)
ListView1.Items.Item(i).SubItems.Add(Process.GetProcesses.GetValue(i).PriorityClass.ToString())
ListView1.Items.Item(i).SubItems.Add(Process.GetProcesses.GetValue(i).SessionID.ToString)
ListView1.Items.Item(i).SubItems.Add(tms)
Catch ex As Exception
ListView1.Items.Item(i).SubItems.Add("N/A")
End Try
Next
End Sub

2)Kill Selected Process from the ListView :


Private Sub KillProcess(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Process.GetProcesses().GetValue(ListView1.SelectedItems(0).Index).kill()
Catch
MsgBox("Could Not Quit", MsgBoxStyle.OkOnly, "Skullz TaskViewer")
End Try
End Sub

3.Display or Hide only Selected Details from ListView:

Private Sub SelectedDetails(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
With ToolStripComboBox1
Try
If ListView1.Columns(.SelectedIndex).Width <> 0 Then
ListView1.Columns(.SelectedIndex).Width = 0
Else
ListView1.Columns(.SelectedIndex).AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize)
End If
Catch ex As Exception
End Try
End With
End Sub

Download the Full Application for Easier Reffrence
================================================================================
Regards Hefin Dsouza
 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend