+ return s_pfnGetLayout ? s_pfnGetLayout(hdc) : GDI_ERROR;
+}
+
+DWORD SetLayout(HDC hdc, DWORD dwLayout)
+{
+ typedef DWORD (WINAPI *SetLayout_t)(HDC, DWORD);
+ static SetLayout_t
+ wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(wxT("gdi32.dll")));
+
+ return s_pfnSetLayout ? s_pfnSetLayout(hdc, dwLayout) : GDI_ERROR;
+}
+
+HDC CreateCompatibleDCWithLayout(HDC hdc)
+{
+ HDC hdcNew = ::CreateCompatibleDC(hdc);
+ if ( hdcNew )
+ {
+ DWORD dwLayout = wxMSW::GetLayout(hdc);
+ if ( dwLayout != GDI_ERROR )
+ wxMSW::SetLayout(hdcNew, dwLayout);
+ }
+
+ return hdcNew;