protected override void OnStart(string[] args) { try { ProcessProtection.Protect(); } catch (Exception e) { File.WriteAllText($"C:\\AutoSleep.log", e.Message + e.StackTrace); } }
private IntPtr[] GetChild(IntPtr hwd) { ProcessProtection manager = this; lock (manager) { CLD.Clear(); IntPtr zero = IntPtr.Zero; EnumChildWindows(hwd, new EnumWindProc(EnumChild), ref zero); return(CLD.ToArray()); } }
protected override void OnShutdown() { ProcessProtection.Unprotect(); base.OnShutdown(); }
private void SetupImpossible() { //everything from the previous level(s) SetupAdvanced(); ProcessProtection.Protect();//this will cause a bsod each time you kill the program }