Resources | VB | Task List

Task List:


The following code will only work on Win9x platforms.
To read a discussion of how to do this with Windows NT/2k/NT, please read this thread from our message boards.

I received an e-mail recently asking if there was a way to hide a program's name from the Task List (the "Close Programs" box that comes up when you hit control-alt-delete while running windows).

There are a few reasons why you might want to do this, and I am presuming that you don't have any malicious intentions. Its conceivable that you might need to do this if you are running an executable that doesn't have any forms and is doing some important work in the background and you don't want a novice user to disable it.

Before installing this code in your VB application, make sure that there aren't any bugs in your code! This is very important, because the user will have a very difficult time trying to shut down your application if it begins raising errors. Also make sure that your application cleans up after itself -- make sure to clear up any memory its using. Otherwise you'll have a constant resource hog, and the user will not be able to find out the cause.

With that out of the way, here is the code you need.

For Visual Basic 6.0:



In older versions of Visual Basic (and in older versions of Windows), APP.TASKVISIBLE will not work properly.Instead, you need to make a few API calls to get the job done. This code will register your application as a SERVICE, hiding it from the task list.

First, put these declarations in a module:

Then, put this code in your form:



Related Links: Systray Icons


Want to discuss this article, or other development issues? Visit our message boards!

Or contact us directly with a comment or question on this article: click here !
armbrustconsulting.com