shell32: Have the default shell view call SHChangeNotifyRegister with unixfs pidls.

This commit is contained in:
Jay Yang 2011-07-11 17:35:35 -04:00 committed by Alexandre Julliard
parent 481dcb4b4b
commit cde4993d62
1 changed files with 18 additions and 3 deletions

View File

@ -728,13 +728,28 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This)
hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppf2);
if (hr == S_OK)
{
LPITEMIDLIST raw_pidl;
SHChangeNotifyEntry ntreg;
hr = IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&ntreg.pidl);
if (hr == S_OK)
hr = IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&raw_pidl);
if(SUCCEEDED(hr))
{
LPITEMIDLIST computer_pidl;
SHGetFolderLocation(NULL,CSIDL_DRIVES,NULL,0,&computer_pidl);
if(ILIsParent(computer_pidl,raw_pidl,FALSE))
{
/* Normalize the pidl to unixfs to workaround an issue with
* sending notifications on dos paths
*/
WCHAR path[MAX_PATH];
SHGetPathFromIDListW(raw_pidl,path);
SHParseDisplayName(path,NULL,(LPITEMIDLIST*)&ntreg.pidl,0,NULL);
SHFree(raw_pidl);
}
else
ntreg.pidl = raw_pidl;
ntreg.fRecursive = TRUE;
This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNF_IDLIST, SHCNE_ALLEVENTS,
This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNRF_InterruptLevel, SHCNE_ALLEVENTS,
SHV_CHANGE_NOTIFY, 1, &ntreg);
SHFree((LPITEMIDLIST)ntreg.pidl);
}