当前位置: 首页>>代码示例>>C++>>正文


C++ ListView_GetSelectionMark函数代码示例

本文整理汇总了C++中ListView_GetSelectionMark函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_GetSelectionMark函数的具体用法?C++ ListView_GetSelectionMark怎么用?C++ ListView_GetSelectionMark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ListView_GetSelectionMark函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BreakpointListProc

static LRESULT CALLBACK BreakpointListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_KEYDOWN:
		if(wParam == VK_RETURN)
		{
			int index = ListView_GetSelectionMark(hDlg);
			SendMessage(GetParent(hDlg),WM_DEB_GOTOBREAKPOINT,index,0);
			return 0;
		} else if (wParam == VK_DELETE)
		{
			int index = ListView_GetSelectionMark(hDlg);
			SendMessage(GetParent(hDlg),WM_DEB_REMOVEBREAKPOINT,index,0);
			return 0;
		} else if (wParam == VK_TAB)
		{
			SendMessage(GetParent(hDlg),WM_DEB_TABPRESSED,0,0);
			return 0;
		}
		break;
	case WM_GETDLGCODE:
		if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN)
		{
			if (wParam == VK_TAB) return DLGC_WANTMESSAGE;
		}
		break;
	};

	return (LRESULT)CallWindowProc((WNDPROC)DefBreakpointListProc,hDlg,message,wParam,lParam);;
}
开发者ID:173210,项目名称:ppsspp,代码行数:31,代码来源:Debugger_Disasm.cpp

示例2: GetWindowLongPtr

LRESULT CALLBACK CtrlBreakpointList::wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	CtrlBreakpointList* bp = (CtrlBreakpointList*) GetWindowLongPtr(hwnd,GWLP_USERDATA);

	switch(message)
	{
	case WM_SIZE:
		{
			int width = LOWORD(lParam);
			RECT rect;
			GetWindowRect(hwnd,&rect);

			int totalListSize = (rect.right-rect.left-20);
			for (int i = 0; i < BPL_COLUMNCOUNT; i++)
			{
				ListView_SetColumnWidth(hwnd,i,breakpointColumns[i].size * totalListSize);
			}
		}
		break;
	case WM_KEYDOWN:
		if(wParam == VK_RETURN)
		{
			int index = ListView_GetSelectionMark(hwnd);
			bp->editBreakpoint(index);
			return 0;
		} else if (wParam == VK_DELETE)
		{
			int index = ListView_GetSelectionMark(hwnd);
			bp->removeBreakpoint(index);
			return 0;
		} else if (wParam == VK_TAB)
		{
			SendMessage(GetParent(hwnd),WM_DEB_TABPRESSED,0,0);
			return 0;
		} else if (wParam == VK_SPACE)
		{
			int index = ListView_GetSelectionMark(hwnd);
			bp->toggleEnabled(index);
		}
		break;
	case WM_GETDLGCODE:
		if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN)
		{
			if (wParam == VK_TAB || wParam == VK_RETURN) return DLGC_WANTMESSAGE;
		}
		break;
	};
	
	return (LRESULT)CallWindowProc((WNDPROC)bp->oldProc,hwnd,message,wParam,lParam);
}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:50,代码来源:Debugger_Lists.cpp

示例3: GetDlgItem

void COutputDialog::OnNMClickListFilter(NMHDR *pNMHDR, LRESULT *pResult)
{
	//LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<NMITEMACTIVATE>(pNMHDR);

	CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
	int nSelected = ListView_GetSelectionMark(pList->m_hWnd);

	BOOL bFilterSelected = FALSE;
	if (nSelected >= 0)
	{
		bFilterSelected = TRUE;
	}

	CWnd* pBtnFilterSetting	= GetDlgItem(IDC_BTN_FILTER_SETTING);
	CWnd* pBtnFilterDelete	= GetDlgItem(IDC_BTN_FILTER_DELETE);
	CWnd* pBtnFilterUp		= GetDlgItem(IDC_BTN_FILTER_UP);
	CWnd* pBtnFilterDown	= GetDlgItem(IDC_BTN_FILTER_DOWN);

	if(pBtnFilterSetting && ::IsWindow(pBtnFilterSetting->m_hWnd))
		pBtnFilterSetting->EnableWindow(bFilterSelected);
	if(pBtnFilterDelete && ::IsWindow(pBtnFilterDelete->m_hWnd))
		pBtnFilterDelete->EnableWindow(bFilterSelected);
	if(pBtnFilterUp && ::IsWindow(pBtnFilterUp->m_hWnd))
		pBtnFilterUp->EnableWindow(bFilterSelected);
	if(pBtnFilterDown && ::IsWindow(pBtnFilterDown->m_hWnd))
		pBtnFilterDown->EnableWindow(bFilterSelected);

	if(pResult) *pResult = 0;
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:29,代码来源:OutputDialog.cpp

示例4: DlgMsgProc

LRESULT CALLBACK DlgMsgProc(
	HWND hWnd,
	UINT Msg,
	WPARAM wParam,
	LPARAM lParam )
{
	HWND parentHWnd = (HWND)GetWindowLong(hWnd,GWL_HWNDPARENT); 
	wchar_t buff[2048]; wmemset(buff,'\0',2048);
	wchar_t* pos=NULL;
	switch (Msg)
	{
	case WM_DESTROY:
		EndDialog(hWnd,0);
		break;
	case WM_INITDIALOG:		
		wcscpy_s (buff,2048,mLogWnd[parentHWnd].vList[ListView_GetSelectionMark(mLogWnd[parentHWnd].hListView)].c_str());
		while ((pos=wcsstr(buff,L":|:"))!=NULL)
		{wcscpy_s(buff,2048,pos+3);}
		SetDlgItemText(hWnd,IDC_EDIT1,buff);
		break;
	case WM_COMMAND:
		if (wParam == IDOK)
		{EndDialog(hWnd,0);}
		break;
	case WM_SYSCOMMAND:
		if (wParam ==SC_CLOSE)
		{
			EndDialog(hWnd,0);
		}
	default:
		return (0);
	}
	return (0);
}
开发者ID:Joelone,项目名称:MLEA,代码行数:34,代码来源:_main.cpp

示例5: ListView_GetSelectionMark

bool GUI_manager::remove_IMG() {
	char	buffer[MAX_PATH+1];
	char	internal_name[20];
	int		item = ListView_GetSelectionMark(IMG_list);
	int		count = ListView_GetItemCount(IMG_list);
	bool	removed = false;
	
	if( item > -1 ) {
		ListView_GetItemText(IMG_list,item,2,buffer,MAX_PATH);
		ListView_GetItemText(IMG_list,item,3,internal_name,sizeof internal_name);
		if( strlen(buffer) && strlen(internal_name) ) {
			if( uploader->remove_img_file(buffer,internal_name) && !removed ) 
				removed = true;
		}
		if( ListView_DeleteItem(IMG_list,item) ) {
			removed = true;
			if( (item+1) >= count )
				item--;
		}
		SetSelection(IMG_list,item);
		show_size();
	}
	uploader->remove_all();
	return removed;
}
开发者ID:casaretto,项目名称:cgpsmapper,代码行数:25,代码来源:gui_sendmap.cpp

示例6: RankProfView_OnDoubleClick

static LRESULT RankProfView_OnDoubleClick(HWND hwndParent, HWND hwnd)
{
	int index = ListView_GetSelectionMark(hwnd);
	if (index >= 0) {
		TCHAR trfltP2Name[MAX_PATH + 1];
		LVITEM item;
		item.mask = LVIF_TEXT;
		item.iItem = index;
		item.iSubItem = 0;
		item.cchTextMax = _countof(trfltP2Name);
		item.pszText = trfltP2Name;
		ListView_GetItem(hwnd, &item);
		
		TCHAR countStr[32];
		item.mask = LVIF_TEXT;
		item.iItem = index;
		item.iSubItem = 1;
		item.cchTextMax = _countof(countStr);
		item.pszText = countStr;
		ListView_GetItem(hwnd, &item);


		SCORELINE_FILTER_DESC *pFilterDesc = 
			reinterpret_cast<SCORELINE_FILTER_DESC *>(::GetWindowLongPtr(hwndParent, GWL_USERDATA));
		SCORELINE_FILTER_DESC filterDesc = *pFilterDesc;
		filterDesc.mask |= SCORELINE_FILTER__P2NAME | SCORELINE_FILTER__LIMIT;
		::lstrcpynA(filterDesc.p2name, MinimalT2A(trfltP2Name), _countof(filterDesc.p2name) - 1);
		filterDesc.p1name[_countof(filterDesc.p1name) - 1] = 0;
		filterDesc.limit = ::StrToInt(countStr);

		TrackRecordDialog_ShowModeless(::GetParent(hwndParent), &filterDesc);
	}
	return FALSE;
}
开发者ID:hxdnshx,项目名称:SolfiskMod,代码行数:34,代码来源:RankProfDlg.cpp

示例7: RemoveDataBp

void RemoveDataBp(HWND hwnd)
{
    HWND hwndLV = GetDlgItem(hwnd, IDC_BPLIST);
    int k = ListView_GetSelectionMark(hwndLV);
    int n = ListView_GetItemCount(hwndLV);
    int i,j;
    for (i=n-1; i >=0; i--)
    {
        DATABREAK **search = &dataBpList, *found;
        LVITEM item;
        memset(&item, 0, sizeof(item));
        item.iItem = i;
        item.iSubItem = 0;
        item.mask = LVIF_STATE;
        item.stateMask = LVIS_SELECTED;	
        ListView_GetItem(hwndLV, &item);
        if (item.state & LVIS_SELECTED)
        {
            for (j=0; j <i; j++)
                search = &(*search)->next;
            found = *search;
            *search = found->next;
            free(found);
            ListView_DeleteItem(hwndLV, i);
        }
        ListView_SetSelectionMark(hwndLV, i);
        ListView_SetItemState(hwndLV, i, LVIS_SELECTED, LVIS_SELECTED);
    }
}
开发者ID:bencz,项目名称:OrangeC,代码行数:29,代码来源:brkdata.c

示例8: lv_get_selection_pos

/* Returns a selected item or -1 if no selection.
   Assumes that the list is single-sel */
int lv_get_selection_pos(HWND hwnd)
{
    int selection;
    int selected_count = ListView_GetSelectedCount(hwnd);
    assert(selected_count <= 1);
    if (0 == selected_count)
        return -1;
    selection = ListView_GetSelectionMark(hwnd);
    return selection;
}
开发者ID:wzhsunn,项目名称:SumatraPDF_0.6_Source,代码行数:12,代码来源:win_util.c

示例9: ListView_GetSelectionMark

void ListSort::sort()
{
	int idx = ListView_GetSelectionMark(_hwnd);
	LPARAM param = ListView_GetItemData(_hwnd, idx);

	ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);

	if (idx >= 0) {
		idx = ListView_FindItemPara(_hwnd, param);
		ListView_EnsureVisible(_hwnd, idx, FALSE);
	}
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:12,代码来源:window.cpp

示例10: dbg_print

void  CBuddyManager::OnBuddySelected()
{
	BUDDY_INFO *pBI = NULL;
	BUDDY_INFO BI;
	dbg_print("OnBuddySelected");

	int i = ListView_GetSelectionMark(g_hwndListBuddy);	
	g_bRunningQuery = true;	
	if(i!=-1)
	{
		SetCursor(LoadCursor(NULL, IDC_APPSTARTING));

		LVITEM lvItem;
		memset(&lvItem,0,sizeof(LVITEM));	
		lvItem.mask =  LVIF_PARAM ; 
		lvItem.iItem = i;
		lvItem.iSubItem = 0;		
		if(ListView_GetItem( g_hwndListBuddy, &lvItem))
		{
			ListView_DeleteAllItems(g_hwndListViewVars);
			ListView_DeleteAllItems(g_hwndListViewPlayers);

			vecBI::iterator vecBI_it = find(BuddyList.begin(),BuddyList.end(),(DWORD)lvItem.lParam);
			if( vecBI_it != BuddyList.end())
			{
				BI = (BUDDY_INFO)*vecBI_it;			
			
				if(BI.sIndex!=-1)
				{
					try
					{

						if(BI.sIndex<gm.GamesInfo[BI.cGAMEINDEX].vSI.size())
						{
							SERVER_INFO *pSI = gm.GamesInfo[BI.cGAMEINDEX].vSI.at((int)BI.sIndex);
							gm.GetServerInfo(BI.cGAMEINDEX,pSI);
						}
		
					}
					catch(const exception& e)
					{						
						m_log.AddLogInfo(0,"Access Violation!!! %s (OnBuddySelected)\n",e.what());
					}
					UpdateCurrentServerUI();
				}

				
			}//if pSrv
		}
	}	

	g_bRunningQuery = false;
}
开发者ID:elitak,项目名称:gamescanner,代码行数:53,代码来源:BuddyManager.cpp

示例11: RemoveSoundFromList

BOOL RemoveSoundFromList(HWND hList)
{
    int iSel = ListView_GetSelectionMark(hList);
    if (iSel != -1)
    {
        iSel = -1;
        while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
            ListView_SetItemText(hList, iSel, 1, TranslateT(DEFAULT_SOUND));
        return TRUE;
    }

    return FALSE;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:13,代码来源:indsnd.cpp

示例12: do_regjump

int do_regjump(HWND hlistview)
{
	int index;
	index=ListView_GetSelectionMark(hlistview);
	if(index>=0){
		char str[512]={0};
		int str_size=sizeof(str);
		ListView_GetItemText(hlistview,index,1,str,str_size);
		if(str[0]!=0){
			char cmd[1024]={0};
			_snprintf(cmd,sizeof(cmd),"%s%s","HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\",str);
			ShellExecute(hlistview,"open","regjump.exe",cmd,NULL,SW_SHOWNORMAL);
		}
	}
}
开发者ID:pinchyCZN,项目名称:Uninstaller,代码行数:15,代码来源:UNinstaller.c

示例13: SelectMenu

void SelectMenu(int selectedItem = -1)
{
	if (selectedItem == -1)
	{
		selectedItem = ListView_GetSelectionMark(hMenuView.GetHwnd());
		if (selectedItem == -1)
			return;
	}

	switch (selectedItem)
	{
	case 0:
		ShowWindow(hWndTabConfig, SW_SHOW);
		ShowWindow(hWndTabPlugins, SW_HIDE);
		ShowWindow(hWndTabThemes, SW_HIDE);
		ShowWindow(hWndTabLanguages, SW_HIDE);
		ShowWindow(hWndTabKeyboards, SW_HIDE);
		break;
	case 1:
		ShowWindow(hWndTabConfig, SW_HIDE);
		ShowWindow(hWndTabPlugins, SW_SHOW);
		ShowWindow(hWndTabThemes, SW_HIDE);
		ShowWindow(hWndTabLanguages, SW_HIDE);
		ShowWindow(hWndTabKeyboards, SW_HIDE);
		break;
	case 2:
		ShowWindow(hWndTabConfig, SW_HIDE);
		ShowWindow(hWndTabPlugins, SW_HIDE);
		ShowWindow(hWndTabThemes, SW_SHOW);
		ShowWindow(hWndTabLanguages, SW_HIDE);
		ShowWindow(hWndTabKeyboards, SW_HIDE);
		break;
	case 3:
		ShowWindow(hWndTabConfig, SW_HIDE);
		ShowWindow(hWndTabPlugins, SW_HIDE);
		ShowWindow(hWndTabThemes, SW_HIDE);
		ShowWindow(hWndTabLanguages, SW_SHOW);
		ShowWindow(hWndTabKeyboards, SW_HIDE);
		break;
	case 4:
		ShowWindow(hWndTabConfig, SW_HIDE);
		ShowWindow(hWndTabPlugins, SW_HIDE);
		ShowWindow(hWndTabThemes, SW_HIDE);
		ShowWindow(hWndTabLanguages, SW_HIDE);
		ShowWindow(hWndTabKeyboards, SW_SHOW);
		break;
	}
}
开发者ID:grimtraveller,项目名称:sally-project,代码行数:48,代码来源:main.cpp

示例14: _ext_disk_num

int _ext_disk_num(
		HWND hwnd
	)
{
	wchar_t vol[MAX_PATH];
	wchar_t *num_offset;
	
	_get_item_text(
		hwnd, ListView_GetSelectionMark(hwnd), 0, vol, sizeof_w(vol)
		);

	num_offset = wcschr(vol, ' ');

	return (
		num_offset ? _wtoi(num_offset) : -1
	);
}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:17,代码来源:subs.c

示例15: ListView_GetSelectionMark

//returns anything between 0 - 0xFFFFFFFF-1
//0xFFFFFFFF = unsuccessfull
DWORD CBuddyManager::GetBuddyIDBySelection()
{
	int n = ListView_GetSelectionMark(g_hwndListBuddy);
	if(n != -1)
	{
		LVITEM lvItem;
		memset(&lvItem,0,sizeof(LVITEM));
		lvItem.mask =  LVIF_PARAM ;
		lvItem.iItem = n;
		lvItem.iSubItem = 0;
		if(ListView_GetItem( g_hwndListBuddy, &lvItem))
		{
			return (DWORD)lvItem.lParam;
			
		}
	}
	return 0xFFFFFFFF;
}
开发者ID:elitak,项目名称:gamescanner,代码行数:20,代码来源:BuddyManager.cpp


注:本文中的ListView_GetSelectionMark函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。