Results 1 to 13 of 13

Thread: Hook Teminate Process Api

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    23

    Hook Teminate Process Api

    Hello
    Friends
    Sorry For My Bad English
    I want to hook terminate process api and prevent my application to close by ctrl+alt+del
    any solution for vb6?
    thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Hook Teminate Process Api

    Hi soda120, welcometo VBForums!

    That sounds like a rather odd thing to do - why do you not want the user to have the ability to close your program?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    23

    Re: Hook Teminate Process Api

    I write a program with father-child technology . and my child must be real time checking of cpu (in a systematic center that i work) .then my child program must be open for ever. and i found that the hooking of terminate process can help me
    please help me
    and thnaks for your welcome to me.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Hook Teminate Process Api

    I very much doubt that you will be able to prevent the process being closed by the Task Manager. If you need it to be open throughout the duration of the session I would reccomend that you consider implementing it as a service instead.

  5. #5
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: Hook Teminate Process Api

    excuse me for my english, i'm italian

    in the form_unload subroutine or on command exit button insert End
    so it will close all forms that you have opened
    father and child

  6. #6
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    Re: Hook Teminate Process Api

    the end command terminates the program and all of its components in a very "Unclean" if you will mannor

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    23

    Re: Hook Teminate Process Api

    Quote Originally Posted by penagate
    I very much doubt that you will be able to prevent the process being closed by the Task Manager. If you need it to be open throughout the duration of the session I would reccomend that you consider implementing it as a service instead.
    What ?
    Please More help or a example .
    thanks my friend

  8. #8
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: Hook Teminate Process Api

    If the application is running on an XP machine MS has made provisions for this (I just recently learned) type of situation - simply disable the Task Manager with a registry setting. Oh, in case you lock yourself out of something playing with the settings in this area don't say I didn't warn you..I had to write a script to unlock some of this stuff!

    HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr
    What bug? That's not a bug. It's an undocumented feature!

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Hook Teminate Process Api

    Well apparently this is the "easiest" way to create an service in VB6.

    http://www.vbrad.com/pf.asp?p=source/tip_service_vb.htm

    If I was doing it myself I'd steer clear due to the use of an OCX control, which seems a bit of a clumsy way of doing it, but try it and see if it works for you. If it does then no problems

    I suggested a service as services cannot be closed using the task manager. They must be manually stopped using the Service snap-in in Computer Management.

  10. #10
    Junior Member
    Join Date
    Jun 2005
    Posts
    18

    Re: Hook Teminate Process Api

    you can hide your application from task manager with Hook NtQuerySystemInformation

    but it is very complicated, i have the source in c++ from www.codeproject.com

    with 2 project from this site, i made a DLL that can :
    - disable CTRL-ALT-DEL in win2k/xp
    - hide application from task manager
    - disable task manager
    - disable keys (alt-space, alt-tab, ctrl-esc, alt-esc, ctrl-shift-esc, win key, app popup key)


    ***EDIT***
    i made a much simpler version in vb6 without Hook
    but it remove all items in task manager list
    Attached Files Attached Files
    Last edited by sergelac; Nov 22nd, 2005 at 11:51 AM.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    23

    Re: Hook Teminate Process Api

    Thanks My Friends.
    I will test these and then come back
    thanks again

  12. #12
    Addicted Member
    Join Date
    Mar 2005
    Posts
    205

    Re: Hook Teminate Process Api

    sergelac sorry but that is a very bad idea altogether. What if the person has another taskmanager ? I know I do.

  13. #13
    Junior Member
    Join Date
    Jun 2005
    Posts
    18

    Re: Hook Teminate Process Api

    Quote Originally Posted by Cr250
    sergelac sorry but that is a very bad idea altogether. What if the person has another taskmanager ? I know I do.
    OMG
    your right, i just downloaded "security task manager"
    and it show my hidden program with Hook NtQuerySystemInformation

    but most people use the standard windows task manager
    Last edited by sergelac; Dec 2nd, 2005 at 05:56 AM.

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