I apologize in advance if this topic has already been covered, but I have searched this forum up and down and have not found a relating question/answer.
this is what I have:
//
//PathChange - selects a path to a folder that contains MP3s
//and sets that string path to a global var... g_strPath
//when program starts, g_strPath is set to the current Directory.
void PathChange(HWND hwnd)
{
LPITEMIDLIST pidlSelected = NULL;
BROWSEINFO bi = {0};
LPMALLOC pMalloc = NULL;
char pszDisplayName[MAX_PATH];
char szDir[MAX_PATH];
if(SHGetMalloc(&pMalloc) == NO_ERROR)
{
memset(&bi, 0, sizeof(BROWSEINFO));
bi.hwndOwner = hwnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle = "Choose a folder that contains MP3s...";
bi.ulFlags = BIF_EDITBOX | BIF_VALIDATE;
bi.lpfn = NULL;
pidlSelected = SHBrowseForFolder(&bi);
if(pidlSelected != NULL)
{
if(SHGetPathFromIDList(pidlSelected, szDir))
{
g_strPath = szDir;
}
pMalloc->Free(pidlSelected);
}
pMalloc->Release();
}
}
I would like to have the Browse dialog begin by having the g_strPath folder selected instead of "My Computer"... anyone help me with this?
this is what I have:
//
//PathChange - selects a path to a folder that contains MP3s
//and sets that string path to a global var... g_strPath
//when program starts, g_strPath is set to the current Directory.
void PathChange(HWND hwnd)
{
LPITEMIDLIST pidlSelected = NULL;
BROWSEINFO bi = {0};
LPMALLOC pMalloc = NULL;
char pszDisplayName[MAX_PATH];
char szDir[MAX_PATH];
if(SHGetMalloc(&pMalloc) == NO_ERROR)
{
memset(&bi, 0, sizeof(BROWSEINFO));
bi.hwndOwner = hwnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle = "Choose a folder that contains MP3s...";
bi.ulFlags = BIF_EDITBOX | BIF_VALIDATE;
bi.lpfn = NULL;
pidlSelected = SHBrowseForFolder(&bi);
if(pidlSelected != NULL)
{
if(SHGetPathFromIDList(pidlSelected, szDir))
{
g_strPath = szDir;
}
pMalloc->Free(pidlSelected);
}
pMalloc->Release();
}
}
I would like to have the Browse dialog begin by having the g_strPath folder selected instead of "My Computer"... anyone help me with this?