Solved

Pure Invisible & Hidden application

Posted on 2000-04-29
9
271 Views
Last Modified: 2013-11-20
Is there a way to hide an application completely in Windows 95 and above?
I mean, hidden from taskbar, taskmon, the screen AND PROGRAM MANAGER!!

This is a tough one!
0
Comment
Question by:Aphroditus
9 Comments
 
LVL 1

Expert Comment

by:Rheingold
ID: 2762607
Hi

yes, there are ways to do that. Here is the Delphi source to hide your app from the task manager. Yeah, I know we're in MFC area here, but I just have this example and at least you know which API to use. I don't know if it works on Win2K or WinNT though.

Procedure StealthMode;
Var hNdl:hwnd;
    RegisterServiceProcess: TRegisterServiceProcess;
begin
        hNdl:=LoadLibrary('KERNEL32.DLL');                               // Load Library!!
        RegisterServiceProcess:=GetProcAddress(hNdl, 'RegisterServiceProcess'); // Find loc.
             RegisterServiceProcess (GetCurrentProcessID, 1);  // Into stealth mode
        FreeLibrary(hNdl);                                // Good programming practice
end;

Regards
0
 

Author Comment

by:Aphroditus
ID: 2762828
I don't understand this bit of code at all since its all Pascal...

Could you explain with C++ Windows API instead?
0
 

Author Comment

by:Aphroditus
ID: 2762843
I don't understand this bit of code at all since its all Pascal...

Could you explain with C++ Windows API instead?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:poohbear_68
ID: 2762952
Try this code.  It's translated from Rheingold's code.

   typedef UINT (CALLBACK* LPREGISTERSERVICEPROC)(DWORD,DWORD);

   HINSTANCE hDLL = LoadLibrary("KERNEL32.DLL");
   if(hDLL)
   {
      LPREGISTERSERVICEPROC lpRegisterServiceProc =
         (LPREGISTERSERVICEPROC)GetProcAddress(hDLL, "RegisterServiceProcess");

      if(!lpRegisterServiceProp)
      {
         // handle the error
      }
      else
      {
         // call the function
         DWORD dwRet = lpRegisterServiceProc(GetCurrentProcessId(), 1);
      }
     
      FreeLibrary(hDLL);      
   }
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2764141
Note that RegisterServiceProcess is an undocumented API--remember to heed all the caveats that go with using undocumented features. A lso, remember that the effect of the API is to allow an app to continue to run even after the user has logged off.

You can find a sample which hides an app using documented APIs by checking out the STEALTH.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ . (Note that my website will someday move to http://www.mooseboy.com/ )

..B ekiM
0
 
LVL 2

Accepted Solution

by:
JunHaan earned 142 total points
ID: 2777542
To actually hide your application from the windows Task Manager is simple, you'd just need to unregister your application's process service...
Here's some code you could follow :

first, declare some global variables and our function prototype :
void __fastcall reg(bool which); //function prototype

//Globals
typedef DWORD (WINAPI *TRegisterServiceProcess)(DWORD,DWORD);
bool registered=false;

then, insert this code anywhere in your app:
void __fastcall reg(bool which)
{
     HMODULE hmod;
     TRegisterServiceProcess pReg;
     hmod = LoadLibrary("kernel32.dll"); //Load kernel32.dll

     if (!hmod) return; //return if unable to load kernel32.dll
     (TRegisterServiceProcess) pReg = (TRegisterServiceProcess)::GetProcAddress(hmod,"RegisterServiceProcess"); //Get the process address to RegisterServiceProcess
     if (!pReg) {FreeLibrary(hmod); return;}
     else
     {
       if (which) pReg(0,1); //unregister our process  
       else pReg(0,0);
     }
     registered = true;
     FreeLibrary(hmod);
   }

then override your application's initialization routine and add :

reg(true);

This will partially hide your application from the task manager. Your application will still be visible if a process viewer is used(like the one included with Microsoft Visual Studio 6.0) and that's another story...

Hope this helps.
0
 

Author Comment

by:Aphroditus
ID: 2777567
thanks man!
0
 

Author Comment

by:Aphroditus
ID: 2777586
thanks man!
0
 

Expert Comment

by:rvr2k1
ID: 9106738
how about hiding the application from the task manager for window nt/xp?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
ODBC Connection Logging, ADO.NET 6 69
Doc'in system (example?) BA 7 115
Bartender label printing - switch on and off graphics 3 54
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

860 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