diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c index 1b5496348de..b788edbd76c 100644 --- a/dlls/commdlg/filedlg.c +++ b/dlls/commdlg/filedlg.c @@ -1373,7 +1373,20 @@ static BOOL Commdlg_GetFileNameW( BOOL16 (CALLBACK *dofunction)(SEGPTR x), BOOL WINAPI GetOpenFileNameA( LPOPENFILENAMEA ofn) /* address of init structure */ { - if(TWEAK_WineLook>WIN31_LOOK) + BOOL newlook; + + /* some flags don't allow to match the TWEAK_WineLook */ + if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE)) + { + newlook = (ofn->Flags & OFN_EXPLORER) ? TRUE : FALSE; + } + else + { + /* no special flags set, we can match the TWEAK_WineLook */ + newlook = (TWEAK_WineLook>WIN31_LOOK) ? TRUE : FALSE; + } + + if (newlook) { return GetFileDialog95A(ofn, OPEN_DIALOG); } @@ -1397,7 +1410,20 @@ BOOL WINAPI GetOpenFileNameA( BOOL WINAPI GetOpenFileNameW( LPOPENFILENAMEW ofn) /* address of init structure */ { - if(TWEAK_WineLook>WIN31_LOOK) + BOOL newlook; + + /* some flags don't allow to match the TWEAK_WineLook */ + if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE)) + { + newlook = (ofn->Flags & OFN_EXPLORER) ? TRUE : FALSE; + } + else + { + /* no special flags set, we can match the TWEAK_WineLook */ + newlook = (TWEAK_WineLook>WIN31_LOOK) ? TRUE : FALSE; + } + + if (newlook) { return GetFileDialog95W(ofn, OPEN_DIALOG); } @@ -1421,7 +1447,20 @@ BOOL WINAPI GetOpenFileNameW( BOOL WINAPI GetSaveFileNameA( LPOPENFILENAMEA ofn) /* address of init structure */ { - if(TWEAK_WineLook>WIN31_LOOK) + BOOL newlook; + + /* some flags don't allow to match the TWEAK_WineLook */ + if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE)) + { + newlook = (ofn->Flags & OFN_EXPLORER) ? TRUE : FALSE; + } + else + { + /* no special flags set, we can match the TWEAK_WineLook */ + newlook = (TWEAK_WineLook>WIN31_LOOK) ? TRUE : FALSE; + } + + if (newlook) { return GetFileDialog95A(ofn, SAVE_DIALOG); } @@ -1445,7 +1484,20 @@ BOOL WINAPI GetSaveFileNameA( BOOL WINAPI GetSaveFileNameW( LPOPENFILENAMEW ofn) /* address of init structure */ { - if( TWEAK_WineLook>WIN31_LOOK) + BOOL newlook; + + /* some flags don't allow to match the TWEAK_WineLook */ + if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE)) + { + newlook = (ofn->Flags & OFN_EXPLORER) ? TRUE : FALSE; + } + else + { + /* no special flags set, we can match the TWEAK_WineLook */ + newlook = (TWEAK_WineLook>WIN31_LOOK) ? TRUE : FALSE; + } + + if (newlook) { return GetFileDialog95W(ofn, SAVE_DIALOG); }