📄 subedit.cpp
字号:
// SubEdit.cpp : implementation file
//
#include "stdafx.h"
#include "SubClass.h"
#include "SubEdit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSubEdit
CSubEdit::CSubEdit()
{
}
CSubEdit::~CSubEdit()
{
}
BEGIN_MESSAGE_MAP(CSubEdit, CEdit)
//{{AFX_MSG_MAP(CSubEdit)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSubEdit message handlers
BOOL CSubEdit::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN &&
(pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN))
{
int nextprev=GW_HWNDNEXT;
int firstlast=GW_HWNDFIRST;
if (pMsg->wParam == VK_UP)//如果用户按下了上箭头键
{
nextprev=GW_HWNDPREV;
firstlast=GW_HWNDLAST;
}
HWND hWnd = m_hWnd;
while (hWnd)
{
HWND hWndx=hWnd;
if ((hWnd = ::GetWindow(hWnd, nextprev))==NULL)
hWnd = ::GetWindow(hWndx, firstlast);
long style=::GetWindowLong(hWnd,GWL_STYLE);//获得窗口属性
//翻译上下箭头为Tab和Shift-Tab键
if ((style&WS_TABSTOP && !(style&WS_DISABLED) && style&WS_VISIBLE) || hWnd==m_hWnd)
break;
}
::SetFocus(hWnd);
return TRUE;
}
return CEdit::PreTranslateMessage(pMsg);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -