From 862db2b603f5024df75955415bc38e641f923e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 30 May 2006 13:39:21 +0000 Subject: [PATCH] Implement the Browse button, but it is not working well :( svn path=/trunk/; revision=22117 --- reactos/dll/win32/newdev/newdev_private.h | 1 + reactos/dll/win32/newdev/wizard.c | 34 ++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/newdev/newdev_private.h b/reactos/dll/win32/newdev/newdev_private.h index b7079197872..95fee8e3ead 100644 --- a/reactos/dll/win32/newdev/newdev_private.h +++ b/reactos/dll/win32/newdev/newdev_private.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/reactos/dll/win32/newdev/wizard.c b/reactos/dll/win32/newdev/wizard.c index 42d1b6affd5..27bd3d62131 100644 --- a/reactos/dll/win32/newdev/wizard.c +++ b/reactos/dll/win32/newdev/wizard.c @@ -620,7 +620,7 @@ static void IncludePath(HWND Dlg, BOOL Enabled) { EnableWindow(GetDlgItem(Dlg, IDC_COMBO_PATH), Enabled); - EnableWindow(GetDlgItem(Dlg, IDC_BROWSE), /*FIXME: Enabled*/ FALSE); + EnableWindow(GetDlgItem(Dlg, IDC_BROWSE), Enabled); } static void @@ -697,9 +697,35 @@ CHSourceDlgProc( return TRUE; case IDC_BROWSE: - /* FIXME: set the IDC_COMBO_PATH text */ - FIXME("Should display browse folder dialog\n"); - return FALSE; + { + BROWSEINFO bi = { 0, }; + LPITEMIDLIST pidl; + + bi.hwndOwner = hwndDlg; + bi.ulFlags = BIF_RETURNONLYFSDIRS; + pidl = SHBrowseForFolder(&bi); + if (pidl) + { + TCHAR Directory[MAX_PATH]; + IMalloc* malloc; + + if (SHGetPathFromIDList(pidl, Directory)) + { + /* Set the IDC_COMBO_PATH text */ + ComboBox_SetText(GetDlgItem(hwndDlg, IDC_COMBO_PATH), Directory); + } + + /* Free memory, if possible */ + if (SUCCEEDED(SHGetMalloc(&malloc))) + { + FIXME("Memory leak!\n"); + //malloc->Free(pidl); + //malloc->Release(); + } + return TRUE; + } + break; + } } break; }