Exemplo n.º 1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            this.Icon = IconManager.GetIcon("shell32.dll", 39, true);

            if (!System.IO.File.Exists(Installer.GetMenu98Path()))
            {
                Installer.ShowInstaller(this);
            }


            if (WinVer.IsWin10OrGreater())
            {
                Win10Style.EnableBlur(this.Handle);
            }
            else
            {
                checkBoxNoExplorerImmersiveMenu.Enabled = false;
                checkBoxEnableImmersiveMenu.Enabled     = false;
                checkBoxShowIcon.Enabled         = false;
                checkBoxHideToggleOption.Enabled = false;
            }

            if (WinVer.IsVistaOrGreater())
            {
                //DPI.SetCurrentProcessDPIAware();
                Win7Style.EnableAero(this.Handle, panelExtended.Height, panelMain.Bottom, 0, 0);
                toolStrip.Renderer = new ToolStripNonClientRender();
            }
            else
            {
                toolStrip.Renderer      = new ToolStripNonClientRender(SystemColors.Control);
                toolStrip.Location      = new Point(toolStrip.Location.X, toolStrip.Location.Y - 1);
                this.FormBorderStyle    = FormBorderStyle.FixedSingle;
                this.ControlBox         = true;
                this.Height            -= panelMain.Location.Y;
                this.panelMain.Location = new Point(panelMain.Location.X, 0);
                this.Text = labelCaption.Text;
            }

            panelFrameB.Visible = false;
            panelFrameT.Visible = false;
            panelFrameR.Visible = false;
            panelFrameL.Visible = false;

            pictureBoxAppIcon.BackgroundImage = this.Icon.ToBitmap();


            contextMenuStrip.Renderer = new ToolStripNonClientRender();

            comboBoxStyle.SelectedIndex = 0;

            FormUtils.ShowShield(buttonUpdateStartupCommand.Handle, true);
            FormUtils.ShowShield(buttonRemoveStartUp.Handle, true);

            for (int i = 0; i <= MenuControl.OSList.Length; i++)
            {
                comboBoxSysVer.Items.Add(MenuControl.GetOSFromIndex(i));
            }
            comboBoxSysVer.SelectedIndex = MenuControl.Os2ListIndex(WinVer.SystemVersion);

            checkBoxNoExplorerImmersiveMenu.Checked = Installer.ExplorerImmersiveMenuRemoved();


            if (System.IO.File.Exists(Installer.GetConfigPath()))
            {
                XML_Load(Installer.GetConfigPath());
            }
            else
            {
                switch (Installer.ShowSelectConfigFileBox(this))
                {
                case DialogResult.Yes:
                    Installer.DeployDefaultConfigFile();
                    XML_Load(Installer.GetConfigPath());
                    break;

                case DialogResult.No:
                    if (!OpenConfigUsingDialog())
                    {
                        this.Close();
                    }
                    break;

                case DialogResult.Cancel:
                    this.Close();
                    break;
                }
            }
        }
Exemplo n.º 2
0
 private void buttonUninstall_Click(object sender, EventArgs e)
 {
     Installer.LaunchUninstall(this);
 }
Exemplo n.º 3
0
 private void buttonLoadSysCfg_Click(object sender, EventArgs e)
 {
     XML_Load(Installer.GetConfigPath());
 }
Exemplo n.º 4
0
 private void buttonInstall_Click(object sender, EventArgs e)
 {
     Installer.ShowInstaller(this);
 }