Solved

Pure Invisible & Hidden application

Posted on 2000-04-29
9
266 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
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 78
ODBC Connection Logging, ADO.NET 6 64
sum28 challenge 31 112
NotAlone Challenge 20 84
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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