private IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wideParam, IntPtr longParam, ref bool handled) { var hotkeySetting = new EHotKeySetting(); switch (msg) { case HotKeyManager.WM_HOTKEY: int sid = wideParam.ToInt32(); if (sid == m_HotKeySettings[EHotKeySetting.插入题意]) { hotkeySetting = EHotKeySetting.插入题意; //TODO 执行插入题意操作 InsertTopicImage(); } else if (sid == m_HotKeySettings[EHotKeySetting.插入答案]) { hotkeySetting = EHotKeySetting.插入答案; //TODO 执行插入答案操作 insertAnswerPicAndAddOneToDB(); } //MessageBox.Show(string.Format("触发【{0}】快捷键", hotkeySetting.ToString())); handled = true; break; } return(IntPtr.Zero); }
IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handle) { var hotkeySetting = new EHotKeySetting(); if (msg == HotKeyManager.WM_HOTKEY) { int sid = wParam.ToInt32(); //全局快捷键要执行的命令 if (sid == m_HotKeySettings[EHotKeySetting.调用]) { hotkeySetting = EHotKeySetting.调用; //TODO 执行全屏操作 var win = MainWindow.CreateInstance(); win.Show(); win.WindowState = WindowState.Normal; } handle = true; } return(IntPtr.Zero); }
public static int GetHotKeySetting(EHotKeySetting key) { return(HotKeySettingsDic[key]); }