mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
[COMCTL32] Fix recalculation of property-sheet dialog position (#1818)
During initialization of property sheet dialogs, their overall size can change (when adding property sheets) after the dialog has been created and pre-positioned by win32k. Therefore their position needs to be recomputed so that they try to fit the best on screen. CORE-9008, CORE-9602
This commit is contained in:
parent
ffd0ab39b5
commit
2bd6bfdd90
1 changed files with 24 additions and 0 deletions
|
@ -3580,6 +3580,30 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
SetFocus(GetDlgItem(hwnd, IDOK));
|
||||
}
|
||||
#ifdef __REACTOS__
|
||||
{ /*
|
||||
try to fit it into the desktop
|
||||
user32 positions the dialog based on the IDD_PROPSHEET template,
|
||||
but we've since made it larger by adding controls
|
||||
*/
|
||||
RECT rcWork;
|
||||
RECT rcDlg;
|
||||
int dx, dy;
|
||||
|
||||
if (GetWindowRect(hwnd, &rcDlg) && SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWork, 0))
|
||||
{
|
||||
dx = rcDlg.right - rcWork.right;
|
||||
dy = rcDlg.bottom - rcWork.bottom;
|
||||
|
||||
if (rcDlg.right > rcWork.right)
|
||||
rcDlg.left -= dx;
|
||||
if (rcDlg.bottom > rcWork.bottom)
|
||||
rcDlg.top -= dy;
|
||||
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, rcDlg.left, rcDlg.top, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) &&
|
||||
psInfo->ppshheader.hInstance)
|
||||
|
|
Loading…
Reference in a new issue