//private void startOnBoot()//run program as soon as system boots up again --> need to do //{ // RegistryKey rk = Registry.CurrentUser.OpenSubKey // ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); // if (_systemBoot) // rk.SetValue("Guest Control", Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)); // else // rk.DeleteValue("Guest Control", false); //} #region UI Button Events private void onActivateButtonClick(object sender, EventArgs a)//need to do { //start the actual Guest Control InternalProcessControl IPC = new InternalProcessControl(); IPC.setThreadStatus(InternalProcessControl.ThreadStatus.start); IPC.startProcessControl(); //Inform User GC is now running ActivateTextResult.Text = "Guest Control is now running!"; ActivateTextResult.Foreground = new SolidColorBrush(Colors.Green); ActivateTextResult.Visibility = Visibility.Visible; }
public ControlPanel() { //initialization InitializeComponent(); IPC = new InternalProcessControl(); //data entry field settings fetchProgramData(); ListModificationStatusLabel.Visibility = Visibility.Collapsed;//hide label on start up //event handling AddButton.Click += OnAddButtonClicked; RemoveButton.Click += OnRemoveButtonClicked; ActivateButton.Click += onActivateButtonClick; AddButtonRL.Click += AddButtonRL_Click; //prevent force kill check button PreventForceKillButton.Checked += onPreventForceKillButtonAction; PreventForceKillButton.Unchecked += onPreventForceKillButtonAction; SessionEndedEventHandler sessionEndedEvent = new SessionEndedEventHandler(ControlPanel_Closed); //background task check button BackgroundTaskButton.Checked += onBackgroundTaskButtonAction; BackgroundTaskButton.Unchecked += onBackgroundTaskButtonAction; //on window closing event //this.Closing += onUserClose; this.Closed += onUserClose; notifyIcon.DoubleClick += delegate(object sender, EventArgs args) { Show(); WindowState = WindowState.Normal; }; //Running Program List Box Initialization --> wdym? //BindingOperations.EnableCollectionSynchronization(RunningProgramList.ItemsSource, _syncLock); RunningProgramList.ItemsSource = _internalProcessList; //start the current process thread CPLThread = new Thread(() => constantCPLUpdateThread()); CPLThreadRunning = true; CPLThread.Start(); }