📄 readme.wzd
字号:
/////////////////////////////////////////////////////////////////////
// To Prompt User for Hotkey...
/////////////////////////////////////////////////////////////////////
// 1) Use Dialog Editor to add a Hotkey control to your dialog template.
//
// 2) Use ClassWizard to add a Hotkey control member variable to this
// dialog template's dialog class.
//
// 3) Use the following to get the hotkey key codes from the Hotkey control:
WORD m_wVkCode;
WORD m_wModifier;
m_ctrlHotKey.GetHotKey(m_wVkCode,m_wModifier);
/////////////////////////////////////////////////////////////////////
// To Register Hotkey to Activate Application...
/////////////////////////////////////////////////////////////////////
// 1) Send a WM_SETHOTKEY message to the main window:
AfxGetMainWnd()->SendMessage(WM_SETHOTKEY,(WPARAM)MAKEWORD(m_wVkCode,m_wModifier));
/////////////////////////////////////////////////////////////////////
// To Register Hotkey to Send a WM_HOTKEY Message to a Specified Window...
/////////////////////////////////////////////////////////////////////
// 1) Use RegisterHotKey(), but first translate the key modifier returned by
// GetHotKey() into a value that RegisterHotKey() can use:
// must translate hot key control's returned modifier to RegisterHotKey format
UINT mod=0;
if (m_wModifier&HOTKEYF_ALT) mod|=MOD_ALT;
if (m_wModifier&HOTKEYF_CONTROL) mod|=MOD_CONTROL;
if (m_wModifier&HOTKEYF_SHIFT) mod|=MOD_SHIFT;
if (m_wModifier&HOTKEYF_EXT) mod|=MOD_WIN;
m_wModifier=mod;
// register hotkey
::RegisterHotKey(
AfxGetMainWnd()->m_hWnd, // window to receive hot-key notification
1234, // identifier of hot key
m_wModifier, // key-modifier flags
m_wVkCode // virtual-key code
);
// 2) Manually add WM_HOTKEY message to Mainframe or Child frame window
ON_MESSAGE(WM_HOTKEY,OnHotKey)
LRESULT CMainFrame::OnHotKey(WPARAM wParam,LPARAM lParam)
{
wParam; //id specified in RegisterHotKey() (in this example: 1234)
lParam; //virtual key code and modifiers of the hotkey
return 0L;
}
/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -