Author: hpoussin
Date: Tue May 30 17:39:21 2006
New Revision: 22117
URL:
http://svn.reactos.ru/svn/reactos?rev=22117&view=rev
Log:
Implement the Browse button, but it is not working well :(
Modified:
trunk/reactos/dll/win32/newdev/newdev_private.h
trunk/reactos/dll/win32/newdev/wizard.c
Modified: trunk/reactos/dll/win32/newdev/newdev_private.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev_pri…
==============================================================================
--- trunk/reactos/dll/win32/newdev/newdev_private.h (original)
+++ trunk/reactos/dll/win32/newdev/newdev_private.h Tue May 30 17:39:21 2006
@@ -8,6 +8,7 @@
#include <regstr.h>
#include <setupapi.h>
#include <cfgmgr32.h>
+#include <shlobj.h>
#include <tchar.h>
#include <wine/debug.h>
Modified: trunk/reactos/dll/win32/newdev/wizard.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?r…
==============================================================================
--- trunk/reactos/dll/win32/newdev/wizard.c (original)
+++ trunk/reactos/dll/win32/newdev/wizard.c Tue May 30 17:39:21 2006
@@ -620,7 +620,7 @@
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 @@
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;
}