Пример #1
0
 public static void ProcessApplication()
 {
     try
     {
         try
         {
             ProcessCmd.InstallFont();                  //安装字体
             ProcessCmd.HideWindowDesk();               //隐藏桌面
             ProcessCmd.HideLogicalDriver();            //隐藏驱动器
             ProcessCmd.NoUsedTaskMgrForm();            //关闭任务管理器
             if (ProcessCmd.SetSystytemLoadShell())     //设置启动项目
             {
                 ProcessCmd.SetProcessAutoStart(false); //删除重启项目
             }
             else
             {
                 ProcessCmd.SetProcessAutoStart();//如果设置失败就设置自动启动
             }
         }
         finally
         {
             Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
             Application.ThreadException += Application_ThreadException;
             Application.ApplicationExit += Application_ApplicationExit;
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             keyPad1    = new UI.Ctr.KeyPad();
             keyMessage = new KeyMessageFilter();
             Application.AddMessageFilter(keyMessage);
             Common.LoadSysConfigFile();
             Application.Run(new MainForm());
             Application.RemoveMessageFilter(keyMessage);
             keyPad1.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         Common.SystemExit(true, false);
     }
     finally
     {
     }
 }
Пример #2
0
 private void ButtonEx3_Click(object sender, EventArgs e)
 {
     ProcessCmd.SetSystytemLoadShell(true);
 }