MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / DirList_GetItem

Function DirList_GetItem

src/Dlapi.c:681–759  ·  view source on GitHub ↗

============================================================================= DirList_GetItem() Copies the data of the specified item in the listview control to a buffer

Source from the content-addressed store, hash-verified

679// Copies the data of the specified item in the listview control to a buffer
680//
681int DirList_GetItem(HWND hwnd,int iItem,LPDLITEM lpdli)
682{
683
684 LV_ITEM lvi;
685 LPLV_ITEMDATA lplvid;
686
687 ULONG dwAttributes = SFGAO_FILESYSTEM;
688
689
690 if (iItem == -1)
691 {
692
693 if (ListView_GetSelectedCount(hwnd))
694
695 iItem = ListView_GetNextItem(hwnd,-1,LVNI_ALL | LVNI_SELECTED);
696
697 else
698
699 return(-1);
700
701 }
702
703 lvi.mask = LVIF_PARAM;
704 lvi.iItem = iItem;
705 lvi.iSubItem = 0;
706
707 if (!ListView_GetItem(hwnd,&lvi))
708 {
709
710 if (lpdli->mask & DLI_TYPE)
711
712 lpdli->ntype = DLE_NONE;
713
714 return(-1);
715
716 }
717
718 lplvid = (LPLV_ITEMDATA)lvi.lParam;
719
720 // Filename
721 if (lpdli->mask & DLI_FILENAME)
722
723 IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_FORPARSING,
724 lpdli->szFileName,MAX_PATH);
725
726 // Displayname
727 if (lpdli->mask & DLI_DISPNAME)
728
729 IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_INFOLDER,
730 lpdli->szDisplayName,MAX_PATH);
731
732 // Type (File / Directory)
733 if (lpdli->mask & DLI_TYPE)
734 {
735
736 WIN32_FIND_DATA fd;
737
738 if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,

Callers 3

OpenWithDlgProcFunction · 0.85
FavoritesDlgProcFunction · 0.85
DirList_SelectItemFunction · 0.85

Calls 1

IL_GetDisplayNameFunction · 0.85

Tested by

no test coverage detected