+ static const int verComCtl32 = wxApp::GetComCtl32Version();
+
+ // we always add the edit box (it doesn't hurt anybody, does it?) if it is
+ // supported by the system
+ if ( verComCtl32 >= 471 )
+ {
+ bi.ulFlags |= BIF_EDITBOX;
+ }
+
+ // normally the commented out part should work -- but in practice
+ // BIF_NONEWFOLDERBUTTON doesn't have any effect (Win2k, comctl 5.81) so I
+ // have to disable it [for now]
+#if 0
+ // to have the "New Folder" button we must use the "new" dialog style which
+ // is also the only way to have a resizable dialog
+ //
+ // "new" style is only available in the version 5.0+ of comctl32.dll
+ const bool needNewDir = HasFlag(wxDD_NEW_DIR_BUTTON);
+ if ( (needNewDir || HasFlag(wxRESIZE_BORDER)) && (verComCtl32 >= 500) )
+ {
+ bi.ulFlags |= BIF_NEWDIALOGSTYLE;
+
+ // we'll get the "New Folder" button by default now, don't show it if
+ // not needed
+ if ( !needNewDir )
+ bi.ulFlags |= BIF_NONEWFOLDERBUTTON;
+ }
+#else
+ if ( HasFlag(wxDD_NEW_DIR_BUTTON) && verComCtl32 >= 500 )
+ {
+ // use the new style to make the "New Folder" button appear
+ bi.ulFlags |= BIF_NEWDIALOGSTYLE;
+ }
+#endif
+
+ // do show the dialog