本文整理汇总了C++中ListView_GetNextItem函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_GetNextItem函数的具体用法?C++ ListView_GetNextItem怎么用?C++ ListView_GetNextItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_GetNextItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
}
示例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;
}
}
示例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;
}
}
}
示例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);
}
}
示例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);
}
示例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.");
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例12: BeginDrag
void MappingDlg::BeginDrag(int idx)
{
if (ListView_GetNextItem(m_hList, -1, LVNI_SELECTED) == -1)
return;
m_dragflag = true;
SetCapture(m_hDlg);
}
示例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);
}
}
示例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;
}
示例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);
}