How to determine if installing Windows RTL

(I use Windows XP, but the question applies to all / any version of Windows)

Windows installation comes in 2 "flavoers": LTR or RTL. this means that the graphical user interface (buttons, window controls, menus, etc.) is displayed from left to right or from left to right.

This applies mainly to the Jewish and Arabic versions of Windows.

My program should figure out the default behavior when displaying my widgets.

LOCALE is not the right answer!

Local refers to the date format, thousands separator, user interface language, and other language / culture settings, but on Windows, the locale does not affect the direction of the interface.

How to find out (registry, env, etc.) OS direction?

+3
source share
3 answers

Check WS_EX_LAYOUTRTLwith the help GetWindowLongon the system taskbar to find out where the initial menu is located, which will give you OS Text Direction:

if (GetWindowLong(FindWindow(_T("HHTaskBar"), NULL), GWL_EXSTYLE) != 0)
    //it RTL
+2
source
+2
source

How about using GetSystemMetrics with nIndex from SM_MIDEASTENABLED, it will return a non-zero value if the system is enabled for Hebrew and Arabic, 0 if not.

-1
source

All Articles