AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Instant process priority alteration

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Fri Aug 20, 2004 6:51 pm    Post subject: Instant process priority alteration Reply with quote

To instantly give an application more CPU time to make it faster, or to make it a low priority so as it uses CPUonly when its available use this script.

I used to alter priorities for tasks like Divx compression, making it low priority and using my computer normally so as to allow it to use only freely available CPU time and not hog it when its required by other active tasks.

call it using a hotkey from your 24/7 script or turn it into a hotkey function.
(uses the new process cmd)

Code:

; allows cmd line params to be sent
; script.ahk PID

IfEqual, 1,, WinGet, curr_pid, PID, A
Else SetEnv, curr_pid, %1%

       
Menu, priority, add, Realtime, Change_Priority
Menu, priority, add, High, Change_Priority
Menu, priority, add, Above Normal, Change_Priority
Menu, priority, add, Normal, Change_Priority
Menu, priority, add, Below Normal, Change_Priority
Menu, priority, add, Low, Change_Priority
Menu, priority, add       
Menu, priority, add, Kill Process, Kill_Process

Menu, priority, show       

Exit

Change_Priority:
        StringLeft, new_priority, A_ThisMenuItem, 1
        Process, Priority, %curr_pid%, %new_priority%
Return

Kill_Process:
        Process, Close, %curr_pid%
Return

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group