5,696,576 members and growing! (18,351 online)
Email Password   helpLost your password?
Languages » VB.NET » Utilities     Intermediate License: The Code Project Open License (CPOL)

A Process viewer with alert notification

By ashu fouzdar

Simple process viewer that is capable of setting alerts for process events.
VB (VB 9.0, VB), .NET (.NET, .NET 2.0), WinForms, SysAdmin, Dev

Posted: 20 May 2008
Updated: 20 May 2008
Views: 7,112
Bookmarked: 20 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
Prize winner in Competition "Best VB.NET article of May 2008"
17 votes for this Article.
Popularity: 4.69 Rating: 3.81 out of 5
3 votes, 17.6%
1
1 vote, 5.9%
2
2 votes, 11.8%
3
2 votes, 11.8%
4
9 votes, 52.9%
5

Introduction

In this article, I would like to showcase a small utility which I developed for keeping track of
some process management tasks using a pleasant user interface. The bare idea I had in mind
was to develop a utility which can sit in the system tray and provide a mechanism to keep track of process startups and shutdowns and show the alert using some UI dialog. The utility being
developed is based on the mechanism of WMI architecture. It uses WMI to query process list, and to set process event handler.

So, now let’s start exploring the tour of this utility. Download and extract the source with this
article. You will find one executable ProcessViewer.exe. Start the executable. The startup
screen will look alike as follows:

Clipboard01.gif

The initial dialog as shown above displays all running process list with some basic details about
their memory usage, processor time allocated, no. of threads, process startup time, and most
important process ID.

Now, the main use of this utility comes into picture i.e. setting a process alert. For setting a
process alert select a process from display process list, by click the process name, or you can
enter a process executable if you want to set alert for process which is not started yet. After
selecting or inputting the process details the main window look like as follows:

Clipboard02.gif

In above displayed dialog, and alert has been set for calc.exe i.e. calculator utility for Windows.
As you may notice the calculator utility has not yet started, but the alert has been set.

Now, go to Start>Run, Type calc and press Enter.

The calculator utility will start, and the alerts will popup in System tray, as shown below.

Clipboard03.gif

As you have seen alert has shown that process is started, now close the Calculator application and wait to see, what will happen. You will be greeted with Process shutdown alert as shown below:

Clipboard04.gif

The utility I discussed above is just in preliminary stage, I will enhance it as I will get used to it, but for now it is proper showcase of how to use WMI architecture to leverage the process event monitoring. This simple utility can be extended to shoot up mails for process shutdown/startups and can be very useful for Administrators.

Background

The utility shown in this article uses WMI architecture for implementation. Basic familiarity with WMI is required to understand the code submitted with article. One may have a look into other contributions on CodeProject as listed follows:

PS: This article having no relation with above mentioned contributions, one may use above for
getting some basic introduction to WMI.

History

Initial Revision 1.0 : By Ashu Fouzdar on May 21 2008.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

ashu fouzdar


Ashu has done Masters in Software Engineering from UPTU Lucknow, India. with merit rank. Currently he is working as Software Engineer in Software Product Development company at Bangalore(India) for 2+ years. He started to code with PASCAL, then moved to C and finally got into VB 5.0. He is currently working with VB.NET, C#, SQL Server and Perl(Occasionally but some time). He loves to works for Tool development and System Integration, and his favorite is VB. He is advocate of Open source and loves to share solutions with open source communities like nHibernate, SubSonic, SourceForge.

Award's :
Prize winner in Competition "Best VB.NET article of May 2008"

Ashu' Articles :
Click to see my CodeProject Articles

Ashu's Blog :
Share a solution | Explore the .NET world

Ashu's Favorite :
nHibernate - The best ORM.
nHibernate Contributed Tools
SubSonic - Best Auto generated DAL.


Click to send me your wishes :ashufouzdar@.in.com

Occupation: Software Developer
Company: Freelance Developer
Location: India India

Other popular VB.NET articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
GeneralThanks bromemberMember 38214721:38 4 Oct '08  
QuestionGreat IdeamemberBeLHold4:40 27 May '08  
AnswerRe: Great Ideamemberdnpro2:27 3 Jun '08  
GeneralRe: Great Ideamemberabhi13100:58 24 Jun '08  
General[Message Removed]memberMojtaba Vali1:53 25 May '08  
GeneralThanks !!!member377988620:46 21 May '08  
Generalsimply greatememberAbhijit Jana20:07 21 May '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 May 2008
Editor: Chris Maunder
Copyright 2008 by ashu fouzdar
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project