示例#1
0
 protected override void OnStart(string[] args)
 {
     try
     {
         ProcessProtection.Protect();
     }
     catch (Exception e)
     {
         File.WriteAllText($"C:\\AutoSleep.log", e.Message + e.StackTrace);
     }
 }
示例#2
0
            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());
                }
            }
示例#3
0
 protected override void OnShutdown()
 {
     ProcessProtection.Unprotect();
     base.OnShutdown();
 }
示例#4
0
 private void SetupImpossible()
 {
     //everything from the previous level(s)
     SetupAdvanced();
     ProcessProtection.Protect();//this will cause a bsod each time you kill the program
 }