Jump to content
Sign in to follow this  
Azu

Toggle a process on and off with a hotkey/function

Recommended Posts

nfwu

HotKeySet("^+a", "_kill")
Global $var = 0
Func _kill()
    If ProcessExists("explorer.exe") Then
        ProcessClose("explorer.exe")
        $var = 1
    ElseIf $var = 0
        Run("explorer.exe")
        $var = 1
    Else
        $var = 0
    Endif
EndFunc

HotKeySet("^+a", "_kill")
HotKeySet("^+s", "_live")
Func _live()
Run("explorer.exe")
EndFunc
Func _kill()
ProcessClose("explorer.exe")
EndFunc

Hope one of these helps

#)

Edited by nfwu

Share this post


Link to post
Share on other sites
PartyPooper

As ppl have said, Explorer is set to automatically restart on failure. If you use the taskmanger if will shutdown explorer without it restarting automatically. The only way I have got around this auto-restarting is to use a different shell. This requires you to write to the registry twice (once to point to the new shell and second time to point back to Explorer when you are finished gaming). I'm currently working on AIGameShellXP which does just this on-the-fly (it's a modified version of FastGaming which is used as the Windows Shell). I'm also planning to use this method for my nightly maintenance routine so less things are locked for defragging and cleaning purposes (just gotta get time to add it in).

Edit: typo's

Edited by PartyPooper

Share this post


Link to post
Share on other sites
PartyPooper

Google 'Windows Shell' and heaps will come up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×