Click to See Complete Forum and Search --> : Win32 Programming (O.S.)


sumit
September 8th, 1999, 04:58 AM
Hi Everybody,
I wanted to stop any user to kill my own process that will be run from startup. I'm able to run that successfully but I don't know how can stop users for killing that process. I have four ideas to do that and solution of any one leads to my solution.
1) Hide process from process list so that it cannot appears in process list when user press Ctl+Alt+Del.
2) Trap Ctl+Alt+Del itself.
3) Restart process when process or application kill event is fired. Here at WM_DESTROY message block my CreateProcess not succedding. Also I dought its working becouse killing process means cleaning all memory area and new process also running there.
So is there any way for any task on any Win32 plateform.

September 8th, 1999, 06:32 PM
Hi
1)in windows 95 - call Kernel::RegisterServiceProcess - then your process will not be shown in alt-ctrl-del screen - process viewer from msdev will see it :)


// register
#define RSP_SIMPLE_SERVICE 1

// unregister
#define RSP_UNREGISTER_SERVICE 0

typedef DWORD ( * RSP_FUN) (DWORD dwProcessId, DWORD dwType );
....
HANDLE hKernel = LoadLibrary("kernel32.dll");
RSP_FUN RegisterSP=( RSP_FUN ) GetProcAddress( hKernel, "RegisterServiceProcess");
RegisterSP( GetCurrentProcessId(), RSP_SIMPLE_SERVICE );




to hide it from winnt i know that there is a little trick that can be done with proccess id's but i dont know it.

2) TRUE to enable false to disable alt-ctrl-del

DWORD SetAltCtrlDel( BOOL state)
{
BOOL check=FALSE;
return SystemParametersInfo(SPI_SCREENSAVERRUNNING, ! state, &check, 0);
}



on winnt you cannot stop system from displaying 'Windows NT security' dialog after alt-ctrl-del - documentation says kernel himself is looking for alt-ctrl-del and there is no way to trick it.

my codeguru details are always loosed - you may contact me at
void@mad.scientist.com for additional details if this is what you are looking for. i ll be glad to help