Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

text.c File Reference

Go to the source code of this file.

Functions

BOOL PSMGetTextExtent (HDC hdc, LPCWSTR lpstr, int cch, PSIZE psize)


Function Documentation

BOOL PSMGetTextExtent HDC  hdc,
LPCWSTR  lpstr,
int  cch,
PSIZE  psize
 

Definition at line 72 of file rtl/text.c.

References BOOL, FALSE, GetPrefixCount(), NULL, TRUE, UserGetTextExtentPointW, UserLocalAlloc, and UserLocalFree.

Referenced by BNCalcRect(), DrawStateW(), and xxxBNDrawText().

00077 { 00078 int result; 00079 WCHAR szTemp[255], *pchOut; 00080 00081 if (cch > sizeof(szTemp)/sizeof(WCHAR)) { 00082 pchOut = (WCHAR*)UserLocalAlloc(0, (cch+1) * sizeof(WCHAR)); 00083 if (pchOut == NULL) 00084 return FALSE; 00085 } else { 00086 pchOut = szTemp; 00087 } 00088 00089 result = HIWORD(GetPrefixCount(lpstr, cch, pchOut, cch)); 00090 00091 if (result) { 00092 lpstr = pchOut; 00093 cch -= result; 00094 } 00095 00096 UserGetTextExtentPointW(hdc, lpstr, cch, psize); 00097 00098 if (pchOut != szTemp) 00099 UserLocalFree(pchOut); 00100 00101 /* 00102 * IanJa everyone seems to ignore the ret val 00103 */ 00104 return TRUE; 00105 }


Generated on Sat May 15 19:45:44 2004 for test by doxygen 1.3.7