本文整理汇总了C++中ListView_DeleteAllItems函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_DeleteAllItems函数的具体用法?C++ ListView_DeleteAllItems怎么用?C++ ListView_DeleteAllItems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_DeleteAllItems函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadAtomTable
static VOID LoadAtomTable(VOID)
{
PATOM_TABLE_INFORMATION atomTable = NULL;
ListView_DeleteAllItems(ListViewWndHandle);
if (!NT_SUCCESS(PhEnumAtomTable(&atomTable)))
return;
for (ULONG i = 0; i < atomTable->NumberOfAtoms; i++)
{
PATOM_BASIC_INFORMATION atomInfo = NULL;
if (!NT_SUCCESS(PhQueryAtomTableEntry(atomTable->Atoms[i], &atomInfo)))
{
PhAddListViewItem(ListViewWndHandle, MAXINT, PhaFormatString(L"(Error) #%lu", i)->Buffer, NULL);
continue;
}
if ((atomInfo->Flags & RTL_ATOM_PINNED) == RTL_ATOM_PINNED)
{
INT index = PhAddListViewItem(
ListViewWndHandle,
MAXINT,
PhaFormatString(L"%s (Pinned)", atomInfo->Name)->Buffer,
NULL
);
PhSetListViewSubItem(
ListViewWndHandle,
index,
1,
PhaFormatString(L"%u", atomInfo->UsageCount)->Buffer
);
}
else
{
INT index = PhAddListViewItem(
ListViewWndHandle,
MAXINT,
atomInfo->Name,
NULL
);
PhSetListViewSubItem(
ListViewWndHandle,
index,
1,
PhaFormatString(L"%u", atomInfo->UsageCount)->Buffer
);
}
PhFree(atomInfo);
}
PhFree(atomTable);
}
开发者ID:phplugins,项目名称:plugins-extra,代码行数:55,代码来源:main.c
示例2: GetDlgItem
void COutputDialog::UpdateFilterGrid()
{
CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
CWnd* pFilterOpt = GetDlgItem(IDC_EDIT_FILTER_OPTION_STRING);
CWnd* pFilterStatic = GetDlgItem(IDC_STATIC_FILTER_1);
if(NULL == pList || NULL == pFilterOpt || NULL == pFilterStatic) return;
// 등록 리스트 가져와서
ATPLUGIN_ARGUMENT_ARRAY aPluginArgs;
(MAINAPP)->m_cMultiPlugin.GetPluginArgs(aPluginArgs);
// 리스트뷰 전체 삭제
ListView_DeleteAllItems(pList->m_hWnd);
// 재등록
TCHAR szBuffer[1024];
LVITEM lvItem;
ZeroMemory(&lvItem, sizeof(lvItem));
lvItem.mask=LVIF_TEXT;
lvItem.pszText=szBuffer;
CString strFilterOpt = _T("");
for(size_t i=0; i< aPluginArgs.size(); i++)
{
lvItem.iItem=i;
lvItem.iSubItem=0;
lstrcpyn(szBuffer, aPluginArgs[i].strPluginName.c_str(), 1024);
ListView_InsertItem(pList->m_hWnd, &lvItem);
lstrcpyn(szBuffer, aPluginArgs[i].strOption.c_str(), 4096);
ListView_SetItemText(pList->m_hWnd, i, 1, szBuffer);
if(strFilterOpt.IsEmpty())
{
strFilterOpt = CString(_T("/f:")) + aPluginArgs[i].strPluginName.c_str()
+ _T("{") + aPluginArgs[i].strOption.c_str() + _T("}");
}
else
{
strFilterOpt += CString(_T(",")) + aPluginArgs[i].strPluginName.c_str()
+ _T("{") + aPluginArgs[i].strOption.c_str() + _T("}");
}
}
::EnableWindow(pList->m_hWnd, TRUE);
pFilterOpt->SetWindowText(strFilterOpt);
BOOL bEnable = strFilterOpt.IsEmpty() ? FALSE : TRUE;
::EnableWindow(pFilterOpt->m_hWnd, bEnable);
::EnableWindow(pFilterStatic->m_hWnd, bEnable);
OnNMClickListFilter(NULL, NULL);
return;
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:55,代码来源:OutputDialog.cpp
示例3: TreeList_ResetItem
void TreeList_ResetItem(HWND hwnd, HTREELISTITEM hParent)
{
TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);
for (int i = hParent->subItems.getCount(); i--;)
delete hParent->subItems[i];
hParent->subItems.destroy();
data->hItemSelected = hParent;
ListView_DeleteAllItems(hwnd);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:11,代码来源:jabber_treelist.cpp
示例4: ListView_DeleteAllItems
void ListView::resetValues(int codepage)
{
if (codepage == -1)
codepage = 0;
if (_codepage == codepage)
return;
ListView_DeleteAllItems(_hSelf);
setValues(codepage);
}
开发者ID:Arbitel,项目名称:notepad-plus-plus,代码行数:11,代码来源:ListView.cpp
示例5: DeleteAllItems
// This method deletes all items from the listview
void DeleteAllItems()
{
CItemData *pid;
for (int i = 0; i < _numRows; i++) {
pid = ItemData(i);
if (pid)
delete pid;
}
ListView_DeleteAllItems(_hList);
_numRows = 0;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:13,代码来源:dlg_anniversarylist.cpp
示例6: GetDlgItem
/*
================
rvOpenFileDialog::UpdateFileList
Updates the file list with the files that match the filter in the current
look in directory
================
*/
void rvOpenFileDialog::UpdateFileList ( void )
{
const char *basepath = mLookin;
idFileList *files;
HWND list = GetDlgItem ( mWnd, IDC_TOOLS_FILELIST );
int i;
int filter;
ListView_DeleteAllItems ( list );
// Add all the folders first
files = fileSystem->ListFiles ( basepath, "/", true );
for ( i = 0; i < files->GetNumFiles(); i ++ )
{
if ( files->GetFile( i )[0] == '.' )
{
continue;
}
LVITEM item;
memset(&item,0,sizeof(item));
item.mask = LVIF_TEXT;
item.iItem = ListView_GetItemCount ( list );
item.pszText = (LPSTR)files->GetFile( i );
item.iSubItem = 0;
ListView_InsertItem ( list, &item );
}
fileSystem->FreeFileList( files );
// Add all the files in the current lookin directory that match the
// current filters.
for ( filter = 0; filter < mFilters.Num(); filter ++ )
{
files = fileSystem->ListFiles( basepath, mFilters[filter], true );
for ( i = 0; i < files->GetNumFiles(); i ++ )
{
if ( files->GetFile( i )[0] == '.' )
{
continue;
}
LVITEM item;
memset(&item,0,sizeof(item));
item.mask = LVIF_TEXT|LVIF_IMAGE;
item.iImage = 2;
item.iItem = ListView_GetItemCount( list );
item.pszText = (LPSTR)files->GetFile( i );
item.iSubItem = 0;
ListView_InsertItem ( list, &item );
}
fileSystem->FreeFileList( files );
}
}
开发者ID:BielBdeLuna,项目名称:StormEngine2,代码行数:61,代码来源:OpenFileDialog.cpp
示例7: ListView_DeleteAllItems
void AudioGroupFilePresenter::populateGroupColumn(VSTEditor& editor, int collectionIdx, int fileIdx) {
LVITEM item = {};
item.mask = LVIF_TEXT;
ListView_DeleteAllItems(editor.m_groupListView);
ListView_DeleteAllItems(editor.m_pageListView);
if (collectionIdx < m_iteratorVec.size()) {
CollectionIterator& it = m_iteratorVec[collectionIdx];
if (fileIdx < it->second->m_iteratorVec.size()) {
size_t idx = 0;
AudioGroupCollection::GroupIterator& git = it->second->m_iteratorVec[fileIdx];
for (AudioGroupDataCollection::GroupToken& gtok : git->second->m_groupTokens) {
wchar_t name[256];
wnsprintf(name, 256, L"%d (%s)", gtok.m_groupId, gtok.m_song ? L"Song" : L"SFX");
item.pszText = name;
item.iItem = idx++;
ListView_InsertItem(editor.m_groupListView, &item);
}
}
}
}
开发者ID:AxioDL,项目名称:amuse,代码行数:21,代码来源:AudioGroupFilePresenter.cpp
示例8: InitDlgRegfile
//------------------------------------------------------------------------------
void InitDlgRegfile()
{
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_NTUSER),"");
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SAM),"");
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SECURITY),"");
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SOFTWARE),"");
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SYSTEM),"");
SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_OTHER),"");
TreeView_DeleteAllItems(GetDlgItem(h_reg,TV_VIEW));
ListView_DeleteAllItems(GetDlgItem(h_reg,LV_VIEW));
}
开发者ID:lukevoliveir,项目名称:omnia-projetcs,代码行数:13,代码来源:tools_registry.c
示例9: StopWatch_Start
void StopWatch_Start(HWND hDlg){
if(m_start.QuadPart){
KillTimer(hDlg, 1);
}
ListView_DeleteAllItems(GetDlgItem(hDlg,IDC_SW_LAPS));
QueryPerformanceCounter(&m_start);
m_lap = m_start;
m_paused = 0;
SetTimer(hDlg, 1, 7, NULL);
SetDlgItemText(hDlg, IDC_SW_START, L"Stop (s)");
EnableDlgItem(hDlg, IDC_SW_RESET, 1);
}
开发者ID:heicks,项目名称:T-Clock,代码行数:12,代码来源:StopWatch.c
示例10: StopWatch_Reset
void StopWatch_Reset(HWND hDlg){
if(!m_start.QuadPart)
return;
SetDlgItemText(hDlg, IDC_SW_ELAPSED, TIMETEXT_DEFAULT);
ListView_DeleteAllItems(GetDlgItem(hDlg,IDC_SW_LAPS));
if(m_paused){ // paused
m_start.QuadPart=0;
EnableDlgItemSafeFocus(hDlg,IDC_SW_RESET,0,IDC_SW_START);
}else{ // running
QueryPerformanceCounter(&m_start);
m_lap=m_start;
}
}
开发者ID:heicks,项目名称:T-Clock,代码行数:13,代码来源:StopWatch.c
示例11: ListView_DeleteAllItems
/*
================
rvGENavigator::Update
Updates the contents of the navigator window from the current workspace
================
*/
void rvGENavigator::Update( void ) {
// Clear the list first
ListView_DeleteAllItems( mTree );
// Add starting with the desktop window
if( mWorkspace ) {
AddWindow( mWorkspace->GetInterface( )->GetDesktop( ) );
}
// For some reason the horizontal scrollbar wants to show up initially after an update
// so this forces it not to
RECT rClient;
GetClientRect( mTree, &rClient );
ListView_SetColumnWidth( mTree, 0, rClient.right - rClient.left - 1 );
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:20,代码来源:GENavigator.cpp
示例12: InitLangList
void InitLangList()
{
char colTitles[LANG_LINE_SIZE];
char *catStr;
char lineStr[LANG_LINE_SIZE];
short i;
short category = -1;
changedSomeStrings = 0;
alreadySaving = 0;
// If we have already displayed (created) the list,
// then week need to delete the column headings... this seems to do it...
if ( hWndLangBuilderListView )
{
ListView_DeleteColumn( hWndLangBuilderListView, EDIT_LANGUAGE_LISTVIEW_POS );
ListView_DeleteColumn( hWndLangBuilderListView, DEFAULT_ENGLISH_LISTVIEW_POS );
ListView_DeleteColumn( hWndLangBuilderListView, CATEGORY_NAME_LISTVIEW_POS );
}
// Initialise the Language list, means creating the column titles and adding them,
// then making sure there is no data in the list
mystrncpyNull( colTitles, ReturnString( IDS_LANGBUILDER_LISTTITLES ), LANG_LINE_SIZE );
mystrncatNull( colTitles, MyPrefStruct.language, LANG_LINE_SIZE );
hWndLangBuilderListView = InitGenericListView( hDlg, IDC_LANGTOKEN_LIST, 0, 0, colTitles );
ListView_DeleteAllItems( hWndLangBuilderListView );
ListView_SetColumnWidth( hWndLangBuilderListView, CATEGORY_NAME_LISTVIEW_POS, 100 );
ListView_SetColumnWidth( hWndLangBuilderListView, DEFAULT_ENGLISH_LISTVIEW_POS, 200 );
ListView_SetColumnWidth( hWndLangBuilderListView, EDIT_LANGUAGE_LISTVIEW_POS, 200 );
// Add the Language strings to the list
for ( i = SUMM_BEGIN; i < END_OF_STRINGS; i++ )
{
catStr = GetLangSectionName(i);
if ( !catStr )
continue;
mystrncpyNull( lineStr, catStr, LANG_LINE_SIZE );
mystrncatNull( lineStr, LANG_LIST_SEP, LANG_LINE_SIZE );
mystrncatNull( lineStr, DefaultEnglishStr(i), LANG_LINE_SIZE );
mystrncatNull( lineStr, LANG_LIST_SEP, LANG_LINE_SIZE );
mystrncatNull( lineStr, TranslateID(i), LANG_LINE_SIZE );
AddItemToListView( hWndLangBuilderListView, ListView_GetItemCount(hWndLangBuilderListView), 3, lineStr, LANG_LIST_SEP );
}
ListView_GetItemText( hWndLangBuilderListView, 0, EDIT_LANGUAGE_LISTVIEW_POS, lineStr, LANG_LINE_SIZE );
SetWindowText( GetDlgItem( hDlg, IDC_LANGTOKEN_TEXT), lineStr );
SetFocus( GetDlgItem( hDlg, IDC_LANGTOKEN_LIST ) );
int state = LVIS_SELECTED|LVIS_FOCUSED;
if ( hWndLangBuilderListView )
ListView_SetItemState( hWndLangBuilderListView, 0, state, state );
}
开发者ID:rauls,项目名称:iReporter,代码行数:50,代码来源:LangBuilderGUI.cpp
示例13: SongListClear
void SongListClear()
{
PLAYERINFO* next = first;
while (next != NULL)
{
PLAYERINFO* current = next;
next = next->next;
PlayInfoRelease(current, TRUE);
}
ListView_DeleteAllItems(songlist.hWnd);
first = NULL;
last = NULL;
}
开发者ID:hihua,项目名称:hihuacode,代码行数:14,代码来源:SongList.cpp
示例14: EnableMenuItem
bool NGMainWnd::onnet_disconnect(void) {
EnableMenuItem(GetSubMenu(this->hmenu, 0), IDM_CONNECT, MF_BYCOMMAND | MF_ENABLED);
EnableMenuItem(GetSubMenu(this->hmenu, 0), IDM_DISCONNECT, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(this->hmenu, 1, MF_BYPOSITION | MF_GRAYED);
EnableMenuItem(this->hmenu, 2, MF_BYPOSITION | MF_GRAYED);
DrawMenuBar(this->hwnd);
ListView_DeleteAllItems(this->hplwnd);
ListView_DeleteAllItems(this->hfilewnd);
TreeView_DeleteAllItems(this->hbrowsewnd);
this->playlist.clear();
this->playlist_pos = -1;
this->playlist_size = 0;
this->browsenodes.clear();
this->browseindex = -1;
if (this->dragndrop != NULL) {
delete this->dragndrop;
this->dragndrop = NULL;
}
this->toolbox_select(TOOLBOX_CONNECT);
return true;
}
开发者ID:nitrotm,项目名称:ngwinamp2,代码行数:23,代码来源:mainwnd_netevents.cpp
示例15: DhcpRefresh_ListView
// -------------------------------------
// ListView management
// --------------------------------------
void DhcpRefresh_ListView ( int nbLeases, struct S_Lease tLeases[] )
{
struct tm ltime;
int Ark;
char szDate[64];
LVITEM LvItem;
int itemPos;
HWND hListV;
HWND hWnd = hDbgMainWnd;
memset (&LvItem, 0, sizeof LvItem);
while (GetParent (hWnd)!=NULL) hWnd=GetParent(hWnd);
hListV = GetDlgItem (hWnd, IDC_LV_DHCP);
ListView_DeleteAllItems (hListV);
for (Ark = 0 ; Ark < nbLeases ; Ark++ )
{
LvItem.mask = LVIF_PARAM | LVIF_STATE;
LvItem.state = 0;
LvItem.stateMask = 0;
LvItem.iItem = Ark; // numéro de l'item
LvItem.iSubItem = 0; // index dans la ligne
LvItem.lParam = inet_addr (tLeases[Ark].szIP); // keep track of assignation
itemPos = ListView_InsertItem(hListV,(LPARAM)&LvItem);
#ifdef _MSC_VER
localtime_s (<ime, & tLeases[Ark].tAllocated);
#else
memcpy (& ltime, localtime (& tLeases[Ark].tAllocated), sizeof ltime);
#endif
wsprintf (szDate, "%02d/%02d %02d:%02d:%02d",
ltime.tm_mon+1, ltime.tm_mday,ltime.tm_hour, ltime.tm_min, ltime.tm_sec);
ListView_SetItemText (hListV, itemPos, 0, szDate);
ListView_SetItemText (hListV, itemPos, 1, tLeases[Ark].szIP);
ListView_SetItemText (hListV, itemPos, 2, tLeases[Ark].szMAC);
if (tLeases[Ark].tRenewed != 0)
{
#ifdef _MSC_VER
localtime_s (<ime, & tLeases[Ark].tRenewed);
#else
memcpy (& ltime, localtime (& tLeases[Ark].tRenewed), sizeof ltime);
#endif
wsprintf (szDate, "%02d/%02d %02d:%02d:%02d",
ltime.tm_mon+1, ltime.tm_mday,ltime.tm_hour, ltime.tm_min, ltime.tm_sec);
ListView_SetItemText (hListV, itemPos, 3, szDate);
} // renew ! =0
} // parse all alocations
} // DhcpRefresh_ListView
开发者ID:julchar,项目名称:tftpd-64,代码行数:53,代码来源:gui_bootpd.c
示例16: DlgProc_Browse_StartSearch
BOOL DlgProc_Browse_StartSearch (BROWSEDIALOGPARAMS *pbdp, BOOL fCloseDlgIfFail)
{
DWORD dwThreadID;
// Can't start a new search until the old search terminates.
//
DlgProc_Browse_StopSearch (pbdp);
// Then make sure that we have a valid cell to query--if not, it may
// be grounds to terminate the entire browse dialog.
//
lstrcpy (pbdp->szThreadCell, pbdp->szCell);
if (!pbdp->szCell[0])
{
AfsAppLib_GetLocalCell (pbdp->szCell);
lstrcpy (pbdp->szThreadCell, pbdp->szCell);
DlgProc_Browse_UpdateCellText (pbdp, pbdp->szThreadCell);
}
if (!pbdp->szCell[0])
{
if (fCloseDlgIfFail)
EndDialog (pbdp->hDlg, IDCANCEL);
MessageBeep (MB_ICONHAND);
Message (MB_ICONHAND, IDS_BROWSE_BADCELL_TITLE, IDS_BROWSE_BADCELL_DESC);
if (!fCloseDlgIfFail)
PostMessage (pbdp->hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (pbdp->hDlg, IDC_BROWSE_CELL), (LPARAM)TRUE);
return FALSE;
}
// Great--we can do the search. Start a thread to do so.
//
pbdp->fCanStopThreadEasily = FALSE;
pbdp->fShouldStopThread = FALSE;
pbdp->fThreadActive = FALSE;
ListView_DeleteAllItems (GetDlgItem (pbdp->hDlg, IDC_BROWSE_LIST));
pbdp->hThread = CreateThread (NULL, 0,
(LPTHREAD_START_ROUTINE)DlgProc_Browse_ThreadProc,
pbdp, 0, &dwThreadID);
return (pbdp->hThread == 0) ? FALSE : TRUE;
}
开发者ID:maxendpoint,项目名称:openafs_cvs,代码行数:49,代码来源:al_browse.cpp
示例17: GetDlgItem
/*
** Updates the list of skins.
**
*/
void CDialogAbout::CTabSkins::UpdateSkinList()
{
// Delete all entries
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTBOX);
ListBox_ResetContent(item);
// Add entries for each skin
std::wstring::size_type maxLength = 0;
const std::map<std::wstring, CMeterWindow*>& windows = Rainmeter->GetAllMeterWindows();
std::map<std::wstring, CMeterWindow*>::const_iterator iter = windows.begin();
bool found = false;
for ( ; iter != windows.end(); ++iter)
{
const std::wstring& skinName = (*iter).first;
std::wstring::size_type curLength = skinName.length();
if (curLength > maxLength)
{
maxLength = curLength;
}
const WCHAR* name = skinName.c_str();
int index = ListBox_AddString(item, name);
if (!found && m_SkinWindow == (*iter).second)
{
found = true;
m_SkinWindow = (*iter).second;
ListBox_SetCurSel(item, index);
}
}
ListBox_SetHorizontalExtent(item, 6 * maxLength);
if (!found)
{
if (windows.empty())
{
m_SkinWindow = NULL;
item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW);
ListView_DeleteAllItems(item);
}
else
{
// Default to first skin
m_SkinWindow = (*windows.begin()).second;
ListBox_SetCurSel(item, 0);
UpdateMeasureList(m_SkinWindow);
}
}
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:53,代码来源:DialogAbout.cpp
示例18: GetDlgItem
DWORD MainDlg::RefreshDiskList()
{
std::vector<PhysicalDisk*> disks;
PhysicalDisk::EnumDisks( disks );
HWND hList = GetDlgItem( _hMainDlg, IDC_LIST_DISKS );
ListView_DeleteAllItems( hList );
for (auto& disk : disks)
{
auto& id_data = disk->id_data();
LVITEMW lvi = { 0 };
int idx = 0;
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.pszText = (LPWSTR)disk->path().c_str();
lvi.cchTextMax = (int)disk->path().length() + 1;
lvi.lParam = reinterpret_cast<LPARAM>(disk);
int pos = ListView_InsertItem( hList, &lvi );
LVITEMA lva = { 0 };
for (idx = sizeof(id_data.ModelNumber) - 3; idx >= 0; idx--)
if (id_data.ModelNumber[idx] != ' ')
break;
std::string tmpstr( (LPSTR)id_data.ModelNumber, (LPSTR)id_data.ModelNumber + idx );
lva.iSubItem = 1;
lva.pszText = disk->identified() ? (LPSTR)tmpstr.c_str() : "Unknown";
SendMessage( hList, LVM_SETITEMTEXTA, pos, (LPARAM)&lva );
for (idx = 0; idx < sizeof(id_data.SerialNumber); idx++)
if (id_data.SerialNumber[idx] != ' ')
break;
tmpstr = std::string( (LPSTR)(id_data.SerialNumber + idx), (LPSTR)(id_data.SerialNumber + sizeof(id_data.SerialNumber)) );
lva.iSubItem = 2;
lva.pszText = disk->identified() ? (LPSTR)tmpstr.c_str() : "Unknown";
SendMessage( hList, LVM_SETITEMTEXTA, pos, (LPARAM)&lva );
}
return ERROR_SUCCESS;
}
开发者ID:DarthTon,项目名称:SecureEraseWin,代码行数:49,代码来源:Routines.cpp
示例19: add_items
static int add_items() {
ListView_DeleteAllItems(g_lv.lv);
int style = ::SendMessage(g_lv.lv, LVM_GETVIEW, 0, 0);
if (style == LV_VIEW_TILE) {
unsigned int n;
g_lv.dok = false;
::_beginthreadex(0, 0, display_tm, 0, 0, &n);
return 0;
}
SHFILEINFO si;
HIMAGELIST il = (HIMAGELIST)::SHGetFileInfo(L"", 0, &si, sizeof(si), SHGFI_SYSICONINDEX);
ListView_SetImageList(g_lv.lv, il, LVSIL_NORMAL);
LVITEM lvi;
lvi.pszText = L"";
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
lvi.stateMask = 0;
lvi.iSubItem = 0;
lvi.state = 0;
node* n = g_lv.n;
NIT it = n->childs.begin();
for (int i = 0; it != n->childs.end(); ++it, ++i) {
node* c = *it;
lvi.iItem = i;
c->i = i;
//SHFILEINFO si;
if (c->type == 0) {
SHGetFileInfo(L"folder", FILE_ATTRIBUTE_DIRECTORY, &si, sizeof(si),
SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
} else {
int pos = c->name.find(L'.');
if (pos != std::wstring::npos) {
std::wstring sf = c->name.substr(pos);
SHGetFileInfo(sf.c_str(), FILE_ATTRIBUTE_NORMAL, &si, sizeof(si),
SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
} else {
SHGetFileInfo(L"file", FILE_ATTRIBUTE_NORMAL, &si, sizeof(si),
SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
}
}
lvi.iImage = si.iIcon;
lvi.lParam = (LPARAM)c;
ListView_InsertItem(g_lv.lv, &lvi);
add_subtxt(i, c);
}
return 0;
}
开发者ID:wangch,项目名称:zipk,代码行数:49,代码来源:zipk.cpp
示例20: GetControl
/*
** Updates the list of skins.
**
*/
void DialogAbout::TabSkins::UpdateSkinList()
{
// Delete all entries
HWND item = GetControl(Id_SkinsListBox);
ListBox_ResetContent(item);
// Add entries for each skin
std::wstring::size_type maxLength = 0;
const std::map<std::wstring, Skin*>& windows = GetRainmeter().GetAllSkins();
std::map<std::wstring, Skin*>::const_iterator iter = windows.begin();
bool found = false;
for ( ; iter != windows.end(); ++iter)
{
const std::wstring& skinName = (*iter).first;
std::wstring::size_type curLength = skinName.length();
if (curLength > maxLength)
{
maxLength = curLength;
}
const WCHAR* name = skinName.c_str();
int index = ListBox_AddString(item, name);
if (!found && m_SkinWindow == (*iter).second)
{
found = true;
m_SkinWindow = (*iter).second;
ListBox_SetCurSel(item, index);
}
}
ListBox_SetHorizontalExtent(item, 6 * maxLength);
if (!found)
{
if (windows.empty())
{
m_SkinWindow = nullptr;
item = GetControl(Id_ItemsListView);
ListView_DeleteAllItems(item);
}
else
{
// Default to first skin
m_SkinWindow = (*windows.begin()).second;
ListBox_SetCurSel(item, 0);
UpdateMeasureList(m_SkinWindow);
}
}
}
开发者ID:AlonTzarafi,项目名称:rainmeter,代码行数:53,代码来源:DialogAbout.cpp
注:本文中的ListView_DeleteAllItems函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论