How To Do Right-to-Left and Left-to-Right Mirroring in Windows 2000 (250276)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional
  • Microsoft Platform Software Development Kit (SDK) 1.0

This article was previously published under Q250276

SUMMARY

On a Windows 2000-based computer, you can dynamically change the application user interface from left-to-right to right-to-left.

MORE INFORMATION

This can be accomplished by using the following code:
  // Use ANSI versions of GetWindowLong() and SetWindowLong() because 
            // Unicode is not needed for these calls.
            lExStyles = GetWindowLongA(hWnd, GWL_EXSTYLE) ;

            // Check whether new layout is opposite the current layout.
            if(!!(pLState->IsRTLLayout) != !!(lExStyles & WS_EX_LAYOUTRTL)) 
            {
               // The following lines update the application layout to 
                // be right-to-left or left-to-right, as appropriate.
                lExStyles ^= WS_EX_LAYOUTRTL ; // Toggle layout.

                SetWindowLongA(hWnd, GWL_EXSTYLE, lExStyles) ;
                // This is to update layout in the client area.
                InvalidateRect(hWnd, NULL, TRUE) ;
            }

				

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbBidi kbhowto KB250276