[SHELL32_NEW]

- Merge 50899, 50941, 50957, 50964, 51053

- Check the correct pidl instead of the free one
- Found by the amazing DPH!
- Return the icon index, not the icon id
-Fix missing "Open" menu entry on right click for All Users desktop shortcuts.

svn path=/branches/shell32_new-bringup/; revision=51910
This commit is contained in:
Ged Murphy 2011-05-25 20:36:21 +00:00
parent 0026704626
commit 4c01e6ced5
5 changed files with 28 additions and 25 deletions

View file

@ -47,26 +47,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
UINT i;
int rootlen = 0,size = 0;
WCHAR wszRootPath[MAX_PATH];
int size = 0;
WCHAR wszFileName[MAX_PATH];
HGLOBAL hGlobal;
DROPFILES *pDropFiles;
int offset;
LPITEMIDLIST *pidls;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof *pidls);
if (!pidls) return NULL;
/* get the size needed */
size = sizeof(DROPFILES);
SHGetPathFromIDListW(pidlRoot, wszRootPath);
PathAddBackslashW(wszRootPath);
rootlen = wcslen(wszRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
size += (rootlen + wcslen(wszFileName) + 1) * sizeof(WCHAR);
pidls[i] = ILCombine(pidlRoot, apidl[i]);
SHGetPathFromIDListW(pidls[i], wszFileName);
size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
}
size += sizeof(WCHAR);
@ -80,19 +80,19 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
pDropFiles->pFiles = offset * sizeof(WCHAR);
pDropFiles->fWide = TRUE;
wcscpy(wszFileName, wszRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
SHGetPathFromIDListW(pidls[i], wszFileName);
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
offset += wcslen(wszFileName) + 1;
ILFree(pidls[i]);
}
((WCHAR*)pDropFiles)[offset] = 0;
GlobalUnlock(hGlobal);
HeapFree(GetProcessHeap(), 0, pidls);
return hGlobal;
}

View file

@ -63,7 +63,7 @@ BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule,
PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)lParam;
if (IS_INTRESOURCE(lpszName))
swprintf(szName, L"%u\n", lpszName);
swprintf(szName, L"%u", lpszName);
else
wcscpy(szName, (WCHAR*)lpszName);
@ -105,7 +105,7 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
LPMEASUREITEMSTRUCT lpmis;
LPDRAWITEMSTRUCT lpdis;
HICON hIcon;
INT index;
INT index, count;
WCHAR szText[MAX_PATH], szTitle[100], szFilter[100];
OPENFILENAMEW ofn = {0};
@ -123,18 +123,21 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
else
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)pIconContext->szName);
swprintf(szText, L"%u", pIconContext->Index);
index = SendMessageW(pIconContext->hDlgCtrl, LB_FINDSTRING, -1, (LPARAM)szText);
if (index != LB_ERR)
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, index, 0);
count = SendMessage(pIconContext->hDlgCtrl, LB_GETCOUNT, 0, 0);
if (count != LB_ERR)
{
if (count > pIconContext->Index)
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, pIconContext->Index, 0);
else
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
}
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
index = SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0);
SendMessageW(pIconContext->hDlgCtrl, LB_GETTEXT, index, (LPARAM)szText);
pIconContext->Index = _wtoi(szText);
pIconContext->Index = index;
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_GETTEXT, MAX_PATH, (LPARAM)pIconContext->szName);
DestroyIconList(pIconContext->hDlgCtrl);
EndDialog(hwndDlg, 1);

View file

@ -183,8 +183,8 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
if (NULL == SelectObject(ShortcutDC, ShortcutIconInfo.hbmColor)) goto fail;
if (!MaskBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight,
ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0,
MAKEROP4(SRCCOPY, 0xAA0000)))
ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0,
MAKEROP4(0xAA0000, SRCCOPY)))
{
goto fail;
}

View file

@ -1059,8 +1059,8 @@ COpenWithMenu::SHEOW_LoadOpenWithItems(IDataObject *pdtobj)
ERR("no mem\n");
return E_OUTOFMEMORY;
}
if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) || _ILIsNetHood(pidl_child) ||
_ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child) || _ILIsControlPanel(pidl_folder))
if (_ILIsDesktop(pidl) || _ILIsMyDocuments(pidl) || _ILIsControlPanel(pidl) || _ILIsNetHood(pidl) ||
_ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl) || _ILIsControlPanel(pidl))
{
TRACE("pidl is a folder\n");
SHFree((void*)pidl);

View file

@ -1712,7 +1712,7 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
case LVN_ENDLABELEDITW:
{
TRACE("-- LVN_ENDLABELEDITA %p\n", this);
TRACE("-- LVN_ENDLABELEDITW %p\n", this);
if (lpdi->item.pszText)
{
HRESULT hr;