标签:
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();
	return 0;
}
BOOL GetTextMetrics( LPTEXTMETRIC lpMetrics ) const;
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
lpMetrics
Points to the TEXTMETRIC structure that receives the metrics.
Remarks
Retrieves the metrics for the current font using the attribute device context.
typedef struct tagTEXTMETRIC { // tm 
    LONG tmHeight; 插入符的高度
    LONG tmAscent; 升序的高度 gh他们高度不一样h高一点  所以h带表了升序的高度
    LONG tmDescent; 降序的高度g-h表示了降序的高度
    LONG tmInternalLeading; 
    LONG tmExternalLeading; 
    LONG tmAveCharWidth; 字符的平均宽度值
    LONG tmMaxCharWidth; 
    LONG tmWeight; 
    LONG tmOverhang; 
    LONG tmDigitizedAspectX; 
    LONG tmDigitizedAspectY; 
    BCHAR tmFirstChar; 
    BCHAR tmLastChar; 
    BCHAR tmDefaultChar; 
    BCHAR tmBreakChar; 
    BYTE tmItalic; 
    BYTE tmUnderlined; 
    BYTE tmStruckOut; 
    BYTE tmPitchAndFamily; 
    BYTE tmCharSet; 
} TEXTMETRIC; 
 标签:
原文地址:http://www.cnblogs.com/llforeverlove/p/4654918.html