控件获得焦点时,屏蔽输入法
void CBlogEdit::OnSetFocus(CWnd* pOldWnd)
{
CEdit::OnSetFocus(pOldWnd);
// 关闭输入法
HIMC hIMC = ImmGetContext( this->GetSafeHwnd() );
ImmSetOpenStatus ( hIMC, FALSE );
}
2. 映射 WM_CHAR 消息到 OnChar ()
void CBlogEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// nChar 的值在不同手机上可能有所不同
switch ( nChar )
{
// Up
case 50:
{
this->LineScroll ( -1 );
break;
}
// Down
case 56:
{
this->LineScroll ( 1 );
break;
}
// PageUp
case 52:
{
this->LineScroll ( -11 );
break;
}
// PageDown
case 54:
{
this->LineScroll ( 11 );
break;
}
}
// CEdit::OnChar(nChar, nRepCnt, nFlags);
}
本文作者:荷塘月色 来源:http://blog.tanggaowei.com/2008/05/c-2.html
CIO之家 www.ciozj.com 微信公众号:imciow