forked from xarzhi/iClick
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKey_Select.h
More file actions
61 lines (52 loc) · 1.42 KB
/
Copy pathKey_Select.h
File metadata and controls
61 lines (52 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include "afxdialogex.h"
#include "resource.h"
#include "pch.h"
#include "iClickDlg.h"
// Key_Select 对话框
class Key_Select : public CDialogEx
{
DECLARE_DYNAMIC(Key_Select)
public:
Key_Select(CWnd* pParent = nullptr); // 标准构造函数
virtual ~Key_Select();
DWORD m_dwHotkey = 0;
virtual void OnFinalRelease();
HotKeyInfo m_hotKeyInfo;
virtual BOOL PreTranslateMessage(MSG* pMsg) {
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
m_hotkey.SetHotKey(VK_ESCAPE, 0); // 虚拟键码为VK_ESCAPE,修饰符为0
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) {
m_hotkey.SetHotKey(VK_RETURN,NULL);
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_BACK) {
m_hotkey.SetHotKey(VK_BACK,NULL);
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_SPACE) {
m_hotkey.SetHotKey(VK_SPACE,NULL);
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB) {
m_hotkey.SetHotKey(VK_TAB,NULL);
return TRUE;
}
return CDialogEx::PreTranslateMessage(pMsg);
}
virtual void OnOK();
CString ConvertToDisplayString();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_KEYSELECT };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
public:
CHotKeyCtrl m_hotkey;
private:
};