private void EnableKioskMode() { if (this.IsAdministrator() == false) { MessageBox.Show("This program can only run under an administrator account."); this.ClosingAllowed = true; this.Close(); return; } //Init exe, webbrowser and others this.InitControls(); //Global keyboardhook this.GBHook = new globalKeyboardHook(Process.GetCurrentProcess(), this); this.ClosingAllowed = false; this.DisableTaskmanager(); Taskbar.Hide(); this.Startup(true); }
public void DisableKiosMode() { this.ClosingAllowed = true; try { this.GBHook.unhook(); this.GBHook = null; this.EnableTaskManager(); Taskbar.Show(); this.Startup(false); } catch { MessageBox.Show("An error occured while restoring all settings."); } this.Close(); }