Commit f9c8e7e3 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

comdlg32: Don't call ShowWindow for the custom dialog until all rearrangements…

comdlg32: Don't call ShowWindow for the custom dialog until all rearrangements of the file dialog have been done.
parent 781f4b83
...@@ -789,11 +789,7 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) ...@@ -789,11 +789,7 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
hChildDlg = CreateDialogIndirectParamA(hinst, template, hwnd, hChildDlg = CreateDialogIndirectParamA(hinst, template, hwnd,
IsHooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate, IsHooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate,
(LPARAM)fodInfos->ofnInfos); (LPARAM)fodInfos->ofnInfos);
if(hChildDlg) return hChildDlg;
{
ShowWindow(hChildDlg,SW_SHOW);
return hChildDlg;
}
} }
else if( IsHooked(fodInfos)) else if( IsHooked(fodInfos))
{ {
...@@ -1153,6 +1149,9 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l ...@@ -1153,6 +1149,9 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
FILEDLG95_ResizeControls(hwnd, wParam, lParam); FILEDLG95_ResizeControls(hwnd, wParam, lParam);
FILEDLG95_FillControls(hwnd, wParam, lParam); FILEDLG95_FillControls(hwnd, wParam, lParam);
if( fodInfos->DlgInfos.hwndCustomDlg)
ShowWindow( fodInfos->DlgInfos.hwndCustomDlg, SW_SHOW);
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER) if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
......
...@@ -296,6 +296,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L ...@@ -296,6 +296,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
{ {
static RECT initrc, rc; static RECT initrc, rc;
static int index, count; static int index, count;
static int gotSWP_bottom, gotShowWindow;
HWND parent = GetParent( dlg); HWND parent = GetParent( dlg);
int resize; int resize;
switch( msg) switch( msg)
...@@ -306,6 +307,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L ...@@ -306,6 +307,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
index = ((OPENFILENAME*)lParam)->lCustData; index = ((OPENFILENAME*)lParam)->lCustData;
count = 0; count = 0;
gotSWP_bottom = gotShowWindow = 0;
/* test style */ /* test style */
style = GetWindowLong( parent, GWL_STYLE); style = GetWindowLong( parent, GWL_STYLE);
if( resize_testcases[index].flags & OFN_ENABLESIZING) if( resize_testcases[index].flags & OFN_ENABLESIZING)
...@@ -372,6 +374,23 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L ...@@ -372,6 +374,23 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
count++; count++;
} }
break; break;
case WM_WINDOWPOSCHANGING:
{
WINDOWPOS *pwp = (WINDOWPOS *)lParam;
if( !index && pwp->hwndInsertAfter == HWND_BOTTOM){
gotSWP_bottom = 1;
ok( gotShowWindow == 0, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n");
}
}
break;
case WM_SHOWWINDOW:
{
if( !index){
gotShowWindow = 1;
ok( gotSWP_bottom == 1, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n");
}
}
break;
} }
return 0; return 0;
} }
......
...@@ -39,7 +39,7 @@ FONT 8, "MS Shell Dlg" ...@@ -39,7 +39,7 @@ FONT 8, "MS Shell Dlg"
* This will work with 640x480 pixels * This will work with 640x480 pixels
*/ */
TEMPLATE_SZ DIALOG LOADONCALL MOVEABLE DISCARDABLE 5, 43, 300, 40 TEMPLATE_SZ DIALOG LOADONCALL MOVEABLE DISCARDABLE 5, 43, 300, 40
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS STYLE WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg" FONT 8, "MS Shell Dlg"
{ {
LTEXT "Path:",-1,28,4,36,8 LTEXT "Path:",-1,28,4,36,8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment