Index: dll/win32/shell32/folders/CRecycleBin.cpp =================================================================== --- dll/win32/shell32/folders/CRecycleBin.cpp (revision 66199) +++ dll/win32/shell32/folders/CRecycleBin.cpp (working copy) @@ -1605,6 +1605,7 @@ { WCHAR szPath[MAX_PATH] = {0}; DWORD dwSize, dwType; + int count = 0; LONG ret; TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags); @@ -1611,11 +1612,46 @@ if (!(dwFlags & SHERB_NOCONFIRMATION)) { - /* FIXME - * enumerate available files - * show confirmation dialog - */ - FIXME("show confirmation dialog\n"); + IShellFolder *pDesktop = NULL; + IShellFolder *m_pRecycleBin = NULL; + LPITEMIDLIST pidlRecycleBin = NULL; + HRESULT hr = S_OK; + LPENUMIDLIST penumFiles; + LPITEMIDLIST pidl = NULL; + + SHGetDesktopFolder(&pDesktop); + SHGetSpecialFolderLocation (0, CSIDL_BITBUCKET, &pidlRecycleBin); + pDesktop->BindToObject(pidlRecycleBin, NULL, IID_IShellFolder, (LPVOID *)&m_pRecycleBin); + hr = m_pRecycleBin->EnumObjects(0, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN, &penumFiles); + + if (SUCCEEDED(hr)) + { + while (penumFiles->Next(1, &pidl, NULL) != S_FALSE) + { + count++; + } + } + + switch(count) + { + case 0: + /* this should never happen as the option to empty the recycle bin should be disabled if there are no file in it. */ + FIXME("This shouldn't happen, Recycle bin is empty!\n"); + break; + case 1: + /* we have only one item inside the bin. + TODO: obtain its name and show a proper message box */ + if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEITEM_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET), + MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, L"") == IDNO) + return S_OK; + break; + default: + /* we have more than one item, so show a message box with the count of the items */ + if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEMULTIPLE_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET), + MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, count) == IDNO) + return S_OK; + } + } if (dwFlags & SHERB_NOPROGRESSUI)