コード例 #1
0
        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 webbrowser and others
            this.InitControls();

            //Global keyboardhook
            this.GBHook = new globalKeyboardHook(Process.GetCurrentProcess(), this);

            this.ClosingAllowed = false;
            this.DisableTaskmanager();
            Taskbar.Hide();
            this.Startup(true);
        }
コード例 #2
0
        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();
        }