[SHELL32] SHBrowseForFolder with BIF_EDITBOX should use new UI (#3532)

CORE-17506

- Convert some judgements against BIF_NEWDIALOGSTYLE to judgements against BIF_USENEWUI. Here BIF_USENEWUI == (BIF_NEWDIALOGSTYLE | BIF_EDITBOX).
- Remove WS_SIZEBOX window style from new UI dialog resource (IDD_BROWSE_FOR_FOLDER_NEW).
- Fix header layout.h for resizing without WS_SIZEBOX.
This commit is contained in:
Katayama Hirofumi MZ 2021-03-14 18:35:40 +09:00 committed by GitHub
parent ac507691fb
commit e1a5ba188e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 71 additions and 34 deletions

View file

@ -102,7 +102,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Търсене на папка"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -107,7 +107,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Procházet pro složku"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -107,7 +107,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Verzeichnis auswählen"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Αναζήτηση φακέλου"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -110,7 +110,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Buscar carpeta"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -108,7 +108,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Vali kaust"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Rechercher un dossier"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -103,7 +103,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "בחירת תיקיה"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "फोल्डर खोंजे"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Mappák böngészése"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Jelajah Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Selezione cartella"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "フォルダの参照"
FONT 9, "MS UI Gothic"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 9, "굴림"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Bla etter mappe"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -107,7 +107,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Wybierz katalog"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Procurar por Pasta"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Procurar pastas"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -103,7 +103,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Specificare dosar"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -108,7 +108,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Обзор"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -105,7 +105,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Shfleto për Dosje"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Bläddra efter mapp"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -103,7 +103,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Dizin İçin Göz At"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -101,7 +101,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Огляд папок"
FONT 8, "MS Shell Dlg"
BEGIN

View file

@ -111,7 +111,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "浏览文件夹"
FONT 9, "宋体"
BEGIN

View file

@ -111,7 +111,7 @@ BEGIN
END
IDD_BROWSE_FOR_FOLDER_NEW DIALOGEX 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "瀏覽資料夾"
FONT 9, "新細明體"
BEGIN

View file

@ -676,7 +676,11 @@ static LRESULT BrsFolder_Treeview_Keydown(browse_info *info, LPNMTVKEYDOWN keydo
HTREEITEM selected_item;
/* Old dialog doesn't support those advanced features */
#ifdef __REACTOS__
if (!(info->lpBrowseInfo->ulFlags & BIF_USENEWUI))
#else
if (!(info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
#endif
return 0;
selected_item = (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_GETNEXTITEM, TVGN_CARET, 0);
@ -771,11 +775,22 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
#ifdef __REACTOS__
if (lpBrowseInfo->ulFlags & BIF_USENEWUI)
#else
if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
#endif
{
RECT rcWnd;
#ifdef __REACTOS__
if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
info->layout = LayoutInit(hWnd, g_layout_info, LAYOUT_INFO_COUNT);
else
info->layout = NULL;
#else
info->layout = LayoutInit(hWnd, g_layout_info, LAYOUT_INFO_COUNT);
#endif
/* TODO: Windows allows shrinking the windows a bit */
GetWindowRect(hWnd, &rcWnd);
@ -793,7 +808,11 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
ShowWindow( GetDlgItem(hWnd, IDC_BROWSE_FOR_FOLDER_TITLE), SW_HIDE );
if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)
#ifdef __REACTOS__
|| (lpBrowseInfo->ulFlags & BIF_USENEWUI))
#else
|| (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
#endif
ShowWindow( GetDlgItem(hWnd, IDC_BROWSE_FOR_FOLDER_STATUS), SW_HIDE );
/* Hide "Make New Folder" Button? */
@ -1139,7 +1158,11 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL
#ifndef __REACTOS__ /* This is a buggy way (resize on title bar) */
static LRESULT BrsFolder_OnWindowPosChanging(browse_info *info, WINDOWPOS *pos)
{
#ifdef __REACTOS__
if ((info->lpBrowseInfo->ulFlags & BIF_USENEWUI) && !(pos->flags & SWP_NOSIZE))
#else
if ((info->lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) && !(pos->flags & SWP_NOSIZE))
#endif
{
if (pos->cx < info->szMin.cx)
pos->cx = info->szMin.cx;
@ -1379,7 +1402,11 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
hr = OleInitialize(NULL);
#ifdef __REACTOS__
if (lpbi->ulFlags & BIF_USENEWUI)
#else
if (lpbi->ulFlags & BIF_NEWDIALOGSTYLE)
#endif
wDlgId = IDD_BROWSE_FOR_FOLDER_NEW;
else
wDlgId = IDD_BROWSE_FOR_FOLDER;

View file

@ -67,6 +67,16 @@ _layout_MoveGrip(LAYOUT_DATA *pData, HDWP hDwp OPTIONAL)
static __inline void
LayoutShowGrip(LAYOUT_DATA *pData, BOOL bShow)
{
UINT uSWP = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED;
DWORD style = GetWindowLongPtrW(pData->m_hwndParent, GWL_STYLE);
DWORD new_style = (bShow ? (style | WS_SIZEBOX) : (style & ~WS_SIZEBOX));
if (style != new_style)
{
SetWindowLongPtrW(pData->m_hwndParent, GWL_STYLE, new_style); /* change style */
SetWindowPos(pData->m_hwndParent, NULL, 0, 0, 0, 0, uSWP); /* frame changed */
}
if (!bShow)
{
ShowWindow(pData->m_hwndGrip, SW_HIDE);