setkey.cpp

来自「The project demonstrates many Windows co」· C++ 代码 · 共 58 行

CPP
58
字号
// setkey.cpp : implementation file
//

#include "stdafx.h"
#include "DooDads.h"
#include "setkey.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSetHotKey dialog


CSetHotKey::CSetHotKey(CWnd* pParent /*=NULL*/)
	: CDialog(CSetHotKey::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetHotKey)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSetHotKey::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetHotKey)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP

	CHotKeyCtrl* pCtrl;
	pCtrl = (CHotKeyCtrl*) GetDlgItem(IDC_HOTKEY);
	if (pDX->m_bSaveAndValidate)
	{	
		pCtrl->GetHotKey(m_wVirtKeyCode, m_wModifiers);
	
		TCHAR szName[50];
		pCtrl->GetWindowText(szName, 50);
		TRACE3("Key is \"%s\" (%4.4X, %4.4X)\n", (LPTSTR) szName,
			m_wVirtKeyCode, m_wModifiers);
	}
	else
		pCtrl->SetHotKey(m_wVirtKeyCode, m_wModifiers);
}


BEGIN_MESSAGE_MAP(CSetHotKey, CDialog)
	//{{AFX_MSG_MAP(CSetHotKey)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CSetHotKey message handlers

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?