mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
/****************************** Module Header ******************************\
|
|
* Module Name: text.c
|
|
*
|
|
* Copyright (c) 1985-91, Microsoft Corporation
|
|
*
|
|
* This module contains the MessageBox API and related functions.
|
|
*
|
|
* History:
|
|
* 10-01-90 EricK Created.
|
|
* 11-20-90 DarrinM Merged in User text APIs.
|
|
* 02-07-91 DarrinM Removed TextOut, ExtTextOut, and GetTextExtentPoint stubs.
|
|
\***************************************************************************/
|
|
|
|
#include "precomp.h"
|
|
#pragma hdrstop
|
|
|
|
|
|
/***************************************************************************\
|
|
* PSMGetTextExtent
|
|
*
|
|
* NOTE: This routine should only be called with the system font since having
|
|
* to realize a new font would cause memory to move...
|
|
*
|
|
* LATER: Can't this be eliminated altogether? Nothing should be moving
|
|
* anymore.
|
|
*
|
|
* History:
|
|
* 11-13-90 JimA Ported.
|
|
\***************************************************************************/
|
|
|
|
BOOL PSMGetTextExtent(
|
|
HDC hdc,
|
|
LPWSTR lpstr,
|
|
int cch,
|
|
PSIZE psize)
|
|
{
|
|
int result;
|
|
WCHAR szTemp[255]; /* Strings w/prefix chars must be under 256 chars long.*/
|
|
|
|
result = HIWORD(GetPrefixCount(lpstr, cch, szTemp, sizeof(szTemp)/sizeof(WCHAR)));
|
|
|
|
if (!result)
|
|
GreGetTextExtentW(hdc, lpstr, cch, psize, GGTE_WIN3_EXTENT);
|
|
else
|
|
GreGetTextExtentW(hdc, szTemp, cch - result, psize, GGTE_WIN3_EXTENT);
|
|
|
|
return TRUE; // IanJa everyone seems to ignore the ret val
|
|
}
|