comdlg32: Don't call ShowWindow for the custom dialog until all rearrangements of the file dialog have been done.

This commit is contained in:
Rein Klazes 2009-07-02 13:32:28 +02:00 committed by Alexandre Julliard
parent 781f4b838d
commit f9c8e7e38a
3 changed files with 24 additions and 6 deletions

View File

@ -789,11 +789,7 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
hChildDlg = CreateDialogIndirectParamA(hinst, template, hwnd,
IsHooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate,
(LPARAM)fodInfos->ofnInfos);
if(hChildDlg)
{
ShowWindow(hChildDlg,SW_SHOW);
return hChildDlg;
}
return hChildDlg;
}
else if( IsHooked(fodInfos))
{
@ -1153,6 +1149,9 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
FILEDLG95_ResizeControls(hwnd, wParam, lParam);
FILEDLG95_FillControls(hwnd, wParam, lParam);
if( fodInfos->DlgInfos.hwndCustomDlg)
ShowWindow( fodInfos->DlgInfos.hwndCustomDlg, SW_SHOW);
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);

View File

@ -296,6 +296,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
{
static RECT initrc, rc;
static int index, count;
static int gotSWP_bottom, gotShowWindow;
HWND parent = GetParent( dlg);
int resize;
switch( msg)
@ -306,6 +307,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
index = ((OPENFILENAME*)lParam)->lCustData;
count = 0;
gotSWP_bottom = gotShowWindow = 0;
/* test style */
style = GetWindowLong( parent, GWL_STYLE);
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
count++;
}
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;
}

View File

@ -39,7 +39,7 @@ FONT 8, "MS Shell Dlg"
* This will work with 640x480 pixels
*/
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"
{
LTEXT "Path:",-1,28,4,36,8