private void Config_FormClosing(object sender, FormClosingEventArgs e) { Page = ConfigTabControl.SelectedIndex; if (!ResultOK) { // 退避した設定に戻す GHManager.Rollback(1); Skin.LoadSkinImages(); } else { for (int i = 0; i < ListViewShortcut.Items.Count; ++i) { if (ListViewShortcut.Items[i].ForeColor == Color.Red) { ConfigTabControl.SelectedIndex = 1; e.Cancel = true; ResultOK = false; return; } } // 現在の設定を保存 GHManager.UnregistHotKey(GHManager.Launcher.Handle); GHManager.RegistHotKey(GHManager.Launcher.Handle); GHManager.SaveSetting(); } GHManager.SaveClear(); }
/// <summary> /// ランチャーの読み込み時のイベント /// </summary> private void Launcher_Load(object sender, EventArgs e) { // タスクトレイに追加 AddNotifyIcon(); // マイセットアイコンの初期化&追加 MysetIcon = new GHIconEx(SkinImage.Myset_Open_Icon, SkinImage.Myset_Icon, FormType.Launcher); MysetIcon.control.MouseClick += (s, a) => { if (a.Button == MouseButtons.Left) { if (GHManager.MysetList.FormVisible) { GHManager.MysetList.MouseActive = false; GHManager.MysetList.MysetList_Hide(); } else { GHManager.MysetList.MouseActive = true; GHManager.MysetList.MysetList_Show(); } } }; Controls.Add(MysetIcon.control); // フック開始 if (!Dll.StartHook()) { Application.Exit(); } // ランチャーの位置・サイズを設定 Size = new Size(GHManager.Settings.Style.Launcher.Width, GHManager.Settings.Style.Launcher.Height); SetOffset(GHManager.Settings.Launcher.Offset); animateInfo = new GHAnimateInfo(GHManager.Settings.Animate.Launcher_DelayTime, GHManager.Settings.Animate.Launcher_AnimateTime, GHManager.Settings.Animate.Launcher_Slide, GHManager.Settings.Animate.Launcher_Fade); GHManager.RegistHotKey(Handle); // タイマー開始 DrawTimer.Start(); UpdateTimer.Start(); }