mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 05:45:41 +00:00
- 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:
parent
17beba5f93
commit
7d75e41b42
4 changed files with 55 additions and 9 deletions
|
@ -24,6 +24,7 @@
|
||||||
<library>version</library>
|
<library>version</library>
|
||||||
<library>devmgr</library>
|
<library>devmgr</library>
|
||||||
<library>winspool</library>
|
<library>winspool</library>
|
||||||
|
<library>winmm</library>
|
||||||
<file>authors.c</file>
|
<file>authors.c</file>
|
||||||
<file>autocomplete.c</file>
|
<file>autocomplete.c</file>
|
||||||
<file>brsfolder.c</file>
|
<file>brsfolder.c</file>
|
||||||
|
@ -54,7 +55,7 @@
|
||||||
<file>shfldr_desktop.c</file>
|
<file>shfldr_desktop.c</file>
|
||||||
<file>shfldr_fs.c</file>
|
<file>shfldr_fs.c</file>
|
||||||
<file>shfldr_mycomp.c</file>
|
<file>shfldr_mycomp.c</file>
|
||||||
<file>shlfldr_mydocuments.c</file>
|
<file>shfldr_mydocuments.c</file>
|
||||||
<file>shfldr_printers.c</file>
|
<file>shfldr_printers.c</file>
|
||||||
<file>shlexec.c</file>
|
<file>shlexec.c</file>
|
||||||
<file>shlfileop.c</file>
|
<file>shlfileop.c</file>
|
||||||
|
|
|
@ -1962,14 +1962,18 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
/*************************************************************************
|
||||||
|
* SHStartNetConnectionDialog (SHELL32.@)
|
||||||
|
*/
|
||||||
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
|
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
|
||||||
{
|
{
|
||||||
FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
|
FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
/*************************************************************************
|
||||||
|
* SHEmptyRecycleBinA (SHELL32.@)
|
||||||
|
*/
|
||||||
HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
|
HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
LPWSTR szRootPathW = NULL;
|
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)
|
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);
|
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)
|
if (!ret)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
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;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1109,8 +1109,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FIXME("implement delete\n");
|
DeleteFileHandleToRecycleBin(Context.hDeletedFile);
|
||||||
CloseRecycleBinHandle(Context.hDeletedFile);
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1647,5 +1646,8 @@ TRASH_TrashFile(LPCWSTR wszPath)
|
||||||
HRESULT WINAPI SHUpdateRecycleBinIcon(void)
|
HRESULT WINAPI SHUpdateRecycleBinIcon(void)
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
FIXME("stub\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue