• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ListView_SetCheckState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ListView_DeleteAllItems

void GeneralPage::loadPage()
{
	int index = -1;

	ListView_DeleteAllItems(m_hListOptions);

	// option: auto-start server on startup
	index = WinUtil::ListViewUtil::insertItem(m_hListOptions,0,WinUtil::ResourceUtil::loadString(IDS_SETTINGS_AUTOSTART).c_str(),NULL);
	if ( SettingsManager::getInstance()->getBool(SettingsManager::AUTOSTART)==true ) {
		ListView_SetCheckState(m_hListOptions,index,true);
	}

	// option: automatically check for updates
	index = WinUtil::ListViewUtil::insertItem(m_hListOptions,1,WinUtil::ResourceUtil::loadString(IDS_SETTINGS_CHECKFORUPDATES).c_str(),NULL);
	if ( SettingsManager::getInstance()->getBool(SettingsManager::CHECKFORUPDATES)==true ) {
		ListView_SetCheckState(m_hListOptions,index,true);
	}

	// option: confirm on application exit
	index = WinUtil::ListViewUtil::insertItem(m_hListOptions,2,WinUtil::ResourceUtil::loadString(IDS_SETTINGS_CONFIRMEXIT).c_str(),NULL);
	if ( SettingsManager::getInstance()->getBool(SettingsManager::CONFIRMEXIT)==true ) {
		ListView_SetCheckState(m_hListOptions,index,true);
	}

	// option: minimize to tray
	index = WinUtil::ListViewUtil::insertItem(m_hListOptions,3,WinUtil::ResourceUtil::loadString(IDS_SETTINGS_MINIMIZETOTRAY).c_str(),NULL);
	if ( SettingsManager::getInstance()->getBool(SettingsManager::MINIMIZETOTRAY)==true ) {
		ListView_SetCheckState(m_hListOptions,index,true);
	}
}
开发者ID:CIHANGIRCAN,项目名称:vibestreamer,代码行数:30,代码来源:GeneralPage.cpp


示例2: ListView_GetItem

void Twindow::lvSwapItems(int id,int i1,int i2)
{
    HWND hlv=GetDlgItem(m_hwnd,id);
    LVITEM lvi1;
    char_t text1[256];
    int check1;
    lvi1.mask=LVIF_PARAM|LVIF_STATE|LVIF_TEXT;
    lvi1.iItem=i1;
    lvi1.iSubItem=0;
    lvi1.pszText=text1;
    lvi1.cchTextMax=256;
    ListView_GetItem(hlv,&lvi1);
    check1=ListView_GetCheckState(hlv,i1);
    LVITEM lvi2;
    char_t text2[256];
    int check2;
    lvi2.mask=LVIF_PARAM|LVIF_STATE|LVIF_TEXT;
    lvi2.iItem=i2;
    lvi2.iSubItem=0;
    lvi2.pszText=text2;
    lvi2.cchTextMax=256;
    ListView_GetItem(hlv,&lvi2);
    check2=ListView_GetCheckState(hlv,i2);
    std::swap(lvi1.iItem,lvi2.iItem);
    ListView_SetItem(hlv,&lvi1);
    ListView_SetCheckState(hlv,i1,check2);
    ListView_SetItem(hlv,&lvi2);
    ListView_SetCheckState(hlv,i2,check1);
    lvSetSelItem(id,i2);
    ListView_EnsureVisible(hlv,i2,FALSE);
}
开发者ID:JERUKA9,项目名称:ffdshow-tryouts,代码行数:31,代码来源:Twindow.cpp


示例3: LVItemSetCheckAll

void LVItemSetCheckAll(HWND hWnd,BOOL bFlag) {

	INT iItem,iMax;
	iMax=ListView_GetItemCount(hWnd); if (!iMax) return;
	for (iItem=0;iItem<iMax;iItem++) 
	{
		BOOL bNow=ListView_GetCheckState(hWnd,iItem);
		if (!bFlag&&bNow) ListView_SetCheckState(hWnd,iItem,false);
		if (bFlag&&!bNow) ListView_SetCheckState(hWnd,iItem,true);
	}

}
开发者ID:ferrasrl,项目名称:easyHand,代码行数:12,代码来源:ZCMP_ListView.c


示例4: mm_mod_list_install_mod

void mm_mod_list_install_mod(mm_mod_item *mod_item, int listIndex)
{
    // alright hide the mod file list window thing
    mm_hide_mod_install_files();

    // go through and check for errors
    char errorMessage[MAX_PATH] = { 0 };

    // check the game directory exists
    if (!mm_has_game_directory())
    {
        // throw an error
        MessageBox(mm_mod_list, _TEXT("Unable to install mod.\nPlease make sure that your game directory has been set."), _TEXT("An error occured"), MB_OK | MB_ICONERROR);

        // check the checkbox again
        ListView_SetCheckState(mm_mod_list , listIndex, false);

        return;
    }

    // check the backup directory exists
    if (!mm_has_backup_directory())
    {
        // throw an error
        MessageBox(mm_mod_list, _TEXT("Unable to install mod.\nPlease make sure that your backup directory has been set."), "An error occured", MB_OK | MB_ICONERROR);

        // check the checkbox again
        ListView_SetCheckState(mm_mod_list, listIndex, false);

        return;
    }

    // check that we're not conflicting if we're installing
    mm_installed_mod *conflicting_mod = 0;
    if ((conflicting_mod = mm_is_unique_mod(mod_item)) != NULL)
    {
        // throw an error
        sprintf(errorMessage, "Unable to install %s.\n\nThis mod has files that conflict with:\n%s.\n\nPlease uninstall that mod before installing this one.", mod_item->mod_name, conflicting_mod->file_path);
        MessageBox(mm_mod_list, _TEXT(errorMessage), "Mod conflict", MB_OK | MB_ICONERROR);

        // check the checkbox again
        ListView_SetCheckState(mm_mod_list, listIndex, false);

        return;
    }

    mm_install_mod(mod_item);
}
开发者ID:Forceh91,项目名称:MadnightMM,代码行数:48,代码来源:mm_mod_list.cpp


示例5: SetWindowText

void UserSetupPage::loadPage(User *pUser)
{
	SetWindowText(m_hEditName,pUser->getName().c_str());

	if ( !pUser->getPassword().empty() ) {
		SetWindowText(m_hEditPassword,ENCRYPTED_PASSWORD.c_str());
	}

	Button_SetCheck(m_hCheckDisabled,pUser->isDisabled());

	m_groups = UserManager::getInstance()->getGroups();

	// add all groups to list
	std::list<Group>::iterator iter;
	for ( iter=m_groups.begin(); iter!=m_groups.end(); iter++ )
	{
		// add group to list with group instance as lparam
		int index = WinUtil::ListViewUtil::insertItem(m_hListGroups,-1,
			iter->getName().c_str(),(LPARAM)&(*iter));
		
		// check if user is a member of this group
		if ( pUser->isMemberOf(iter->getGuid()) ) {
			ListView_SetCheckState(m_hListGroups,index,true);
		}
	}
}
开发者ID:CIHANGIRCAN,项目名称:vibestreamer,代码行数:26,代码来源:UserSetupPage.cpp


示例6: ZeroMemory

// Add recourd into List-View
// [in] int : Index
// [in] wchar_t* : Name of record
// [in] wchar_t* : Description
// [in] int : Status
// [out] Nothing
void StkThreadGuiManager::AddRecordToListView(int Index, wchar_t* Na, wchar_t* De)
{
	LVITEM LvItm;
	for (int ColumnLoop = 0; ColumnLoop < 4; ColumnLoop++) {
		ZeroMemory(&LvItm, sizeof(LvItm));
		LvItm.iItem = Index;
		LvItm.iSubItem = ColumnLoop;
		switch (ColumnLoop % 4) {
		case 0:
			LvItm.mask = LVIF_TEXT;
			LvItm.iImage = 0;
			LvItm.pszText = L"";
			ListView_InsertItem(ListWndHndl, &LvItm);
			ListView_SetCheckState(ListWndHndl, Index, true);
			break;
		case 1:
			LvItm.mask = LVIF_TEXT;
			LvItm.pszText = Na;
			ListView_SetItem(ListWndHndl, &LvItm);
			break;
		case 2:
			LvItm.mask = LVIF_TEXT;
			LvItm.pszText = De;
			ListView_SetItem(ListWndHndl, &LvItm);
			break;
		}
		ReplaceStatus(Index);
	}
}
开发者ID:s-takeuchi,项目名称:YaizuComLib,代码行数:35,代码来源:StkThreadGuiManager.cpp


示例7: LoadDictionary

void LoadDictionary(HWND hwnd)
{
	APPDATAXMLLIST list;
	LVITEMW item;

	HRESULT hr = ReadList(pathconfigxml, SectionDictionary, list);

	if(hr == S_OK && list.size() != 0)
	{
		HWND hWndListView = GetDlgItem(hwnd, IDC_LIST_SKK_DIC);
		int i = 0;
		FORWARD_ITERATION_I(l_itr, list)
		{
			if(l_itr->size() == 0 || (*l_itr)[0].first != AttributePath)
			{
				continue;
			}
			item.mask = LVIF_TEXT;
			item.pszText = (LPWSTR)(*l_itr)[0].second.c_str();
			item.iItem = i;
			item.iSubItem = 0;
			ListView_InsertItem(hWndListView, &item);

			BOOL check = TRUE;
			if(l_itr->size() >= 2 && (*l_itr)[1].first == AttributeEnabled)
			{
				check = _wtoi((*l_itr)[1].second.c_str());
			}
			ListView_SetCheckState(hWndListView, i, check);

			i++;
		}
		ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
	}
开发者ID:SGA-Takeshi-Tsukamoto,项目名称:corvusskk,代码行数:34,代码来源:PropertyConfDictionary.cpp


示例8: InitListViewContorol

void InitListViewContorol(HWND hWnd)
{
	HWND hWndLV = GetDlgItem(hWnd, IDC_LIST_MAILBOX);
	LV_COLUMN	lc;
	LV_ITEM		li;
	HIMAGELIST	hImgList;
	RECT		rect;

	GetClientRect(hWndLV, &rect);
	
	// イメージリストの作成
	hImgList = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 1 , 1);
	ImageList_AddIcon(hImgList, LoadIcon(g_hInstance, "IDI_MAILBOX"));

	ListView_SetImageList(hWndLV, hImgList, LVSIL_SMALL);
	ListView_SetExtendedListViewStyle(hWndLV, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);

	// ヘッダを追加 (表示しない)
	lc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
	lc.fmt = LVCFMT_LEFT;

	lc.pszText = "メールボックス";
	lc.cx = rect.right;
	lc.iSubItem = 0;
	lc.cchTextMax = strlen(lc.pszText);
	ListView_InsertColumn(hWndLV, 0, &lc);

	lc.pszText = "フォルダ名";
	lc.cx = 0;
	lc.iSubItem = 1;
	lc.cchTextMax = strlen(lc.pszText);
	ListView_InsertColumn(hWndLV, 1, &lc);
	
	// メールボックスを列挙
	THash MailBoxes;
	EnumMailBox(MailBoxes);

	// メールボックスを追加
	int i = 0;
	for (THash::iterator itr = MailBoxes.begin(); itr != MailBoxes.end(); ++itr) {
		li.mask = LVIF_TEXT | LVIF_IMAGE;
		li.iItem = i;
		li.iImage = 0;
		// 表示名
		li.pszText = (char *)((*itr).second).c_str();
		li.iSubItem = 0;
		ListView_InsertItem(hWndLV, &li);
		// メールボックスのディレクトリ名
		li.pszText = (char *)((*itr).first).c_str();
		li.iSubItem = 1;
		ListView_SetItem(hWndLV, &li);
		
		// 設定されているメールボックスにチェックをつける
		if (g_temporary_mailbox.count((*itr).first) == 1) {
			ListView_SetCheckState(hWndLV, i, 1);
		}

		i++;
	}
}
开发者ID:sunaoka,项目名称:bkwhitelist,代码行数:60,代码来源:SetupDlg.cpp


示例9: PopulateRulesList

void PopulateRulesList(HWND hWndList, int nSelected)
{
	int i;
	LV_ITEM		lvI;
	
	lvI.mask = LVIF_TEXT;
	lvI.iSubItem = 0; 
	lvI.cchTextMax = 255;

	ListView_DeleteAllItems(hWndList);

	for(i = 0; i < 256; i++)
	{
		if (rule_text[i].rule[0] == '\0')  break;
		
		i = ListView_GetItemCount(hWndList);
		lvI.iItem = i;
		lvI.pszText = rule_text[i].rule;
		ListView_InsertItem(hWndList, &lvI);
			
		if (rule_text[i].bEnabled)
			ListView_SetCheckState(hWndList, i, TRUE);

		if (i == nSelected)
			ListView_SetItemState(hWndList, i, LVIS_SELECTED, LVIS_SELECTED);
	}
}
开发者ID:codercold,项目名称:networkspy,代码行数:27,代码来源:rules.c


示例10: ListView_SetCheckState

void CSysLogQuery::CheckAllItems(BOOL fChecked)
{
	for(int nItem = 0;nItem < ListView_GetItemCount(m_Syslog_query);nItem++)
	{
		ListView_SetCheckState(m_Syslog_query,nItem,fChecked);
	}
}
开发者ID:wzp85,项目名称:myprotect,代码行数:7,代码来源:SysLogQuery.cpp


示例11: UpdateList

void UpdateList(HWND hwndList)
{
	LVITEM lvI = { 0 };

	// Some code to create the list-view control.
	// Initialize LVITEM members that are common to all
	// items.
	int i = 0;
	for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
		UpdateListFlag = TRUE;
		lvI.mask = LVIF_TEXT;
		lvI.iSubItem = 0;
		TCHAR *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
		if (ptszNick) {
			lvI.pszText = ptszNick;
			lvI.iItem = i;
			ListView_InsertItem(hwndList, &lvI);
			lvI.iSubItem = 1;

			TCHAR *ptszURL = db_get_tsa(hContact, MODULE, "URL");
			if (ptszURL) {
				lvI.pszText = ptszURL;
				ListView_SetItem(hwndList, &lvI);
				i++;
				ListView_SetCheckState(hwndList, lvI.iItem, db_get_b(hContact, MODULE, "CheckState", 1));
				mir_free(ptszURL);
			}
			mir_free(ptszNick);
		}
	}
	UpdateListFlag = FALSE;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:32,代码来源:Utils.cpp


示例12: Watch

DWORD WINAPI Watch( void *p)
{
	TDATA *pData	= (TDATA*)p;
	DWORD	pid		= pData->pid;	// process의 ID
	//------------------------------
	HANDLE	hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
	if( hProcess == 0 )
	{
		MessageBox(0, "프로세스의 핸들을 얻을 수 없다.", "", MB_OK);
		return 0;
	}
	ListView_SetCheckState(hMainList, pData->idx, TRUE);

	//----- Event 관련 구현 추가 ---------------------------------
	HANDLE	hEvent		= CreateEvent(0, TRUE, 0, "Exit");	//-> Open.(동일한 객체의 핸들)
	HANDLE	h[2]		= { hProcess, hEvent };
	char    temp[50];
	DWORD ret = WaitForMultipleObjects( 2, h, FALSE, INFINITE);	// 부분 시그널

	if( ret		== WAIT_OBJECT_0)	// 프로세스가 시그널
	{
		wsprintf(temp, "[ %s ] 프로세스가 종료하였습니다.", pData->exename);
		SetWindowText(hStaticLog, temp);
		Sleep(1000);
	}

	CloseHandle( hEvent);
	CloseHandle(hProcess);
	delete pData;

	ProcessList();
	return 0;
}
开发者ID:gawallsibya,项目名称:BIT_API-WNP-WSP,代码行数:33,代码来源:fun.cpp


示例13: AddDataBp

void AddDataBp(HWND hwnd)
{
    char *name = (char *)DialogBoxParam(hInstance, "ADDDATABPDIALOG", hwnd, 
        (DLGPROC)DataBpAddProc, 0);
    if (name)
    {
        DATABREAK **search = &dataBpList;
        DATABREAK *b = calloc(1, sizeof(DATABREAK));
        int v;
        HWND hwndLV = GetDlgItem(hwnd, IDC_BPLIST);
        LV_ITEM item;
        int i = ListView_GetItemCount(hwndLV);
        memset(&item, 0, sizeof(item));
        strcpy(b->name, name);
        while (*search)
            search = &(*search)->next;
        b->active = TRUE;
        *search = b;
        item.iItem = 10000;
        item.iSubItem = 0;
        item.mask = LVIF_PARAM;
        item.lParam = (LPARAM)b;
        v = ListView_InsertItem(hwndLV, &item);
        ListView_SetCheckState(hwndLV, v, TRUE);
        ListView_SetSelectionMark(hwndLV, i);
        ListView_SetItemState(hwndLV, i, LVIS_SELECTED, LVIS_SELECTED);
        
    }
}
开发者ID:bencz,项目名称:OrangeC,代码行数:29,代码来源:brkdata.c


示例14: ListView_MoveItem

	int ListView_MoveItem(HWND hwnd , int pos , int newPos) {
		char buff [2000];
		int cols = Header_GetItemCount(ListView_GetHeader(hwnd));
		LVITEM lvi;
		lvi.mask = LVIF_IMAGE|LVIF_INDENT|LVIF_PARAM|LVIF_TEXT|LVIF_STATE;
		lvi.iItem = pos;
		lvi.iSubItem = 0;
		lvi.stateMask= (UINT)-1;
		lvi.pszText = buff;
		lvi.cchTextMax = 2000;
		ListView_GetItem(hwnd , &lvi);
		int check = ListView_GetCheckState(hwnd , pos);

		if (newPos>pos) newPos++; else pos++;
		lvi.iItem = newPos;
		newPos = ListView_InsertItem(hwnd , &lvi);
		ListView_SetCheckState(hwnd , newPos , check);

		lvi.mask = LVIF_TEXT;
		for (int i=1; i<cols; i++) {
			lvi.iSubItem=i;
			lvi.iItem=pos;
			ListView_GetItem(hwnd , &lvi);
			lvi.iItem=newPos;
			ListView_SetItem(hwnd , &lvi);
		}
		//    ListView_SetSelectionMark(hwnd , newPos);
		ListView_EnsureVisible(hwnd , newPos , 0);
		ListView_DeleteItem(hwnd , pos);
		return 1;
	}
开发者ID:Konnekt,项目名称:staminalib,代码行数:31,代码来源:WinHelper.cpp


示例15: ListView_SetCheckState

// draw listview control and sort according to m_sort_type
//
void CDlgNetlist::DrawListCtrl()
{
	int nItem;
	CString str;
	DWORD old_style = m_list_ctrl.GetExtendedStyle();
	m_list_ctrl.SetExtendedStyle( LVS_EX_FULLROWSELECT | LVS_EX_FLATSB | LVS_EX_CHECKBOXES | old_style );
	m_list_ctrl.DeleteAllItems();
	m_list_ctrl.InsertColumn( COL_VIS, "Vis", LVCFMT_LEFT, 25 );
	m_list_ctrl.InsertColumn( COL_NAME, "Name", LVCFMT_LEFT, 140 );
	m_list_ctrl.InsertColumn( COL_PINS, "Pins", LVCFMT_LEFT, 40 );
	m_list_ctrl.InsertColumn( COL_WIDTH, "Width", LVCFMT_LEFT, 40 );
	m_list_ctrl.InsertColumn( COL_VIA_W, "Via W", LVCFMT_LEFT, 40 );   
	m_list_ctrl.InsertColumn( COL_HOLE_W, "Hole", LVCFMT_LEFT, 40 );
	int iItem = 0;
	for( int i=0; i<::nl.GetSize(); i++ )
	{
		if( ::nl[i].deleted == FALSE )
		{
			nItem = m_list_ctrl.InsertItem( iItem, "" );
			m_list_ctrl.SetItemData( iItem, (LPARAM)i );
			m_list_ctrl.SetItem( iItem, COL_NAME, LVIF_TEXT, ::nl[i].name, 0, 0, 0, 0 );
			str.Format( "%d", ::nl[i].ref_des.GetSize() );
			m_list_ctrl.SetItem( iItem, COL_PINS, LVIF_TEXT, str, 0, 0, 0, 0 );
			str.Format( "%d", ::nl[i].w/NM_PER_MIL );
			m_list_ctrl.SetItem( iItem, COL_WIDTH, LVIF_TEXT, str, 0, 0, 0, 0 );
			str.Format( "%d", ::nl[i].v_w/NM_PER_MIL );
			m_list_ctrl.SetItem( iItem, COL_VIA_W, LVIF_TEXT, str, 0, 0, 0, 0 );
			str.Format( "%d", ::nl[i].v_h_w/NM_PER_MIL );
			m_list_ctrl.SetItem( iItem, COL_HOLE_W, LVIF_TEXT, str, 0, 0, 0, 0 );
			ListView_SetCheckState( m_list_ctrl, nItem, ::nl[i].visible );
		}
	}
	m_list_ctrl.SortItems( ::CompareNetlist, m_sort_type );
}
开发者ID:BackupTheBerlios,项目名称:freepcb-svn,代码行数:36,代码来源:DlgNetlist.cpp


示例16: ListView_SetCheckState

BOOL CDlgPluginSetup::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: この位置に初期化の補足処理を追加してください
	DWORD	dwStyle;
	dwStyle = m_listPlugin.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
	dwStyle |= LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT;
	m_listPlugin.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);

	RECT	rect;
	m_listPlugin.GetClientRect(&rect);

	m_listPlugin.InsertColumn(1, L"プラグイン", LVCFMT_LEFT, rect.right-rect.left-16, -1);
	m_listPlugin.DeleteAllItems();					// クリア

	for (int nIndex=0;nIndex<plugins.arPlugins.GetSize();nIndex++) {
		PSTEPlugin pPlugin = (PSTEPlugin)plugins.arPlugins.GetAt(nIndex);
		m_listPlugin.InsertItem(nIndex, pPlugin->sPluginName);
		m_listPlugin.SetItemData(nIndex, (DWORD)pPlugin);
		ListView_SetCheckState(m_listPlugin.GetSafeHwnd(), nIndex, pPlugin->bUse ? TRUE : FALSE);
	}
	
	return TRUE;  // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります
	              // 例外: OCX プロパティ ページの戻り値は FALSE となります
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:26,代码来源:dlgpluginsetup.cpp


示例17: sizeof

HRESULT CLAVVideoFormatsProp::OnActivate()
{
  HRESULT hr = S_OK;
  INITCOMMONCONTROLSEX icc;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = ICC_BAR_CLASSES | ICC_STANDARD_CLASSES | ICC_LISTVIEW_CLASSES;
  if (InitCommonControlsEx(&icc) == FALSE)
  {
    return E_FAIL;
  }
  ASSERT(m_pVideoSettings != NULL);

  // Setup ListView control for format configuration
  HWND hlv = GetDlgItem(m_Dlg, IDC_CODECS);
  ListView_SetExtendedListViewStyle(hlv, LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);

  int nCol = 1;
  LVCOLUMN lvc = {LVCF_WIDTH, 0, 20, 0};
  ListView_InsertColumn(hlv, 0, &lvc);
  ListView_AddCol(hlv, nCol,  85, L"Codec", false);
  ListView_AddCol(hlv, nCol, 400, L"Description", false);

  ListView_DeleteAllItems(hlv);
  ListView_SetItemCount(hlv, Codec_VideoNB);

  // Create entries for the formats
  LVITEM lvi;
  memset(&lvi, 0, sizeof(lvi));
  lvi.mask = LVIF_TEXT|LVIF_PARAM;

  int nItem = 0;
  for (nItem = 0; nItem < Codec_VideoNB; ++nItem) {
    const codec_config_t *config = get_codec_config((LAVVideoCodec)nItem);

    // Create main entry
    lvi.iItem = nItem + 1;
    ListView_InsertItem(hlv, &lvi);

    // Set sub item texts
    ATL::CA2W name(config->name);
    ListView_SetItemText(hlv, nItem, 1, (LPWSTR)name);

    ATL::CA2W desc(config->description);
    ListView_SetItemText(hlv, nItem, 2, (LPWSTR)desc);
  }

  hr = LoadData();
  if (SUCCEEDED(hr)) {
    // Set checked state
    for (nItem = 0; nItem < ListView_GetItemCount(hlv); nItem++) {
      ListView_SetCheckState(hlv, nItem, m_bFormats[nItem]);
    }
  }

  SendDlgItemMessage(m_Dlg, IDC_CODECS_MSWMVDMO, BM_SETCHECK, m_bWMVDMO, 0);
  SendDlgItemMessage(m_Dlg, IDC_DVD_VIDEO, BM_SETCHECK, m_bDVD, 0);

  return hr;
}
开发者ID:JERUKA9,项目名称:LAVFilters,代码行数:59,代码来源:VideoSettingsProp.cpp


示例18: mm_mod_list_cancel_mod_install

void mm_mod_list_cancel_mod_install(mm_mod_item *mod_item, int listIndex)
{
    // alright hide the mod file list window thing
    mm_hide_mod_install_files();

    // update the checkbox state so that it goes back to the mod enabled state
    ListView_SetCheckState(mm_mod_list, listIndex, mod_item->enabled);
}
开发者ID:Forceh91,项目名称:MadnightMM,代码行数:8,代码来源:mm_mod_list.cpp


示例19: AddNetworkAdapterToListView

VOID AddNetworkAdapterToListView(
    _In_ PDV_NETADAPTER_CONTEXT Context,
    _In_ BOOLEAN AdapterPresent,
    _In_ IF_INDEX IfIndex,
    _In_ IF_LUID Luid,
    _In_ PPH_STRING Guid,
    _In_ PPH_STRING Description
    )
{
    DV_NETADAPTER_ID adapterId;
    INT lvItemIndex;
    BOOLEAN found = FALSE;
    PDV_NETADAPTER_ID newId = NULL;

    InitializeNetAdapterId(&adapterId, IfIndex, Luid, Guid);

    for (ULONG i = 0; i < NetworkAdaptersList->Count; i++)
    {
        PDV_NETADAPTER_ENTRY entry = PhReferenceObjectSafe(NetworkAdaptersList->Items[i]);

        if (!entry)
            continue;

        if (EquivalentNetAdapterId(&entry->AdapterId, &adapterId))
        {
            newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
            CopyNetAdapterId(newId, &entry->AdapterId);

            if (entry->UserReference)
                found = TRUE;
        }

        PhDereferenceObjectDeferDelete(entry);

        if (newId)
            break;
    }

    if (!newId)
    {
        newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
        CopyNetAdapterId(newId, &adapterId);
        PhMoveReference(&newId->InterfaceGuid, Guid);
    }

    lvItemIndex = PhAddListViewGroupItem(
        Context->ListViewHandle,
        AdapterPresent ? 0 : 1,
        MAXINT,
        Description->Buffer,
        newId
        );

    if (found)
        ListView_SetCheckState(Context->ListViewHandle, lvItemIndex, TRUE);

    DeleteNetAdapterId(&adapterId);
}
开发者ID:PKRoma,项目名称:ProcessHacker,代码行数:58,代码来源:netoptions.c


示例20: PopulateExToolsView

static void PopulateExToolsView(HWND hwnd, int sel, BOOL first)
{
    TOOL *curTools = tools;
    int items = 0;
    int i;
    LV_ITEM item;
    RECT r;
    HWND hwndLV = GetDlgItem(hwnd, IDC_EXTOOLCUSTOM);
    
    if (first)
    {
        LV_COLUMN lvC;
        ListView_SetExtendedListViewStyle(hwndLV, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
    
        GetWindowRect(hwndLV, &r);
        lvC.mask = LVCF_WIDTH | LVCF_SUBITEM ;
        lvC.cx = 20;
        lvC.iSubItem = 0;
        ListView_InsertColumn(hwndLV, 0, &lvC);
        lvC.mask = LVCF_WIDTH | LVCF_SUBITEM;
        lvC.cx = 32;
        lvC.iSubItem = 1;
        ListView_InsertColumn(hwndLV, 1, &lvC);
        lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
        lvC.fmt = LVCFMT_LEFT;
        lvC.cx = r.right - r.left - 56;
        lvC.iSubItem = 2;
        ListView_InsertColumn(hwndLV, 2, &lvC);
    }
    else
    {
        ListView_DeleteAllItems(hwndLV);
    }
    
    start = TRUE;
    for (i=0; curTools; curTools = curTools->next, i++)
    {
        if (!curTools->removing)
        {
            int v;
            item.iItem = items++;
            item.iSubItem = 0;
            item.mask = LVIF_PARAM ;
            item.lParam = (LPARAM)i;
            item.pszText = ""; // LPSTR_TEXTCALLBACK ;
            v = ListView_InsertItem(hwndLV, &item);
            ListView_SetCheckState(hwndLV, v, curTools->enabled ? 1 : 0);
        }
    }
    start = FALSE;
    if (items)
    {
        ListView_SetSelectionMark(hwndLV, sel);
        ListView_SetItemState(hwndLV, sel, LVIS_SELECTED, LVIS_SELECTED);
    }

}
开发者ID:jossk,项目名称:OrangeC,代码行数:57,代码来源:extools.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ListView_SetExtendedListViewStyle函数代码示例发布时间:2022-05-30
下一篇:
C++ ListView_InsertItem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap