From 762454f96bd43b5696ed15ac4a9df0d0d6bc18cf Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 18 Nov 2005 16:52:35 +0000 Subject: [PATCH] There is no need to resize our own fake dialog to match the parent, it doesn't have controls anyway. --- dlls/commdlg/filedlg.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c index b7bea6d0d28..4f8e56c86cd 100644 --- a/dlls/commdlg/filedlg.c +++ b/dlls/commdlg/filedlg.c @@ -701,10 +701,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid /* finally use fixed parent size */ 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 */ AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE), FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE)); @@ -713,10 +709,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid rectParent.right - rectParent.left, rectParent.bottom - rectParent.top, 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) @@ -1032,9 +1024,29 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l FILEDLG95_InitControls(hwnd); if (fodInfos->DlgInfos.hwndCustomDlg) + { + RECT rc; + UINT flags = SWP_NOACTIVATE; + ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd, (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); SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); @@ -3782,6 +3794,8 @@ BOOL WINAPI GetOpenFileNameA( { BOOL win16look = FALSE; + TRACE("flags %08lx\n", ofn->Flags); + /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */ if (ofn->Flags & OFN_FILEMUSTEXIST) ofn->Flags |= OFN_PATHMUSTEXIST; @@ -3810,6 +3824,12 @@ BOOL WINAPI GetOpenFileNameW( { 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)) win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE; -- 2.11.4.GIT