SetLayout (Compact 2013)

3/28/2014

This function changes the layout of a device context (DC).

Syntax

DWORD SetLayout(
  HDC hdc,
  DWORD dwLayout,
);

Parameters

  • hdc
    [in] Handle to the DC.
  • dwLayout
    [in] Specifies the DC layout. This parameter can be a combination of one or more of the following flags.

    Flag

    Description

    LAYOUT_BITMAPORIENTATIONPRESERVED

    Not supported.

    LAYOUT_RTL

    Sets the default horizontal layout to be right-to-left.

    If the layout of your DC is currently right-to-left and you want to change it to left-to-right, set dwLayout to 0x00.

Return Value

If the function succeeds, it returns the previous layout of the DC. A return value of 0 indicates a left-to-right layout.

If the function fails, it returns GDI_ERROR. To get extended error information, call GetLastError.

Remarks

The layout specifies the order in which text and graphics are revealed in a window or a device context. The default is left-to-right. The SetLayout function changes this to be right-to-left, which is the standard layout in Arabic and Hebrew cultures.

The SetLayout function cannot modify drawing directly into the bits of a DIB.

After the LAYOUT_RTL flag is selected, flags that normally specify right or left are reversed. To avoid confusion, consider defining alternate words for standard flags, such as those in the following table.

Standard flag

Suggested alternate name

WS_EX_RIGHT

WS_EX_TRAILING

WS_EX_RTLREADING

WS_EX_REVERSEREADING

WS_EX_LEFTSCROLLBAR

WS_EX_LEADSCROLLBAR

ES_LEFT

ES_LEAD

ES_RIGHT

ES_TRAIL

EC_LEFTMARGIN

EC_LEADMARGIN

EC_RIGHTMARGIN

EC_TRAILMARGIN

Requirements

Header

windows.h

Library

coredll.lib

See Also

Reference

GDI Functions
GetLayout