removing processes from the task list and the process list

Posted on 2004-11-06
Last Modified: 2010-05-02
In VB - is there a way to make it so that new executables don't show up in the task list or the processes list?

i.e. I want to build an ActiveX EXE to do some asynchronous method calls from my main exe - but I don't want the new ActiveX EXE to show up when a user goes control alt del and looks at either teh "applicaitons" tab or the "processes" tab.  How would I achieve this?
Question by:kenshaw
    LVL 10

    Accepted Solution

    hi kenshaw

    On Win9X/Me machines, it can be done by registering your application as service. Here are the declarations:

    Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
    Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long

    To register it:
    RegisterServiceProcess(GetCurrentProcessId, 1)

    To unregister it:
    RegisterServiceProcess(GetCurrentProcessId, 0)

    Since RegisterServiceProcess API is not available on NT based operating systems, if you try to use it on NT system you will get an error: Cant find Dll entry point.

    You may want to try using

    App.TaskVisible = False

    on WinXP it removes it from applications list, but it is still present in processes list.

    There is also another way to remove application from Applications list, but I am not sure on which OS is supported, so you would need to try it by yourself. The idea is to hide the window. At first thought, it should only remove it from taskbar, but it also removes it from Applications list (at least on WinXp does)...

    Const SW_HIDE = 0
    Const GW_OWNER = 4

    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

    ShowWindow GetWindow(hwnd, GW_OWNER), SW_HIDE

    As for removing it from processes list, It is a start for making viruses, so MS tried to make it secure as much as possible to show all processes. This makes this task very difficult to achieve, so it is a question if VB has the power to do this. If yes, then you should search for more info about hooking to NtQuerySystemInformation, redirect calls to your own call back function, so you could bypass the info about your process. Try to search on net about this, but I am not aware if there is some VB example of it.

    you can also try this link:
    LVL 10

    Expert Comment

    accept my answer...

    i feel i gave enough information...

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Mysql vs Oracle 10 106
    vb6 programatically bring window to front 8 47
    DIR issue 7 40
    Need VBS version of Excel date conversion 4 45
    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now