标签:
用于接收键盘输入的消息
int CXuexi2View::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
//调用Windows处理函数对应的create
// TODO: Add your specialized creation code here
/* CClientDC dc(this);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);//得到窗口字体信息
CreateSolidCaret(tm.tmAveCharWidth/8,tm.tmHeight);//用于表示插入符的消息、/8经过试验以后验证是最好的
ShowCaret();
*/
// CreateSolidCaret(1,10);//自己定义窗口的插入符的大小
// ShowCaret();
//CreateCaret();用于创建位图插入符
//CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CreateCaret(&bitmap);
ShowCaret();
return 0;
}
void CXuexi2View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
SetCaretPos(point);//用于记录鼠标单击时时插入符的显示位置
CView::OnLButtonDown(nFlags, point);
}
标签:
原文地址:http://www.cnblogs.com/llforeverlove/p/4655663.html