?? keydispdlg.cpp
字號:
// KeyDispDlg.cpp : implementation file
//
#include "stdafx.h"
#include "KeyDisp.h"
#include "KeyDispDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CKeyDispDlg dialog
CKeyDispDlg::CKeyDispDlg(CWnd* pParent /*=NULL*/)
: CDialog(CKeyDispDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CKeyDispDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CKeyDispDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CKeyDispDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CKeyDispDlg, CDialog)
//{{AFX_MSG_MAP(CKeyDispDlg)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_NEWKEYNUM,On_DispKeyNum)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CKeyDispDlg message handlers
BOOL CKeyDispDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
LRESULT CKeyDispDlg::On_DispKeyNum(WPARAM wparam,LPARAM lparam)
{
unsigned short a=(unsigned short)wparam;
MessageBox(_T("ok message is receive"),NULL,MB_OK);
/*
switch (a)
{
case 0xfe:
{
SetDlgItemText(IDC_EDIT_KEY,_T("1"));
}
break;
case 0xfd:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 2 "));
}
break;
case 0xfb:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 3 "));
}
break;
case 0xf7:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 4 "));
}
break;
case 0xef:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 5 "));
}
break;
case 0xdf:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 6 "));
}
break;
case 0xbf:
{
SetDlgItemText(IDC_EDIT_KEY,_T(" 7 "));
}
break;
case 0x7f:
{
SetDlgItemText(IDC_EDIT_KEY,_T("8"));
}
break;
default:
SetDlgItemText(IDC_EDIT_KEY,_T("0"));
break;
}*/
return TRUE;
}
void CKeyDispDlg::OnButton1()
{
// TODO: Add your control notification handler code here
SetDlgItemText(IDC_EDIT_KEY,_T("10"));
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -