- implement deleting file using recyclebin api

- play a sound on when requested using the user default for emptying recycle bin
- rename shlfldr_mydocuments.c

svn path=/trunk/; revision=35301
This commit is contained in:
Johannes Anderwald 2008-08-13 08:45:20 +00:00
parent 17beba5f93
commit 7d75e41b42
4 changed files with 55 additions and 9 deletions

View file

@ -24,6 +24,7 @@
<library>version</library>
<library>devmgr</library>
<library>winspool</library>
<library>winmm</library>
<file>authors.c</file>
<file>autocomplete.c</file>
<file>brsfolder.c</file>
@ -54,7 +55,7 @@
<file>shfldr_desktop.c</file>
<file>shfldr_fs.c</file>
<file>shfldr_mycomp.c</file>
<file>shlfldr_mydocuments.c</file>
<file>shfldr_mydocuments.c</file>
<file>shfldr_printers.c</file>
<file>shlexec.c</file>
<file>shlfileop.c</file>

View file

@ -1962,14 +1962,18 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
return FALSE;
}
/*************************************************************************
* SHStartNetConnectionDialog (SHELL32.@)
*/
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
{
FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
return S_OK;
}
/*************************************************************************
* SHEmptyRecycleBinA (SHELL32.@)
*/
HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
{
LPWSTR szRootPathW = NULL;
@ -2001,16 +2005,55 @@ HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
{
BOOL ret;
WCHAR szPath[MAX_PATH] = {0};
DWORD dwSize, dwType;
LONG ret;
TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags);
FIXME("0x%08x flags ignored\n", dwFlags);
ret = EmptyRecycleBinW(pszRootPath);
if (!(dwFlags & SHERB_NOCONFIRMATION))
{
/* FIXME
* enumerate available files
* show confirmation dialog
*/
FIXME("show confirmation dialog\n");
}
if (dwFlags & SHERB_NOPROGRESSUI)
{
ret = EmptyRecycleBinW(pszRootPath);
}
else
{
/* FIXME
* show a progress dialog
*/
ret = EmptyRecycleBinW(pszRootPath);
}
if (!ret)
return HRESULT_FROM_WIN32(GetLastError());
/* FIXME: update icon? */
if (!(dwFlags & SHERB_NOSOUND))
{
dwSize = sizeof(szPath);
ret = RegGetValueW(HKEY_CURRENT_USER,
L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
NULL,
RRF_RT_REG_EXPAND_SZ,
&dwType,
(PVOID)szPath,
&dwSize);
if (ret != ERROR_SUCCESS)
return S_OK;
if (dwType != REG_EXPAND_SZ) /* type dismatch */
return S_OK;
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
PlaySoundW(szPath, NULL, SND_FILENAME);
}
return S_OK;
}

View file

@ -1109,8 +1109,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand(
}
else
{
FIXME("implement delete\n");
CloseRecycleBinHandle(Context.hDeletedFile);
DeleteFileHandleToRecycleBin(Context.hDeletedFile);
return E_NOTIMPL;
}
}
@ -1647,5 +1646,8 @@ TRASH_TrashFile(LPCWSTR wszPath)
HRESULT WINAPI SHUpdateRecycleBinIcon(void)
{
FIXME("stub\n");
return S_OK;
}