mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[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:
parent
0026704626
commit
4c01e6ced5
|
@ -47,26 +47,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
int rootlen = 0,size = 0;
|
int size = 0;
|
||||||
WCHAR wszRootPath[MAX_PATH];
|
|
||||||
WCHAR wszFileName[MAX_PATH];
|
WCHAR wszFileName[MAX_PATH];
|
||||||
HGLOBAL hGlobal;
|
HGLOBAL hGlobal;
|
||||||
DROPFILES *pDropFiles;
|
DROPFILES *pDropFiles;
|
||||||
int offset;
|
int offset;
|
||||||
|
LPITEMIDLIST *pidls;
|
||||||
|
|
||||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||||
|
|
||||||
|
pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof *pidls);
|
||||||
|
if (!pidls) return NULL;
|
||||||
|
|
||||||
/* get the size needed */
|
/* get the size needed */
|
||||||
size = sizeof(DROPFILES);
|
size = sizeof(DROPFILES);
|
||||||
|
|
||||||
SHGetPathFromIDListW(pidlRoot, wszRootPath);
|
|
||||||
PathAddBackslashW(wszRootPath);
|
|
||||||
rootlen = wcslen(wszRootPath);
|
|
||||||
|
|
||||||
for (i=0; i<cidl;i++)
|
for (i=0; i<cidl;i++)
|
||||||
{
|
{
|
||||||
_ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
|
pidls[i] = ILCombine(pidlRoot, apidl[i]);
|
||||||
size += (rootlen + wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||||
|
size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
size += sizeof(WCHAR);
|
size += sizeof(WCHAR);
|
||||||
|
@ -80,19 +80,19 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||||
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
||||||
pDropFiles->fWide = TRUE;
|
pDropFiles->fWide = TRUE;
|
||||||
|
|
||||||
wcscpy(wszFileName, wszRootPath);
|
|
||||||
|
|
||||||
for (i=0; i<cidl;i++)
|
for (i=0; i<cidl;i++)
|
||||||
{
|
{
|
||||||
|
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||||
_ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
|
|
||||||
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||||
offset += wcslen(wszFileName) + 1;
|
offset += wcslen(wszFileName) + 1;
|
||||||
|
ILFree(pidls[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
((WCHAR*)pDropFiles)[offset] = 0;
|
((WCHAR*)pDropFiles)[offset] = 0;
|
||||||
GlobalUnlock(hGlobal);
|
GlobalUnlock(hGlobal);
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, pidls);
|
||||||
|
|
||||||
return hGlobal;
|
return hGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule,
|
||||||
PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)lParam;
|
PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)lParam;
|
||||||
|
|
||||||
if (IS_INTRESOURCE(lpszName))
|
if (IS_INTRESOURCE(lpszName))
|
||||||
swprintf(szName, L"%u\n", lpszName);
|
swprintf(szName, L"%u", lpszName);
|
||||||
else
|
else
|
||||||
wcscpy(szName, (WCHAR*)lpszName);
|
wcscpy(szName, (WCHAR*)lpszName);
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
|
||||||
LPMEASUREITEMSTRUCT lpmis;
|
LPMEASUREITEMSTRUCT lpmis;
|
||||||
LPDRAWITEMSTRUCT lpdis;
|
LPDRAWITEMSTRUCT lpdis;
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
INT index;
|
INT index, count;
|
||||||
WCHAR szText[MAX_PATH], szTitle[100], szFilter[100];
|
WCHAR szText[MAX_PATH], szTitle[100], szFilter[100];
|
||||||
OPENFILENAMEW ofn = {0};
|
OPENFILENAMEW ofn = {0};
|
||||||
|
|
||||||
|
@ -123,18 +123,21 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
|
||||||
else
|
else
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)pIconContext->szName);
|
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)pIconContext->szName);
|
||||||
|
|
||||||
swprintf(szText, L"%u", pIconContext->Index);
|
count = SendMessage(pIconContext->hDlgCtrl, LB_GETCOUNT, 0, 0);
|
||||||
index = SendMessageW(pIconContext->hDlgCtrl, LB_FINDSTRING, -1, (LPARAM)szText);
|
if (count != LB_ERR)
|
||||||
if (index != LB_ERR)
|
{
|
||||||
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, index, 0);
|
if (count > pIconContext->Index)
|
||||||
|
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, pIconContext->Index, 0);
|
||||||
|
else
|
||||||
|
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
index = SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0);
|
index = SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0);
|
||||||
SendMessageW(pIconContext->hDlgCtrl, LB_GETTEXT, index, (LPARAM)szText);
|
pIconContext->Index = index;
|
||||||
pIconContext->Index = _wtoi(szText);
|
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_GETTEXT, MAX_PATH, (LPARAM)pIconContext->szName);
|
SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_GETTEXT, MAX_PATH, (LPARAM)pIconContext->szName);
|
||||||
DestroyIconList(pIconContext->hDlgCtrl);
|
DestroyIconList(pIconContext->hDlgCtrl);
|
||||||
EndDialog(hwndDlg, 1);
|
EndDialog(hwndDlg, 1);
|
||||||
|
|
|
@ -183,8 +183,8 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
|
||||||
if (NULL == SelectObject(ShortcutDC, ShortcutIconInfo.hbmColor)) goto fail;
|
if (NULL == SelectObject(ShortcutDC, ShortcutIconInfo.hbmColor)) goto fail;
|
||||||
if (!MaskBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight,
|
if (!MaskBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight,
|
||||||
ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
|
ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
|
||||||
ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0,
|
ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0,
|
||||||
MAKEROP4(SRCCOPY, 0xAA0000)))
|
MAKEROP4(0xAA0000, SRCCOPY)))
|
||||||
{
|
{
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1059,8 +1059,8 @@ COpenWithMenu::SHEOW_LoadOpenWithItems(IDataObject *pdtobj)
|
||||||
ERR("no mem\n");
|
ERR("no mem\n");
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) || _ILIsNetHood(pidl_child) ||
|
if (_ILIsDesktop(pidl) || _ILIsMyDocuments(pidl) || _ILIsControlPanel(pidl) || _ILIsNetHood(pidl) ||
|
||||||
_ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child) || _ILIsControlPanel(pidl_folder))
|
_ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl) || _ILIsControlPanel(pidl))
|
||||||
{
|
{
|
||||||
TRACE("pidl is a folder\n");
|
TRACE("pidl is a folder\n");
|
||||||
SHFree((void*)pidl);
|
SHFree((void*)pidl);
|
||||||
|
|
|
@ -1712,7 +1712,7 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||||
|
|
||||||
case LVN_ENDLABELEDITW:
|
case LVN_ENDLABELEDITW:
|
||||||
{
|
{
|
||||||
TRACE("-- LVN_ENDLABELEDITA %p\n", this);
|
TRACE("-- LVN_ENDLABELEDITW %p\n", this);
|
||||||
if (lpdi->item.pszText)
|
if (lpdi->item.pszText)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
Loading…
Reference in a new issue