Simulation support:

None. This function is mandatory for all drivers.

Description:

GreQueryTextBox processes a character string as if it were being drawn.

This function must be supported by the presentation driver. GreQueryTextBox is called by the function GpiQueryTextBox, and is used to return a tight bounding box for the currently selected font of a given string relative to the current position.

#define INCL_GRE_STRINGS
#include <os2.h>

HDC        hdc;           /*  Device context handle. */
LONG       cChars;        /*  Number of bytes in string. */
PCH        pchString;     /*  Pointer to character string. */
LONG       cptPosition;   /*  Number of (X, Y) pairs that the Position array can contain. */
PPOINTL    paptPosition;  /*  Pointer to position array. */
PVOID      pInstance;     /*  Pointer to instance data. */
ULONG      lFunction;     /*  High-order WORD=flags; low-order WORD=NGreQueryTextBox. */
BOOL       rc;            /*  Return Code. */

rc = GreQueryTextBox(hdc, cChars, pchString,
       cptPosition, paptPosition, pInstance,
       lFunction);


[Back: GreQueryTextBox]
[Next: GreQueryTextBox Parameter - hdc]