EasyWriter
March 20th, 2006, 07:36 AM
Hi all,
I use SHBrowseForFolder() to pop up an "open directory" dialog. But there seem not all devices that are connected to the PC to be shown. I e.g. connected a mobile phone via USB. This device is identified by the normal Windows file explorer as a "Mobile Phone" on the top level directory structure. But this "Mobile Phone" is not shown in the dialog I want to use in my application (maybe because it is not mounted as a normal device since it has no drive identifying letter).
Does anyone know how to display such devices?
Here is the code snippet I use to get the open dir dialog:
int GetFolder(HWND hWnd, char *achPath, char *achTitle){
LPITEMIDLIST lpItemList=0;
BROWSEINFO bi;
LPMALLOC lpM;
int Ret;
memset(&bi, 0, sizeof(BROWSEINFO));
if(!SHGetMalloc (&lpM)){
bi.hwndOwner = hWnd;
bi.pszDisplayName = achTitle;
bi.pidlRoot = NULL;
bi.lpszTitle = "Select an aacPlus target folder";
bi.ulFlags=BIF_RETURNONLYFSDIRS;
if((lpItemList = SHBrowseForFolder(&bi))){
SHGetPathFromIDList(lpItemList,achPath);
Ret=1;
}
else
Ret=0;
lpM->Free(lpItemList);
lpM->Release();
}
else
Ret=0;
return Ret ;
}
I use SHBrowseForFolder() to pop up an "open directory" dialog. But there seem not all devices that are connected to the PC to be shown. I e.g. connected a mobile phone via USB. This device is identified by the normal Windows file explorer as a "Mobile Phone" on the top level directory structure. But this "Mobile Phone" is not shown in the dialog I want to use in my application (maybe because it is not mounted as a normal device since it has no drive identifying letter).
Does anyone know how to display such devices?
Here is the code snippet I use to get the open dir dialog:
int GetFolder(HWND hWnd, char *achPath, char *achTitle){
LPITEMIDLIST lpItemList=0;
BROWSEINFO bi;
LPMALLOC lpM;
int Ret;
memset(&bi, 0, sizeof(BROWSEINFO));
if(!SHGetMalloc (&lpM)){
bi.hwndOwner = hWnd;
bi.pszDisplayName = achTitle;
bi.pidlRoot = NULL;
bi.lpszTitle = "Select an aacPlus target folder";
bi.ulFlags=BIF_RETURNONLYFSDIRS;
if((lpItemList = SHBrowseForFolder(&bi))){
SHGetPathFromIDList(lpItemList,achPath);
Ret=1;
}
else
Ret=0;
lpM->Free(lpItemList);
lpM->Release();
}
else
Ret=0;
return Ret ;
}