mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 21:15:38 +02:00
restore process priority 10 seconds after startup
This commit is contained in:
parent
4df563f1bb
commit
cad1ec393f
2 changed files with 10 additions and 12 deletions
|
@ -48,15 +48,6 @@ if not errorlevel 1 goto wait_to_finish";
|
|||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var process = Process.GetCurrentProcess();
|
||||
var process_priority = process.PriorityClass;
|
||||
process.PriorityClass = ProcessPriorityClass.High;
|
||||
var timer = new System.Threading.Timer(state =>
|
||||
{
|
||||
process.PriorityClass = process_priority;
|
||||
});
|
||||
timer.Change(10000, System.Threading.Timeout.Infinite);
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
|
@ -65,6 +56,15 @@ if not errorlevel 1 goto wait_to_finish";
|
|||
|
||||
pwp = new PersistentWindowProcessor();
|
||||
|
||||
var process = Process.GetCurrentProcess();
|
||||
pwp.processPriority = process.PriorityClass;
|
||||
process.PriorityClass = ProcessPriorityClass.High;
|
||||
var timer = new System.Threading.Timer(state =>
|
||||
{
|
||||
process.PriorityClass = pwp.processPriority;
|
||||
});
|
||||
timer.Change(10000, System.Threading.Timeout.Infinite);
|
||||
|
||||
bool splash = true;
|
||||
int delay_restart = 0;
|
||||
int relaunch_delay = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue