AutoHotkey Community

It is currently May 27th, 2012, 1:35 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ProcToggle.ahk
PostPosted: May 6th, 2009, 9:33 pm 
Offline

Joined: May 6th, 2009, 8:28 pm
Posts: 1
Location: Lufkin, TX
Greetings everyone,

Code:
;ProcToggle.ahk-

;This is a (very simple) script I wrote to toggle
;whether or not a process is running with one
;button.  I needed a way to free RAM and
;increase visible screen size for my eeePC
;by killing explorer before i run specific
;apps/games, and then be able to switch
;it back on afterward.  This can be applied to
;any process.
;Hope someone will find this useful.




theProc := "explorer"
;The name of the process to be toggled on-off by the following hotkey script.


procExist(ProcName)
{
     DetectHiddenWindows, On
     Process, Exist, %ProcName%.exe
     Return %ErrorLevel%
}
;This function determines whether or not a process is currently running.


F9::
;Hot Key.

if procExist(theProc) <> 0
{
     Process, Close, %theProc%.exe
}
     Else
{
     Run %theProc%
}
;Kill the process if it is running, and start it if it isn't.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2009, 5:33 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Thanks bgeraghty.

I got tired of wmplayer.exe repeatedly (and non-stop) scanning my flashdrive. This wa just what I needed.

BTW, anyone know how to configure wmplayer to stop auto-scanning.
I've got Vista-32

Thanks in anvance.
Leef_me


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group