CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Ahmedabad, India
    Posts
    30

    Win32 Programming (O.S.)

    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.



  2. #2
    Guest

    Re: Win32 Programming (O.S.)

    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
    [email protected] for additional details if this is what you are looking for. i ll be glad to help




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured