CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: hide my process

  1. #1
    Join Date
    May 2008
    Posts
    18

    Question preventing to kill application

    Hi all,

    I want some idea...how should i prevent my VB application to be killed from the task manager.

    I want my application always running....and if it is killed from task manager...Another instance of this application automatically executes.

    Cam you Please help me...or Can you please tell me if any event is fired when application's exe is killed from task manager.

    I have tried this with QueryUnload and Unload event...but it do not work.

    Please provide me some solution for the problem.

    Thanks in advance,

    Ruhii.

  2. #2
    Join Date
    Dec 2006
    Location
    Pune, India.
    Posts
    579

    Re: preventing to kill application

    If you want, your app should run all the time then make it Windows Service.

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: preventing to kill application

    What kind of program are you making? If the user can't kill it, then what if it messes up? Then what? Reboot?


    Use a Windows Server, and only allow one app in Terminal Server mode, and they'll get logged off if they kill the app.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: preventing to kill application

    To add to what Shaikh.Riyaz.a said...

    You will have to make a service that is run as administrator. Search Google. It will return many results on how to make a service in Visual Basic 6.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: preventing to kill application

    Or maybe have proper rights set-up on the system for the users. After all Network administrators know how to do this, they should be able to help you out.

  6. #6
    Join Date
    May 2008
    Posts
    18

    Question Re: preventing to kill application

    can u please suggest me some other solution except making it a service?? Because of some reason i cannot make my application a service.. Can u please tell me what event is fired when an application's exe is killed from task manager so that i can restart my application at that event.

    Thanx
    Ruhii

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: preventing to kill application

    Quote Originally Posted by dglienna
    What kind of program are you making? If the user can't kill it, then what if it messes up? Then what? Reboot?


    Use a Windows Server, and only allow one app in Terminal Server mode, and they'll get logged off if they kill the app.

    Not sounding good
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    May 2002
    Posts
    10,943

    Re: preventing to kill application

    Quote Originally Posted by Ruhii
    Can u please tell me what event is fired when an application's exe is killed from task manager so that i can restart my application at that event.
    Um...if your application is killed, what other application are you going to use to tell that it isn't running??? There isn't an event fired...it's the absence of an event because it isn't running.

    Creating a service truly is the only pure solution to this problem.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  9. #9
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: preventing to kill application

    Quote Originally Posted by Ruhii
    can u please suggest me some other solution except making it a service?? Because of some reason i cannot make my application a service.. Can u please tell me what event is fired when an application's exe is killed from task manager so that i can restart my application at that event.

    Thanx
    Ruhii
    The proper solution to your problem is present in Post # 5 and Post # 2. You can choose either of the two.

  10. #10
    Join Date
    May 2008
    Posts
    18

    Question Re: preventing to kill application

    I can make a service for windows xp/9X but how can i make the services in vista...???

  11. #11
    Join Date
    May 2002
    Posts
    10,943

    Re: preventing to kill application

    Creating a service in Vista is the same as XP. The only difference is that you need to run cmd.exe as an administrator in Vista. Then, all you need is sc.exe.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  12. #12
    Join Date
    May 2008
    Posts
    18

    Exclamation Re: preventing to kill application

    thanx a lot.

    But can u please tell me how this can be done through VB code??

  13. #13
    Join Date
    May 2002
    Posts
    10,943

    Re: preventing to kill application

    A service is just an application.

    http://www.daniweb.com/forums/thread85237.html

    EDIT: Note that sc.exe is used to install applications as services. You don't just make a service from VB6. You create an application, and then install it as a service.
    Last edited by PeejAvery; May 7th, 2008 at 07:35 AM.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  14. #14
    Join Date
    Dec 2006
    Location
    Pune, India.
    Posts
    579

    Re: preventing to kill application

    Try this:

    1) Create new exe different from your application.
    2) Use timer control in it.
    3) In timer event fire following query using script.

    Code:
       SELECT Name FROM Win32_Process WHERE Name = 'MyApp.exe'
    4) Is nothing is returned then it means that you need to restart your application, Otherwise your app is running.


    But here again if this exe is killed then there is no way to restart app.

    So the better way would be to create service app. But this trick just came to my mind!

  15. #15
    Join Date
    May 2008
    Posts
    18

    Question Re: preventing to kill application

    Thanks for ur Help.
    Can u tell me that making an application a service will work in vista or not??

    Is there any way to hide the process from task manager process list??

    I found an activeX control called win padlock which hide my Vb application from task manager but it is not working in Vista.

    So basically i m facing this problem that how to prevent my process to be killed or to remove it from process list in all Windows OS including Vista??

Page 1 of 2 12 LastLast

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