Partager via


GetTextAlign (Windows CE 5.0)

Send Feedback

This function retrieves the text-alignment setting for the specified device context.

WINGDIAPI UINT WINAPI GetTextAlign(HDChdc);

Parameters

  • hdc
    [in] Handle to the device context.

Return Values

The text-alignment setting indicates success. GDI_ERROR indicates failure. To get extended error information, call GetLastError. For more information about the return value, see the Remarks section.

The following table shows the values that can be combined to form the text-alignment setting.

Value Description
TA_BASELINE The reference point is on the base line of the text.
TA_BOTTOM The reference point is on the bottom edge of the bounding rectangle.
TA_TOP The reference point is on the top edge of the bounding rectangle.
TA_CENTER The reference point is aligned horizontally with the center of the bounding rectangle.
TA_LEFT The reference point is on the left edge of the bounding rectangle.
TA_RIGHT The reference point is on the right edge of the bounding rectangle.
TA_NOUPDATECP The function does not update the current position after each text output call.
TA_UPDATECP The function does update the current position after each text output call.

Remarks

The bounding rectangle is a rectangle bounding all of the character cells in a string of text. You can obtain the dimensions of this rectangle by calling the GetTextExtentPoint32 function.

The text-alignment values determine how the ExtTextOut function aligns a string of text in relation to the reference point for the string that you provide to ExtTextOut.

The text-alignment values are not necessarily single bit flags and can be equal to zero. You must examine the values in groups of related values, as shown in the following list:

  • TA_LEFT, TA_RIGHT, and TA_CENTER
  • TA_BOTTOM, TA_TOP, and TA_BASELINE
  • TA_NOUPDATECP and TA_UPDATECP

To verify that a particular value is set in the return value of this function

  1. Apply the bitwise OR operator to the value and its related values.
  2. Apply the bitwise AND operator to the return value and the result of the previous operation.
  3. Test for the equality of the result of the previous operation and the value that you want to test.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

ExtTextOut | GetTextExtentPoint32 | SetTextAlign

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.