送高分
解决方案 »
- 跪求虚拟光驱的实现原理资料
- TCP局域网传送数据不丢失,广域网传送数据丢失问题
- DDK例子编译成功后无法启动!
- 在CDialog中放置了一个CButton,并映射了一个CDialog的WM_KEYDOWN消息...
- delet CWinThread 指针时 出错
- 有谁想要 实现 [中国互动游戏中心 和浩方对战平台]的代码?
- 关于WINCVS和VC代码的问题-头疼,谁懂?还有一个书籍配套代码的问题,各100分
- 给100分!!!急!!!如何用VB生成标准的DLL,并在VC中用标准格式调用。
- 小问题,不知你能否解决?
- 怎么样在内存中将jpg格式转换成bmp
- 一个难倒我的问题:如何DLL向调用它的应用程序传递信息?
- 哪位高手k过advanced programming ? 关于线程本地存储器。help!!
CSize size1 = pDC->GetTextExtent("W");
CSize size2 = pDC->GetTextExtent("T");
这样可以确定它们的宽度和高度
The GetTextExtentPoint32 function computes the width and height of the specified string of text. BOOL GetTextExtentPoint32(
HDC hdc, // handle to DC
LPCTSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);
Parameters
hdc
[in] Handle to the device context.
lpString
[in] Pointer to a buffer that specifies the text string. The string does not need to be zero-terminated, because the cbString parameter specifies the length of the string.
cbString
[in] Specifies the length of the lpString buffer. For the ANSI function it is a BYTE count and for the Unicode function it is a WORD count. Note that for the ANSI function, characters in SBCS code pages take one byte each, while most characters in DBCS code pages take two bytes; for the Unicode function, most currently defined Unicode characters (those in the Basic Multilingual Plane (BMP)) are one WORD while Unicode surrogates are two WORDs.
Windows 95/98/Me: This value may not exceed 8192. lpSize
[out] Pointer to a SIZE structure that receives the dimensions of the string, in logical units.
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. Windows NT/2000/XP: To get extended error information, call GetLastError.