コード例 #1
0
        public FormGUI()
        {
            InitializeComponent();

            settingsPicBox.MouseLeave += new EventHandler((sender, e) => settingsPicBox.BackColor = Color.FromArgb(0, 0, 0, 0));
            settingsPicBox.MouseEnter += new EventHandler((sender, e) => settingsPicBox.BackColor = Color.FromArgb(36, 93, 127));

            aFormDump     = new FormDump(this);
            aFormOptions  = new FormOptions(this);
            aFormRegistry = new FormRegistry(this);

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            byte[] fontData = Properties.Resources.GOTHIC;
            IntPtr fontPtr  = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length);

            System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length);
            uint dummy = 0;

            fonts.AddMemoryFont(fontPtr, Properties.Resources.GOTHIC.Length);
            AddFontMemResourceEx(fontPtr, (uint)Properties.Resources.GOTHIC.Length, IntPtr.Zero, ref dummy);
            System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr);

            fontData = Properties.Resources.GOTHICB;
            fontPtr  = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length);
            System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length);

            fonts.AddMemoryFont(fontPtr, Properties.Resources.GOTHICB.Length);
            AddFontMemResourceEx(fontPtr, (uint)Properties.Resources.GOTHICB.Length, IntPtr.Zero, ref dummy);
            System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr);

            SetAllControlsFont(Controls);

            //copy context menu
            ContextMenu contextMenu = new ContextMenu();
            MenuItem    menuItem    = new MenuItem();

            menuItem        = new MenuItem("Copy");
            menuItem.Click += new EventHandler(CopyAction);
            contextMenu.MenuItems.Add(menuItem);
            richTextBoxLogs.ContextMenu = contextMenu;

            FormRegistry.Load();

            if (FormRegistry.CheckForUpdate)
            {
                CheckUpdate();
            }

            titleLbl.Text += " " + Version;

            main = this;
        }
コード例 #2
0
        private void settingsPicBox_Click(object sender, EventArgs e)
        {
            FormOptions form = new FormOptions();

            form.Show();
        }