Index: src/libictranslate/LanguageDialog.cpp =================================================================== diff -u -N -r7c5fbe003fb1d9ff80a1cd66b789408b228e9918 -rfc2dc311c930b1a5fccd92d749b57220d3713c9c --- src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 7c5fbe003fb1d9ff80a1cd66b789408b228e9918) +++ src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision fc2dc311c930b1a5fccd92d749b57220d3713c9c) @@ -584,15 +584,12 @@ CRect rcDialog(0, 0, dt.m_dlgTemplate.cx, dt.m_dlgTemplate.cy); MapRect(&rcDialog); - rcDialog.bottom += 2 * GetSystemMetrics((dt.m_dlgTemplate.style & WS_THICKFRAME) ? SM_CYSIZEFRAME : SM_CYFIXEDFRAME) + GetSystemMetrics((dt.m_dlgTemplate.exStyle & WS_EX_TOOLWINDOW) ? SM_CYCAPTION : SM_CYSMCAPTION); - rcDialog.right += 2 * GetSystemMetrics((dt.m_dlgTemplate.style & WS_THICKFRAME) ? SM_CXSIZEFRAME : SM_CXFIXEDFRAME); + BOOL bHasMenu = ((dt.m_wMenu != 0xffff) || ((dt.m_pszMenu != NULL) && _tcslen(dt.m_pszMenu) != 0)); - // correct the height by a menu height - if ((dt.m_wMenu != 0xffff) || ((dt.m_pszMenu != NULL) && _tcslen(dt.m_pszMenu) != 0)) - rcDialog.bottom += GetSystemMetrics(SM_CYMENU); + AdjustWindowRectEx(&rcDialog, GetStyle(), bHasMenu, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE)); + rcDialog.OffsetRect(-rcDialog.left, -rcDialog.top); + rcDialog.OffsetRect(rcWin.CenterPoint().x - rcDialog.Width() / 2, rcWin.CenterPoint().y - rcDialog.Height() / 2); - rcDialog.OffsetRect(rcWin.CenterPoint().x-rcDialog.Width()/2, rcWin.CenterPoint().y-rcDialog.Height()/2); - //TEMP TRACE("Old dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu; \n\tNew dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu\n", rcWin.left, rcWin.top, rcWin.Width(), rcWin.Height(), rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height()); SetWindowPos(NULL, rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);