https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef4f0d07b184637d62172b...
commit ef4f0d07b184637d62172bc2a9c1c3fac3ee99a3 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Fri Jan 14 11:39:24 2022 +0900 Commit: GitHub noreply@github.com CommitDate: Fri Jan 14 11:39:24 2022 +0900
[SYSSETUP] Adjust Status Window if Asian (#4280)
The Asian logo and bar positions are different from English or Latin positions, due to Asian font. Add positional adjustment to IDD_STATUSWINDOW_DLG if Asian. --- dll/win32/syssetup/install.c | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
diff --git a/dll/win32/syssetup/install.c b/dll/win32/syssetup/install.c index 19423f11c97..4a89017d5bc 100644 --- a/dll/win32/syssetup/install.c +++ b/dll/win32/syssetup/install.c @@ -565,6 +565,70 @@ cleanup: return bRet; }
+static VOID +AdjustStatusMessageWindow(HWND hwndDlg, PDLG_DATA pDlgData) +{ + INT xOld, yOld, cxOld, cyOld; + INT xNew, yNew, cxNew, cyNew; + INT cxLabel, cyLabel, dyLabel; + RECT rc, rcBar, rcLabel, rcWnd; + BITMAP bmLogo, bmBar; + DWORD style, exstyle; + HWND hwndLogo = GetDlgItem(hwndDlg, IDC_ROSLOGO); + HWND hwndBar = GetDlgItem(hwndDlg, IDC_BAR); + HWND hwndLabel = GetDlgItem(hwndDlg, IDC_STATUSLABEL); + + /* This adjustment is for CJK only */ + switch (PRIMARYLANGID(GetUserDefaultLangID())) + { + case LANG_CHINESE: + case LANG_JAPANESE: + case LANG_KOREAN: + break; + + default: + return; + } + + if (!GetObjectW(pDlgData->hLogoBitmap, sizeof(BITMAP), &bmLogo) || + !GetObjectW(pDlgData->hBarBitmap, sizeof(BITMAP), &bmBar)) + { + return; + } + + GetWindowRect(hwndBar, &rcBar); + MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcBar, 2); + dyLabel = bmLogo.bmHeight - rcBar.top; + + GetWindowRect(hwndLabel, &rcLabel); + MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcLabel, 2); + cxLabel = rcLabel.right - rcLabel.left; + cyLabel = rcLabel.bottom - rcLabel.top; + + MoveWindow(hwndLogo, 0, 0, bmLogo.bmWidth, bmLogo.bmHeight, TRUE); + MoveWindow(hwndBar, 0, bmLogo.bmHeight, bmLogo.bmWidth, bmBar.bmHeight, TRUE); + MoveWindow(hwndLabel, rcLabel.left, rcLabel.top + dyLabel, cxLabel, cyLabel, TRUE); + + GetWindowRect(hwndDlg, &rcWnd); + xOld = rcWnd.left; + yOld = rcWnd.top; + cxOld = rcWnd.right - rcWnd.left; + cyOld = rcWnd.bottom - rcWnd.top; + + GetClientRect(hwndDlg, &rc); + SetRect(&rc, 0, 0, bmLogo.bmWidth, rc.bottom - rc.top); /* new client size */ + + style = (DWORD)GetWindowLongPtrW(hwndDlg, GWL_STYLE); + exstyle = (DWORD)GetWindowLongPtrW(hwndDlg, GWL_EXSTYLE); + AdjustWindowRectEx(&rc, style, FALSE, exstyle); + + cxNew = rc.right - rc.left; + cyNew = (rc.bottom - rc.top) + dyLabel; + xNew = xOld - (cxNew - cxOld) / 2; + yNew = yOld - (cyNew - cyOld) / 2; + MoveWindow(hwndDlg, xNew, yNew, cxNew, cyNew, TRUE); +} + static INT_PTR CALLBACK StatusMessageWindowProc( IN HWND hwndDlg, @@ -622,6 +686,7 @@ StatusMessageWindowProc( return FALSE; SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, szMsg);
+ AdjustStatusMessageWindow(hwndDlg, pDlgData); return TRUE; }