There is no need to resize our own fake dialog to match the parent, it

doesn't have controls anyway.
This commit is contained in:
Dmitry Timoshkov 2005-11-18 16:52:35 +00:00 committed by Alexandre Julliard
parent f807e0017e
commit 762454f96b
1 changed files with 28 additions and 8 deletions

View File

@ -701,10 +701,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid
/* finally use fixed parent size */ /* finally use fixed parent size */
rectParent.bottom -= help_fixup; rectParent.bottom -= help_fixup;
/* save the size of the parent's client area */
rectChild.right = rectParent.right;
rectChild.bottom = rectParent.bottom;
/* set the size of the parent dialog */ /* set the size of the parent dialog */
AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE), AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE),
FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE)); FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE));
@ -713,10 +709,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid
rectParent.right - rectParent.left, rectParent.right - rectParent.left,
rectParent.bottom - rectParent.top, rectParent.bottom - rectParent.top,
SWP_NOMOVE | SWP_NOZORDER); SWP_NOMOVE | SWP_NOZORDER);
/* set the size of the child dialog */
SetWindowPos(hwndChildDlg, HWND_BOTTOM,
0, 0, rectChild.right, rectChild.bottom, SWP_NOACTIVATE);
} }
static INT_PTR CALLBACK FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -1032,9 +1024,29 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
FILEDLG95_InitControls(hwnd); FILEDLG95_InitControls(hwnd);
if (fodInfos->DlgInfos.hwndCustomDlg) if (fodInfos->DlgInfos.hwndCustomDlg)
{
RECT rc;
UINT flags = SWP_NOACTIVATE;
ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd, ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd,
(fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY); (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY);
/* resize the custom dialog to the parent size */
if (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE))
GetClientRect(hwnd, &rc);
else
{
/* our own fake template is zero sized and doesn't have
* children, so there is no need to resize it.
* Picasa depends on it.
*/
flags |= SWP_NOSIZE;
SetRectEmpty(&rc);
}
SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM,
0, 0, rc.right, rc.bottom, flags);
}
FILEDLG95_FillControls(hwnd, wParam, lParam); FILEDLG95_FillControls(hwnd, wParam, lParam);
SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
@ -3782,6 +3794,8 @@ BOOL WINAPI GetOpenFileNameA(
{ {
BOOL win16look = FALSE; BOOL win16look = FALSE;
TRACE("flags %08lx\n", ofn->Flags);
/* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */ /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
if (ofn->Flags & OFN_FILEMUSTEXIST) if (ofn->Flags & OFN_FILEMUSTEXIST)
ofn->Flags |= OFN_PATHMUSTEXIST; ofn->Flags |= OFN_PATHMUSTEXIST;
@ -3810,6 +3824,12 @@ BOOL WINAPI GetOpenFileNameW(
{ {
BOOL win16look = FALSE; BOOL win16look = FALSE;
TRACE("flags %08lx\n", ofn->Flags);
/* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
if (ofn->Flags & OFN_FILEMUSTEXIST)
ofn->Flags |= OFN_PATHMUSTEXIST;
if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE)) if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE))
win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE; win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE;