============================================================================= IL_GetDisplayName() Gets the Display Name of a pidl. lpsf is the parent IShellFolder Interface dwFlags specify a SHGDN_xx value
| 1529 | // dwFlags specify a SHGDN_xx value |
| 1530 | // |
| 1531 | BOOL IL_GetDisplayName(LPSHELLFOLDER lpsf, |
| 1532 | LPCITEMIDLIST pidl, |
| 1533 | DWORD dwFlags, |
| 1534 | LPWSTR lpszDisplayName, |
| 1535 | int nDisplayName) |
| 1536 | { |
| 1537 | |
| 1538 | STRRET str; |
| 1539 | |
| 1540 | if (NOERROR == lpsf->lpVtbl->GetDisplayNameOf(lpsf, |
| 1541 | pidl, |
| 1542 | dwFlags, |
| 1543 | &str)) |
| 1544 | { |
| 1545 | |
| 1546 | // Shlwapi.dll provides new function: |
| 1547 | return StrRetToBuf(&str,pidl,lpszDisplayName,nDisplayName); |
| 1548 | // ...but I suppose my version is faster ;-) |
| 1549 | /*switch (str.uType) |
| 1550 | { |
| 1551 | |
| 1552 | case STRRET_WSTR: |
| 1553 | WideCharToMultiByte(CP_ACP, |
| 1554 | 0, |
| 1555 | str.pOleStr, |
| 1556 | -1, |
| 1557 | lpszDisplayName, |
| 1558 | nDisplayName, |
| 1559 | NULL, |
| 1560 | NULL); |
| 1561 | CoTaskMemFree(str.pOleStr); |
| 1562 | break; |
| 1563 | |
| 1564 | case STRRET_OFFSET: |
| 1565 | lstrcpyn(lpszDisplayName, |
| 1566 | ((WCHAR *)(pidl)) + str.uOffset, |
| 1567 | nDisplayName); |
| 1568 | break; |
| 1569 | |
| 1570 | case STRRET_CSTR: |
| 1571 | lstrcpyn(lpszDisplayName,str.cStr,nDisplayName); |
| 1572 | break; |
| 1573 | |
| 1574 | } |
| 1575 | |
| 1576 | return TRUE;*/ |
| 1577 | } |
| 1578 | |
| 1579 | return FALSE; |
| 1580 | } |
| 1581 | |
| 1582 | |
| 1583 |
no outgoing calls
no test coverage detected