Implement the Browse button, but it is not working well :(

svn path=/trunk/; revision=22117
This commit is contained in:
Hervé Poussineau 2006-05-30 13:39:21 +00:00
parent c4c3ebf0ef
commit 862db2b603
2 changed files with 31 additions and 4 deletions

View file

@ -8,6 +8,7 @@
#include <regstr.h>
#include <setupapi.h>
#include <cfgmgr32.h>
#include <shlobj.h>
#include <tchar.h>
#include <wine/debug.h>

View file

@ -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;
}