- Now that we correctly handle the shell link data block list with APIs, no need to hack an extra zeroed DWORD at the end of shortcut files!
- Fix the display of the shortcut target location: this typically displays the (last) directory where the target resides. Addendum for r53624, r54957 and CORE-5730 CORE-6104
svn path=/trunk/; revision=73578
- DWORD dwZero;
- hr = stm->Read(&dwZero, sizeof(dwZero), &dwBytesRead);
- if (FAILED(hr) || dwZero || dwBytesRead != sizeof(dwZero))
- ERR("Last word was not zero\n");
-
TRACE("OK\n");
pdump(m_pPidl);
TRACE("OK\n");
pdump(m_pPidl);
if (fClearDirty)
m_bDirty = FALSE;
if (fClearDirty)
m_bDirty = FALSE;
- /* The last field is a single zero dword */
- DWORD dwZero = 0;
- hr = stm->Write(&dwZero, sizeof(dwZero), &count);
-
StringCchPrintfExW(wszBuf, _countof(wszBuf), &pwszEnd, &cchRemaining, 0, L"%s ", pwszExt + 1);
}
else
StringCchPrintfExW(wszBuf, _countof(wszBuf), &pwszEnd, &cchRemaining, 0, L"%s ", pwszExt + 1);
}
else
- StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s (%s)", fi.szTypeName, pwszExt); /* Update file type */
+ {
+ /* Update file type */
+ StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s (%s)", fi.szTypeName, pwszExt);
+ }
/* Get file information */
// FIXME! FIXME! Shouldn't we use pThis->m_sIcoPath, pThis->m_Header.nIconIndex instead???
SHFILEINFOW fi;
/* Get file information */
// FIXME! FIXME! Shouldn't we use pThis->m_sIcoPath, pThis->m_Header.nIconIndex instead???
SHFILEINFOW fi;
- if (!SHGetFileInfoW(pThis->m_sLinkPath, 0, &fi, sizeof(fi), SHGFI_TYPENAME|SHGFI_ICON))
+ if (!SHGetFileInfoW(pThis->m_sLinkPath, 0, &fi, sizeof(fi), SHGFI_TYPENAME | SHGFI_ICON))
{
ERR("SHGetFileInfoW failed for %ls (%lu)\n", pThis->m_sLinkPath, GetLastError());
fi.szTypeName[0] = L'\0';
{
ERR("SHGetFileInfoW failed for %ls (%lu)\n", pThis->m_sLinkPath, GetLastError());
fi.szTypeName[0] = L'\0';
else
ERR("ExtractIconW failed %ls %u\n", pThis->m_sIcoPath, pThis->m_Header.nIconIndex);
else
ERR("ExtractIconW failed %ls %u\n", pThis->m_sIcoPath, pThis->m_Header.nIconIndex);
if (pThis->m_sPath)
SetDlgItemTextW(hwndDlg, 14005, SH_GetTargetTypeByPath(pThis->m_sPath));
if (pThis->m_sPath)
SetDlgItemTextW(hwndDlg, 14005, SH_GetTargetTypeByPath(pThis->m_sPath));
- /* target location */
- if (pThis->m_sWorkDir)
- SetDlgItemTextW(hwndDlg, 14007, PathFindFileName(pThis->m_sWorkDir));
+ /* Target location */
+ if (pThis->m_sPath)
+ {
+ WCHAR target[MAX_PATH];
+ StringCchCopyW(target, _countof(target), pThis->m_sPath);
+ PathRemoveFileSpecW(target);
+ SetDlgItemTextW(hwndDlg, 14007, PathFindFileNameW(target));
+ }
if (pThis->m_sPath)
{
WCHAR newpath[2*MAX_PATH] = L"\0";
if (pThis->m_sPath)
{
WCHAR newpath[2*MAX_PATH] = L"\0";
}
SetDlgItemTextW(hwndDlg, 14009, newpath);
}
}
SetDlgItemTextW(hwndDlg, 14009, newpath);
}
if (pThis->m_sWorkDir)
SetDlgItemTextW(hwndDlg, 14011, pThis->m_sWorkDir);
if (pThis->m_sWorkDir)
SetDlgItemTextW(hwndDlg, 14011, pThis->m_sWorkDir);
if (pThis->m_sDescription)
SetDlgItemTextW(hwndDlg, 14019, pThis->m_sDescription);
return TRUE;
}
if (pThis->m_sDescription)
SetDlgItemTextW(hwndDlg, 14019, pThis->m_sDescription);
return TRUE;
}
case WM_NOTIFY:
{
LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
case WM_NOTIFY:
{
LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
if (!PathFileExistsW(unquoted))
{
if (!PathFileExistsW(unquoted))
{
- //FIXME load localized error msg
+ // FIXME load localized error msg
MessageBoxW(hwndDlg, L"The specified file name in the target box is invalid", L"Error", MB_ICONERROR);
SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
return TRUE;
MessageBoxW(hwndDlg, L"The specified file name in the target box is invalid", L"Error", MB_ICONERROR);
SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
/// open target directory
///
return TRUE;
/// open target directory
///
return TRUE;
case 14021:
{
WCHAR wszPath[MAX_PATH] = L"";
case 14021:
{
WCHAR wszPath[MAX_PATH] = L"";
pThis->SetIconLocation(wszPath, IconIndex);
///
/// FIXME redraw icon
pThis->SetIconLocation(wszPath, IconIndex);
///
/// FIXME redraw icon
if (HIWORD(wParam) == EN_CHANGE)
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;
if (HIWORD(wParam) == EN_CHANGE)
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;