本文整理汇总了C++中ListView_GetNextItem函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_GetNextItem函数的具体用法?C++ ListView_GetNextItem怎么用?C++ ListView_GetNextItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_GetNextItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetDlgItem
void OBS::SelectSources()
{
if(scene)
scene->DeselectAll();
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
UINT numSelected = ListView_GetSelectedCount(hwndSources);
if(numSelected)
{
List<UINT> selectedItems;
selectedItems.SetSize(numSelected);
//SendMessage(hwndSources, LB_GETSELITEMS, numSelected, (LPARAM)selectedItems.Array());
if(scene)
{
int iPos = ListView_GetNextItem(hwndSources, -1, LVNI_SELECTED);
while (iPos != -1)
{
SceneItem *sceneItem = scene->GetSceneItem(iPos);
sceneItem->bSelected = true;
iPos = ListView_GetNextItem(hwndSources, iPos, LVNI_SELECTED);
}
}
}
}
开发者ID:SeargeDP,项目名称:OBS,代码行数:27,代码来源:OBS.cpp
示例2: ListView_GetNextItem
void CVideoMarkup::EmptyTrash() {
// delete all the samples in the "trash" group
int iItem = ListView_GetNextItem(m_sampleListView, -1, LVNI_ALL);
while (iItem != -1) {
LVITEM lvi;
lvi.mask = LVIF_IMAGE | LVIF_STATE | LVIF_GROUPID;
lvi.state = 0;
lvi.stateMask = 0;
lvi.iItem = iItem;
lvi.iSubItem = 0;
ListView_GetItem(m_sampleListView, &lvi);
int iNextItem = ListView_GetNextItem(m_sampleListView, iItem, LVNI_ALL);
if (lvi.iGroupId == GROUPID_TRASH) {
// remove this sample from the listview
UINT sampleIdToDelete = ListView_MapIndexToID(m_sampleListView, iItem);
ListView_DeleteItem(m_sampleListView, iItem);
// update sample in training set too
sampleSet.RemoveSample(sampleIdToDelete);
// indices have changed so we need to start at the beginning of the list again
iNextItem = ListView_GetNextItem(m_sampleListView, -1, LVNI_ALL);
}
iItem = iNextItem;
}
}
开发者ID:gotomypc,项目名称:eyepatch,代码行数:29,代码来源:VideoMarkup.cpp
示例3: ListView_GetNextItem
void MappingDlg::editMappingDataDlg()
{
int idx = ListView_GetNextItem(m_hList, -1, LVNI_FOCUSED);
if (idx == -1) {
idx = ListView_GetNextItem(m_hList, -1, LVNI_SELECTED);
if (idx == -1) {
return;
}
}
LV_ITEM item = { 0 };
item.mask = LVIF_PARAM;
item.iItem = idx;
item.iSubItem = 0;
ListView_GetItem(m_hList, &item);
if (item.lParam != NULL) {
MappingDataDlg dlg;
Mapping* btn = (Mapping*)item.lParam;
dlg.mappingData = *btn;
if (dlg.Open(m_hDlg)) {
*btn = dlg.mappingData;
ListView_DeleteItem(m_hList, idx);
insertMappingData(idx, btn);
m_change = true;
}
}
}
开发者ID:090,项目名称:DS4vJoy,代码行数:26,代码来源:MappingDlg.cpp
示例4: SetHotkey
VOID SetHotkey(HWND hwndList, DWORD dwKey)
{
LVITEM lvi;
char szBuffer[100];
lvi.iItem = -1;
lvi.iItem = ListView_GetNextItem(hwndList, lvi.iItem, LVIS_SELECTED);
while(lvi.iItem != -1)
{
lvi.mask = LVIF_PARAM;
lvi.iSubItem = 0;
ListView_GetItem(hwndList, &lvi);
if(dwKey == -1)
PHOTKEY_DATA(lvi.lParam)->dwValue = PHOTKEY_DATA(lvi.lParam)->dwDefault;
else
PHOTKEY_DATA(lvi.lParam)->dwValue = dwKey;
ListView_SetItem(hwndList, &lvi);
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 1;
lvi.pszText = HotkeyToString(PHOTKEY_DATA(lvi.lParam)->dwValue, szBuffer);
ListView_SetItem(hwndList, &lvi);
lvi.iItem = ListView_GetNextItem(hwndList, lvi.iItem, LVIS_SELECTED);
}
}
开发者ID:ohio813,项目名称:bwh14,代码行数:27,代码来源:hotkeys.cpp
示例5: ListView_GetNextItem
void SearchResults::getSelList(Array<String>& sel)
{
sel.clear();
for (int cur = ListView_GetNextItem(hWnd, -1, LVNI_SELECTED);
cur >= 0; cur = ListView_GetNextItem(hWnd, cur, LVNI_SELECTED))
sel.push(items[cur].path);
}
开发者ID:liyonghelpme,项目名称:dota-replay-manager,代码行数:7,代码来源:searchres.cpp
示例6: ListView_GetNextItem
void FormTagManager::DelTags(void)
{
::PrintLog(L"FormTagManager.DelTags.");
wchar_t selectedTags[MAXCOUNT_TAG][MAXLENGTH_EACHTAG] = {0};
int count = 0;
int searchFrom = -1;
int selectedIdx = -1;
// find first
selectedIdx = ListView_GetNextItem(_hListTags,searchFrom,LVIS_SELECTED);
while (selectedIdx > -1){
ListView_GetItemText(_hListTags,selectedIdx,0,selectedTags[count],MAXLENGTH_EACHTAG);
searchFrom = selectedIdx;
count++;
// find next
selectedIdx = ListView_GetNextItem(_hListTags,searchFrom,LVIS_SELECTED);
}
if ( NULL != selectedTags && count > 0)
{
wchar_t msg[LOADSTRING_BUFFERSIZE];
const int maxShown = 20;
const UINT len = (MAXLENGTH_EACHTAG + 3) * MAXCOUNT_TAG; // 3 for \0\r\n.
wchar_t tmp[len] = {0};
for (int i = 0; i < count && i < maxShown; i++)
{
StrCat(tmp,selectedTags[i]);
if(i < count -1 )
StrCat(tmp,L"\r\n");
}
if( maxShown < count ){
wsprintf(msg,::MyLoadString(IDS_MSG_MORE_N_HIDDEN),count-maxShown);
StrCat(tmp,L"\r\n");
StrCat(tmp,msg);
}
wsprintf(msg,::MyLoadString(IDS_MSG_CONFRIM_DEL_TAG),tmp);
int result = MessageBox(_hwnd,msg,::MyLoadString(IDS_MSGBOX_CAPTION_WARNING),MB_YESNO|MB_ICONWARNING|MB_DEFBUTTON1);
if( IDYES == result )
{
this->_handler->pTagHelper->DeleteTags(selectedTags,count);
LoadTags();
}
else
{
MessageBox(_hwnd,L"CANCEL",L"Warning",MB_OK);
}
}
else
{
// should not be occured.
::PrintLog(L"Selected none while deleting. Should not be occured here.");
}
}
开发者ID:uonun,项目名称:TaggableShell,代码行数:59,代码来源:Form.TagManager.cpp
示例7: AddSelectedGroupsToUser
static BOOL
AddSelectedGroupsToUser(HWND hwndDlg,
PMEMBERSHIP_USER_DATA pUserData)
{
HWND hwndLV;
INT nItem;
TCHAR szGroupName[UNLEN];
BOOL bResult = FALSE;
BOOL bFound;
DWORD i;
LOCALGROUP_MEMBERS_INFO_3 memberInfo;
NET_API_STATUS status;
hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST);
if (ListView_GetSelectedCount(hwndLV) > 0)
{
nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
while (nItem != -1)
{
/* Get the new user name */
ListView_GetItemText(hwndLV,
nItem, 0,
szGroupName,
UNLEN);
bFound = FALSE;
for (i = 0; i < pUserData->dwGroupCount; i++)
{
if (_tcscmp(pUserData->pGroupData[i].lgrui0_name, szGroupName) == 0)
bFound = TRUE;
}
if (!bFound)
{
memberInfo.lgrmi3_domainandname = pUserData->szUserName;
status = NetLocalGroupAddMembers(NULL, szGroupName, 3,
(LPBYTE)&memberInfo, 1);
if (status == NERR_Success)
{
DebugPrintf(_TEXT("Selected group: %s"), szGroupName);
bResult = TRUE;
}
else
{
TCHAR szText[256];
wsprintf(szText, TEXT("Error: %u"), status);
MessageBox(NULL, szText, TEXT("NetLocalGroupAddMembers"), MB_ICONERROR | MB_OK);
}
}
nItem = ListView_GetNextItem(hwndLV, nItem, LVNI_SELECTED);
}
}
return bResult;
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:58,代码来源:userprops.c
示例8: ListView_GetNextItem
/**
* @brief Makes specified item selected.
* @param[in] rowIndex item index. if this is -1, no item is selected.
*/
void WinListViewAdapter::SetSelectedItem(SInt32 rowIndex)
{
SInt32 selectedIndex = ListView_GetNextItem(hControl, -1, LVIS_SELECTED);
while (0 <= selectedIndex)
{
ListView_SetItemState(hControl, selectedIndex, 0, LVIS_SELECTED);
selectedIndex = ListView_GetNextItem(hControl, selectedIndex + 1, LVIS_SELECTED);
}
ListView_SetItemState(hControl, rowIndex, LVIS_SELECTED, LVIS_SELECTED);
}
开发者ID:HaikuArchives,项目名称:CoveredCalc,代码行数:14,代码来源:WinListViewAdapter.cpp
示例9: ListView_GetNextItem
void FolderWindow::getSelList(Array<String>& sel)
{
for (int cur = ListView_GetNextItem(list->getHandle(), -1, LVNI_SELECTED);
cur >= 0; cur = ListView_GetNextItem(list->getHandle(), cur, LVNI_SELECTED))
{
int pos = list->getItemParam(cur);
if (pos >= 0 && pos < items.length() &&
(items[pos].type == ITEM_FOLDER || items[pos].type == ITEM_REPLAY))
sel.push(items[pos].path);
}
}
开发者ID:tianking,项目名称:dota-replay-manager,代码行数:11,代码来源:folderwnd.cpp
示例10: CheckIfRehashNecessary
/*****************************************************************************
static bool CheckIfRehashNecessary(CONST HWND arrHwnd[ID_NUM_WINDOWS],CONST UINT uiMode)
arrHwnd : (IN) array with window handles
uiMode : (IN) create MD5 or SFV files
Return Value:
returns true if rehash was/is necessary
Notes:
- checks if the necessary hash has been calculated for all selected files
- if hashes are missing the user is asked if he wants a rehash of those lists that
are missing the hashes
*****************************************************************************/
static bool CheckIfRehashNecessary(CONST HWND arrHwnd[ID_NUM_WINDOWS],CONST UINT uiMode)
{
LVITEM lvitem={0};
bool doRehash=false;
bool needRehash=false;
UINT uiIndex;
list<lFILEINFO*> *doneList;
list<lFILEINFO*> rehashList;
lFILEINFO *pList;
if(ListView_GetSelectedCount(arrHwnd[ID_LISTVIEW])==0) {
doneList = SyncQueue.getDoneList();
for(list<lFILEINFO*>::iterator it=doneList->begin();it!=doneList->end();it++) {
if( uiMode != MODE_NORMAL && !(*it)->bCalculated[uiMode] )
rehashList.push_back(*it);
}
SyncQueue.releaseDoneList();
} else {
uiIndex = ListView_GetNextItem(arrHwnd[ID_LISTVIEW],-1,LVNI_SELECTED);
lvitem.mask = LVIF_PARAM;
do {
lvitem.iItem = uiIndex;
ListView_GetItem(arrHwnd[ID_LISTVIEW],&lvitem);
pList = ((FILEINFO *)lvitem.lParam)->parentList;
if( uiMode != MODE_NORMAL && !pList->bCalculated[uiMode] )
rehashList.push_back(pList);
} while((uiIndex = ListView_GetNextItem(arrHwnd[ID_LISTVIEW],uiIndex,LVNI_SELECTED))!=-1);
rehashList.sort();
rehashList.unique();
}
if(!rehashList.empty())
needRehash=true;
if( needRehash ){
TCHAR *hashName = g_hash_names[uiMode];
TCHAR msgString[MAX_PATH_EX];
StringCchPrintf(msgString,MAX_PATH_EX,TEXT("You have to calculate the %s checksums first. Click OK to do that now."),hashName);
if( MessageBox(arrHwnd[ID_MAIN_WND],
msgString,
TEXT("Question"),MB_OKCANCEL | MB_ICONQUESTION | MB_APPLMODAL | MB_SETFOREGROUND) == IDCANCEL)
return true;
doRehash = true;
}
if(doRehash) {
for(list<lFILEINFO*>::iterator it=rehashList.begin();it!=rehashList.end();it++) {
SyncQueue.deleteFromList(*it);
(*it)->bDoCalculate[uiMode] = true;
SyncQueue.pushQueue(*it);
}
PostMessage(arrHwnd[ID_MAIN_WND], WM_START_THREAD_CALC, NULL, NULL);
}
return needRehash;
}
开发者ID:andrew-tpfc,项目名称:RapidCRC-Unicode,代码行数:66,代码来源:actfcts.cpp
示例11: ListView_GetItemPosition
void CShellBrowser::DragStarted(int iFirstItem,POINT *ptCursor)
{
DraggedFile_t df;
int iSelected = -1;
if(iFirstItem != -1)
{
POINT ptOrigin;
POINT ptItem;
ListView_GetItemPosition(m_hListView,iFirstItem,&ptItem);
ListView_GetOrigin(m_hListView,&ptOrigin);
m_ptDraggedOffset.x = ptOrigin.x + ptCursor->x - ptItem.x;
m_ptDraggedOffset.y = ptOrigin.y + ptCursor->y - ptItem.y;
}
while((iSelected = ListView_GetNextItem(m_hListView,iSelected,LVNI_SELECTED)) != -1)
{
QueryDisplayName(iSelected, SIZEOF_ARRAY(df.szFileName), df.szFileName);
m_DraggedFilesList.push_back(df);
}
m_bDragging = TRUE;
}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:27,代码来源:iShellBrowser.cpp
示例12: BeginDrag
void MappingDlg::BeginDrag(int idx)
{
if (ListView_GetNextItem(m_hList, -1, LVNI_SELECTED) == -1)
return;
m_dragflag = true;
SetCapture(m_hDlg);
}
开发者ID:090,项目名称:DS4vJoy,代码行数:7,代码来源:MappingDlg.cpp
示例13: while
void MappingDlg::save()
{
m_active = false;
if (m_change) {
if (MessageBox(m_hDlg,I18N.MBOX_Save, I18N.APP_TITLE, MB_YESNO) != IDYES) {
m_change = false;
}
}
Mappings newmap;
while (ListView_GetNextItem(m_hList, -1, LVNI_ALL) != -1) {
LVITEM item = { 0 };
item.mask = LVIF_PARAM;
if (!ListView_GetItem(m_hList, &item))
break;
if (item.lParam != NULL) {
if (m_change)
newmap.push_back(*(Mapping*)item.lParam);
delete (Mapping*)item.lParam;
}
if (!ListView_DeleteItem(m_hList, 0))
break;
}
ListView_DeleteAllItems(m_hList);
if (m_change) {
g_settings.Mappingdata.swap(newmap);
g_settings.Save();
PostMessage(m_hWnd, WM_CHANGE_SETTING, 0, 0);
}
}
开发者ID:090,项目名称:DS4vJoy,代码行数:30,代码来源:MappingDlg.cpp
示例14: switch
INT_PTR CDialogAbout::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDC_ABOUTSKINS_ITEMS_LISTBOX:
if (HIWORD(wParam) == LBN_SELCHANGE)
{
UpdateMeasureList(NULL);
}
break;
case IDM_COPY:
{
HWND item = GetFocus();
if (item == GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW))
{
int sel = ListView_GetNextItem(item, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (sel != -1)
{
std::wstring tmpSz(512, L'0');
ListView_GetItemText(item, sel, 2, &tmpSz[0], 512);
CSystem::SetClipboardText(tmpSz);
}
}
}
break;
default:
return 1;
}
return 0;
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:33,代码来源:DialogAbout.cpp
示例15: UpdateGroupProperties
static VOID
UpdateGroupProperties(HWND hwndDlg)
{
TCHAR szGroupName[UNLEN];
INT iItem;
HWND hwndLV;
PLOCALGROUP_INFO_1 pGroupInfo = NULL;
hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
iItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
if (iItem == -1)
return;
/* Get the group name */
ListView_GetItemText(hwndLV,
iItem, 0,
szGroupName,
UNLEN);
NetLocalGroupGetInfo(NULL, szGroupName, 1, (LPBYTE*)&pGroupInfo);
ListView_SetItemText(hwndLV, iItem, 1,
pGroupInfo->lgrpi1_comment);
NetApiBufferFree(pGroupInfo);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:26,代码来源:groups.c
示例16: SoftwareDirectories_OnDelete
static BOOL SoftwareDirectories_OnDelete(HWND hDlg)
{
int nCount;
int nSelect;
int nItem;
HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
BOOL res;
g_bModifiedSoftwarePaths = TRUE;
nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED | LVNI_ALL);
if (nItem == -1)
return FALSE;
/* Don't delete "Append" placeholder. */
if (nItem == ListView_GetItemCount(hList) - 1)
return FALSE;
res = ListView_DeleteItem(hList, nItem);
nCount = ListView_GetItemCount(hList);
if (nCount <= 1)
return FALSE;
/* If the last item was removed, select the item above. */
if (nItem == nCount - 1)
nSelect = nCount - 2;
else
nSelect = nItem;
ListView_SetItemState(hList, nSelect, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
MarkChanged(hDlg);
return TRUE;
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:35,代码来源:propertiesms.c
示例17: Directories_OnBrowse
static void Directories_OnBrowse(HWND hDlg)
{
int nType;
int nItem;
TCHAR inbuf[MAX_PATH];
TCHAR outbuf[MAX_PATH];
HWND hList;
hList = GetDlgItem(hDlg, IDC_DIR_LIST);
nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED);
if (nItem == -1)
return;
nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
if (IsMultiDir(nType))
{
/* Last item is placeholder for append */
if (nItem == ListView_GetItemCount(hList) - 1)
{
Directories_OnInsert(hDlg);
return;
}
}
ListView_GetItemText(hList, nItem, 0, inbuf, MAX_PATH);
if (BrowseForDirectory(hDlg, inbuf, outbuf) == TRUE)
{
nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
DirInfo_SetDir(g_pDirInfo, nType, nItem, outbuf);
UpdateDirectoryList(hDlg);
}
}
开发者ID:cdenix,项目名称:psmame,代码行数:34,代码来源:directories.c
示例18: ListView_GetNextItem
int CListView::GetSelectedItem() const
{
if (m_hwnd==nullptr)
return -1;
return ListView_GetNextItem(m_hwnd,-1,LVNI_SELECTED);
}
开发者ID:nexus7ici,项目名称:TSTask,代码行数:7,代码来源:ListView.cpp
示例19: GetValueName
LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
{
int item;
LVITEMW LVItem;
PLINE_INFO lineinfo;
/*
if a new item is inserted, then no allocation,
otherwise the heap block will be lost!
*/
item = ListView_GetNextItem(hwndLV, iStartAt, LVNI_SELECTED);
if (item == -1) return NULL;
/*
Should be always TRUE anyways
*/
LVItem.iItem = item;
LVItem.iSubItem = 0;
LVItem.mask = LVIF_PARAM;
if (ListView_GetItem(hwndLV, &LVItem) == FALSE)
return NULL;
lineinfo = (PLINE_INFO)LVItem.lParam;
if (lineinfo == NULL)
return NULL;
return lineinfo->name;
}
开发者ID:RareHare,项目名称:reactos,代码行数:28,代码来源:listview.c
示例20: FileListViewDelete
/*!
リストビューのアイテムを削除する
@param[in] hWnd 親ウインドウのハンドル
@return 削除後のアイテム数
*/
INT FileListViewDelete( HWND hWnd )
{
HWND hLvWnd = GetDlgItem( hWnd, IDLV_CLIPSTEAL_FILELISTVW );
INT iItem, iCount;
TCHAR atPath[MAX_PATH];
// 選択されてる項目を確保
iItem = ListView_GetNextItem( hLvWnd, -1, LVNI_ALL | LVNI_SELECTED );
// 選択されてるモノがないと無意味
if( 0 <= iItem )
{
// もし選択中のアレなら削除しない
FileListViewGet( hWnd, iItem, atPath );
if( 0 == StrCmp( gatClipFile, atPath ) )
{
MessageBox( hWnd, TEXT("そのファイルは使用中だよ。\r\n削除できないよ。"), TEXT("お燐からのお知らせ"), MB_OK | MB_ICONERROR );
}
else // 問題無いなら削除
{
ListView_DeleteItem( hLvWnd, iItem );
}
}
iCount = ListView_GetItemCount( hLvWnd );
return iCount;
}
开发者ID:16in,项目名称:OrinrinEditor,代码行数:33,代码来源:OrinrinCollector.cpp
注:本文中的ListView_GetNextItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论