How to hide a process from the control+alt+del box ( Windows 9x/Me )


There is a simple example on how to do it. You should use undocumented function RegisterServiceProcess( HANDLE hProcess, BOOL visible ) from kernel32.dll.
You can download this example here.

How does it wokrs:

First of all, you should create pointer to this function type definition, and variable of this type:

// RegisterServiceProcess function is used to register process
// in ctrl-alt-del box
// Input parameters: HANDLE hProcess - handle to process
// BOOL visible - visibility flag,

typedef void( APIENTRY * REGISTERSERVICEPROCESS )( HANDLE, BOOL );
REGISTERSERVICEPROCESS RegisterServiceProcess = NULL;

Then, you should use LoadLibrary to get handle to kernel32.dll and GetProcAddress to get pointer to RegisterServiceProcess:

// InitRegisterServiceProcess gets handle to kernel32.dll
// and address to RegisterServiceProcess function

BOOL InitRegisterServiceProcess()
{
   HINSTANCE hDll;
   hDll = LoadLibrary( "kernel32.dll" );
   RegisterServiceProcess = ( REGISTERSERVICEPROCESS )GetProcAddress( hDll, "RegisterServiceProcess" );
   if( RegisterServiceProcess == NULL )
      return FALSE;
   else
      return TRUE;
}

After executing InitRegisterServiceProcess, you can use RegisterServiceProcess, for example:

RegisterServiceProcess( 0, false ) // hide current process from the control+alt+del box
RegisterServiceProcess( 0, true ) // show current process in the control+alt+del box

Nickolsky Artyom, 2001

Hosted by uCoz