| |
876 |
876 |
} |
| |
877 |
877 |
|
| |
878 |
878 |
|
| |
879 |
879 |
CShortcut sc; |
| |
880 |
880 |
sc.m_strPath=cbi.pszText; |
| |
881 |
881 |
SHFILEINFO sfi; |
| |
882 |
882 |
sfi.iIcon=-1; |
| |
883 |
883 |
SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); |
| |
884 |
884 |
|
| |
885 |
885 |
|
| |
886 |
886 |
m_bdData.cvShortcuts.push_back(sc); |
| |
887 |
887 |
int iIndex = boost::numeric_cast<int>(m_bdData.cvShortcuts.size() - 1); |
| |
888 |
888 |
m_ctlShortcuts.InsertItem(iIndex, sc.m_strName, sfi.iIcon); |
| |
889 |
889 |
m_ctlShortcuts.SetItem(iIndex, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); |
| |
890 |
890 |
|
| |
891 |
891 |
|
| |
892 |
892 |
m_ctlShortcuts.SetFocus(); |
| |
893 |
893 |
if (m_ctlShortcuts.EditLabel(iIndex) == nullptr) |
| |
894 |
894 |
{ |
| |
895 |
895 |
TRACE("Couldn't edit shortcut list's item label\n"); |
| |
896 |
|
return; |
| |
897 |
896 |
} |
| |
898 |
897 |
} |
| |
899 |
898 |
|
| |
900 |
899 |
|
| |
901 |
900 |
|
| |
902 |
901 |
void CFolderDialog::OnShortcutKeyDown(NMHDR* pNMHDR, LRESULT* ) |
| |
903 |
902 |
{ |
| |
904 |
903 |
LPNMLVKEYDOWN lpkd=(LPNMLVKEYDOWN)pNMHDR; |
| |
905 |
904 |
if (lpkd->wVKey == VK_DELETE) |
| |
906 |
905 |
OnRemoveShortcut(); |
| |
907 |
906 |
} |
| |
908 |
907 |
|
| |
909 |
908 |
|
| |
910 |
909 |
|
| |
911 |
910 |
void CFolderDialog::OnRemoveShortcut() |
| |
912 |
911 |
{ |
| |
913 |
912 |
POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); |
| |
914 |
913 |
if (pos) |
| |
915 |
914 |
{ |
| |
916 |
915 |
int iSel=m_ctlShortcuts.GetNextSelectedItem(pos); |