Solved

Pure Invisible & Hidden application

Posted on 2000-04-29
9
259 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
Comment Utility
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
Comment Utility
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
Comment Utility
I don't understand this bit of code at all since its all Pascal...

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

Expert Comment

by:poohbear_68
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 11

Expert Comment

by:mikeblas
Comment Utility
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
Comment Utility
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
Comment Utility
thanks man!
0
 

Author Comment

by:Aphroditus
Comment Utility
thanks man!
0
 

Expert Comment

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop error 4 76
ADO Memory leak with DELPHI 2007 37 153
how to monitor remote shell execution on linux 9 92
while loop over for loop 7 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

10 Experts available now in Live!

Get 1:1 Help Now