mirror of
https://github.com/reactos/reactos.git
synced 2024-09-09 04:10:19 +00:00
Implement the Browse button, but it is not working well :(
svn path=/trunk/; revision=22117
This commit is contained in:
parent
c4c3ebf0ef
commit
862db2b603
|
@ -8,6 +8,7 @@
|
|||
#include <regstr.h>
|
||||
#include <setupapi.h>
|
||||
#include <cfgmgr32.h>
|
||||
#include <shlobj.h>
|
||||
#include <tchar.h>
|
||||
#include <wine/debug.h>
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue