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


C++ ComboBox_GetItemData函数代码示例

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


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

示例1: ConfigPageProc

static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_COMMAND:
        switch (LOWORD(wParam))
        {
        case IDCFULLSCREEN:
            settings.fullscreen = !settings.fullscreen;
            PopulateForm();
            return TRUE;
        case IDC2DVMODE:
            if (HIWORD(wParam) == CBN_SELCHANGE)
            {
                int32_t i;
                i = ComboBox_GetCurSel((HWND)lParam);
                if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
                if (i != CB_ERR)
                {
                    settings.xdim2d = validmode[i].xdim;
                    settings.ydim2d = validmode[i].ydim;
                }
            }
            return TRUE;
        case IDC3DVMODE:
            if (HIWORD(wParam) == CBN_SELCHANGE)
            {
                int32_t i;
                i = ComboBox_GetCurSel((HWND)lParam);
                if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
                if (i != CB_ERR)
                {
                    settings.xdim3d = validmode[i].xdim;
                    settings.ydim3d = validmode[i].ydim;
                    settings.bpp3d  = validmode[i].bpp;
                }
            }
            return TRUE;
        case IDCALWAYSSHOW:
            settings.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
            return TRUE;
        default:
            break;
        }
        break;
    default:
        break;
    }
    return FALSE;
}
开发者ID:Daedolon,项目名称:erampage,代码行数:50,代码来源:startwin.editor.c

示例2: ConfigPageProc

static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) {
		case WM_COMMAND:
			switch (LOWORD(wParam)) {
				case IDCFULLSCREEN:
					settings.fullscreen = !settings.fullscreen;
					PopulateForm(1<<TAB_CONFIG);
					return TRUE;
				case IDCVMODE:
					if (HIWORD(wParam) == CBN_SELCHANGE) {
						int i;
						i = ComboBox_GetCurSel((HWND)lParam);
						if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
						if (i != CB_ERR) {
							settings.xdim = validmode[i].xdim;
							settings.ydim = validmode[i].ydim;
							settings.bpp  = validmode[i].bpp;
						}
					}
					return TRUE;
				case IDCSOUNDQUAL:
				    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        int i;
                        i = ComboBox_GetCurSel((HWND)lParam);
                        if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
                        if (i != CB_ERR) {
                            settings.samplerate = soundQualities[i].frequency;
                            settings.bitspersample = soundQualities[i].samplesize;
                            settings.channels = soundQualities[i].channels;
                        }
				    }
				    return TRUE;
				case IDCALWAYSSHOW:
					settings.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
					return TRUE;
				case IDCINPUTMOUSE:
					settings.usemouse = IsDlgButtonChecked(hwndDlg, IDCINPUTMOUSE) == BST_CHECKED;
					return TRUE;
				case IDCINPUTJOY:
					settings.usejoy = IsDlgButtonChecked(hwndDlg, IDCINPUTJOY) == BST_CHECKED;
					return TRUE;
				default: break;
			}
			break;
		default: break;
	}
	return FALSE;
}
开发者ID:TheCycoONE,项目名称:jfsw,代码行数:49,代码来源:startwin.game.c

示例3: OnOk

void OnOk(HWND hW) {
	int i = ComboBox_GetCurSel(GetDlgItem(hW, IDC_ETHDEV));
	if (i == -1)
	{
		//adapter not selected
		if (Button_GetCheck(GetDlgItem(hW, IDC_ETHENABLED)))
		{
			//Trying to use an ethernet without
			//selected adapter, we can't have that
			SysMessage("Please select an ethernet adapter");
			return;
		}
		else 
		{
			//user not planning on using
			//ethernet anyway
			strcpy(config.Eth, ETH_DEF);
		}
	}
	else 
	{
		//adapter is selected
		char* ptr = (char*)ComboBox_GetItemData(GetDlgItem(hW, IDC_ETHDEV), i);
		strcpy(config.Eth, ptr);
	}
	
	Edit_GetText(GetDlgItem(hW, IDC_HDDFILE), config.Hdd, 256);

	config.ethEnable = Button_GetCheck(GetDlgItem(hW, IDC_ETHENABLED));
	config.hddEnable = Button_GetCheck(GetDlgItem(hW, IDC_HDDENABLED));

	SaveConf();

	EndDialog(hW, TRUE);
}
开发者ID:Aced14,项目名称:pcsx2,代码行数:35,代码来源:Win32.cpp

示例4: GetDlgItem

// Set the selected filter to be displayed in the filter Combo Box
void SppTabFltr::SelFilter(int FilterId)
{
	// Get the index of the filter (By ID)
	int i=0, data;
	HWND hCombo = GetDlgItem(m_hDlg,  IDC_COMBO_FILTERS);
	HWND hFilterCB		= GetDlgItem(m_hDlg,  IDC_CH_FILTER);
	while ((data = (int)ComboBox_GetItemData(hCombo, i)) != CB_ERR)
	{
		if (data == FilterId)
		{
			// Select
			int res = ComboBox_SetCurSel(hCombo, i);

			// Checks the checkbox
			EnableWindow(hFilterCB, true);
			Button_SetCheck(hFilterCB, BST_CHECKED);
			ShowChannelArea( m_hDlg, true);
			
			// Inform Parent
			ComboBox_GetLBText (hCombo,i,m_FilterName);
			m_FilterActive = true;
			break;
		};
		i++;
	};

	SentFilterInfo2Parent();
}
开发者ID:shauleiz,项目名称:SmartPropoPlus,代码行数:29,代码来源:SppTabFltr.cpp

示例5: ComboBox_GetSelectedItemData

LRESULT ComboBox_GetSelectedItemData(HWND hWnd)
{
	int selIdx = ComboBox_GetCurSel(hWnd);
	if (selIdx == LB_ERR)
		return LB_ERR;
	return ComboBox_GetItemData(hWnd, selIdx);
}
开发者ID:beru,项目名称:pngquant_gui,代码行数:7,代码来源:winutil.cpp

示例6: Cleanup8021xControls

void Cleanup8021xControls(HWND hDlg, WLAN_CFG_PROPS *pWCP)
{
    PWZC_EAP_CB_ITEMDATA pEapCbItemData;
    HWND                 hwndCbEAPType = GetDlgItem(hDlg, IDC_WZC_COMBO_EAP_TYPE);
    int                  i, cnTypes;
    
    cnTypes = ComboBox_GetCount(hwndCbEAPType);
    for ( i = 0; i < cnTypes; i++) 
    {
        pEapCbItemData = (WZC_EAP_CB_ITEMDATA *)ComboBox_GetItemData(hwndCbEAPType, i);
        if (pEapCbItemData && ((int)pEapCbItemData != CB_ERR))
        {
            if (pEapCbItemData->pbAuthData) 
            {
                LocalFree(pEapCbItemData->pbAuthData);
            }
            LocalFree(pEapCbItemData);
        }
    }
    
    if (pWCP->pEapExtInfo) 
    {
        LocalFree(pWCP->pEapExtInfo);
        pWCP->pEapExtInfo = NULL;
    }
}
开发者ID:NemProjects,项目名称:WLAN,代码行数:26,代码来源:wzcprops.c

示例7: atoi

	LRESULT CComWnd::on_device_change( WPARAM event, DEV_BROADCAST_HDR* pDBH )
	{
		if(event==DBT_DEVICEARRIVAL || event==DBT_DEVICEREMOVECOMPLETE){
			if (pDBH->dbch_devicetype == DBT_DEVTYP_PORT){
				DEV_BROADCAST_PORT* pPort = reinterpret_cast<DEV_BROADCAST_PORT*>(pDBH);
				const char* name = &pPort->dbcp_name[0];
				if (_strnicmp("COM", name, 3) == 0){
					int comid = atoi(name + 3);
					if (event == DBT_DEVICEARRIVAL){
						update_status("串口设备 %s 已插入!", name);
						if (!_comm.is_opened()){
							com_update_comport_list_and_select_current();
						}
					}
					else{
						update_status("串口设备 %s 已移除!", name);
						// 保持当前选中的设备依然为选中状态
						if (!_comm.is_opened()){
							com_update_comport_list_and_select_current();
						}
						else{ // 如果移除的是当前COM
							int index = ComboBox_GetCurSel(_hCP);
							c_comport* cp = index >= 0 ? (c_comport*)ComboBox_GetItemData(_hCP, index) : nullptr;
							int comidcur = (int)cp > 0xFFFF ? cp->get_i() : 0;
							if (comid == comidcur){
								com_openclose();
							}
						}
					}

				}
			}
		}
		return 0;
	}
开发者ID:faver2014,项目名称:common,代码行数:35,代码来源:msg.cpp

示例8: Button_SetCheck

void GroupGeneralPage::loadPage(Group *pGroup)
{
	Button_SetCheck(m_hCheckAdmin,pGroup->isAdmin());
	Button_SetCheck(m_hCheckBrowser,pGroup->isBrowser());
	Button_SetCheck(m_hCheckBypassLimits,pGroup->isBypassLimits());

	Button_SetCheck(m_hCheckMaxSessions,pGroup->isMaxSessionsEnabled());
	SetWindowText(m_hEditMaxSessions,
		Util::ConvertUtil::toString(pGroup->getMaxSessions()).c_str());

	Button_SetCheck(m_hCheckMaxSessionsPerIp,pGroup->isMaxSessionsPerIpEnabled());
	SetWindowText(m_hEditMaxSessionsPerIp,
		Util::ConvertUtil::toString(pGroup->getMaxSessionsPerIp()).c_str());

	Button_SetCheck(m_hCheckMaxDownload,pGroup->isMaxDownloadEnabled());
	SetWindowText(m_hEditMaxDownload,
		Util::ConvertUtil::toString(pGroup->getMaxDownloadBytes()/1024/1024).c_str());

	ComboBox_SetCurSel(m_hComboMaxDownloadPeriod,0);
	int maxDownloadPeriodCount = ComboBox_GetCount(m_hComboMaxDownloadPeriod);
	for ( int i=0; i<maxDownloadPeriodCount; i++ ) {
		if ( ComboBox_GetItemData(m_hComboMaxDownloadPeriod,i)==pGroup->getMaxDownloadPeriod() ) {
			ComboBox_SetCurSel(m_hComboMaxDownloadPeriod,i);
			break;
		}
	}

	Button_SetCheck(m_hCheckMaxBandwidth,pGroup->isMaxBandwidthEnabled());
	SetWindowText(m_hEditMaxBandwidth,
		Util::ConvertUtil::toString(pGroup->getMaxBandwidth()).c_str());

	updateDialog();
}
开发者ID:CIHANGIRCAN,项目名称:vibestreamer,代码行数:33,代码来源:GroupGeneralPage.cpp

示例9: ComboBox_GetCurSel

char *ModuleConfigControl::GetPszValue()
{
    int selected = ComboBox_GetCurSel( combo );
    if( selected != -1 )
        return (char *)ComboBox_GetItemData( combo, selected );
    else return NULL;
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:7,代码来源:preferences_widgets.cpp

示例10: memset

void GroupGeneralPage::savePage(Group *pGroup)
{
	char sz[255];

	pGroup->setAdmin(Button_GetCheck(m_hCheckAdmin));
	pGroup->setBrowser(Button_GetCheck(m_hCheckBrowser));
	pGroup->setBypassLimits(Button_GetCheck(m_hCheckBypassLimits));

	pGroup->setMaxSessionsEnabled(Button_GetCheck(m_hCheckMaxSessions));
	memset(sz,0,sizeof(sz));
	GetWindowText(m_hEditMaxSessions,sz,sizeof(sz));
	pGroup->setMaxSessions(Util::ConvertUtil::toInt(sz));

	pGroup->setMaxSessionsPerIpEnabled(Button_GetCheck(m_hCheckMaxSessionsPerIp));
	memset(sz,0,sizeof(sz));
	GetWindowText(m_hEditMaxSessionsPerIp,sz,sizeof(sz));
	pGroup->setMaxSessionsPerIp(Util::ConvertUtil::toInt(sz));

	pGroup->setMaxDownloadEnabled(Button_GetCheck(m_hCheckMaxDownload));

	memset(sz,0,sizeof(sz));
	GetWindowText(m_hEditMaxDownload,sz,sizeof(sz));
	uint64_t maxDownloadBytes = Util::ConvertUtil::toUnsignedInt64(sz)*1024*1024;
	pGroup->setMaxDownloadBytes(maxDownloadBytes);

	int index = ComboBox_GetCurSel(m_hComboMaxDownloadPeriod);
	if ( index>-1 ) {
		pGroup->setMaxDownloadPeriod(ComboBox_GetItemData(m_hComboMaxDownloadPeriod,index));
	}

	pGroup->setMaxBandwidthEnabled(Button_GetCheck(m_hCheckMaxBandwidth));
	memset(sz,0,sizeof(sz));
	GetWindowText(m_hEditMaxBandwidth,sz,sizeof(sz));
	pGroup->setMaxBandwidth(Util::ConvertUtil::toInt(sz));
}
开发者ID:CIHANGIRCAN,项目名称:vibestreamer,代码行数:35,代码来源:GroupGeneralPage.cpp

示例11: GetDlgItemTextW

INT_PTR MainDlg::OnClose( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    ConfigMgr::ConfigData cfg;
    wchar_t imagePath[MAX_PATH];
    wchar_t initRoutine[MAX_PATH];
    wchar_t initArgs[MAX_PATH];
    wchar_t procCmdLine[MAX_PATH];

    cfg.newProcess = _newProcess;
    cfg.procName = _procPath;

    GetDlgItemTextW( _hMainDlg, IDC_IMAGE_PATH,  imagePath, ARRAYSIZE( imagePath ) );
    GetDlgItemTextW( _hMainDlg, IDC_CMDLINE,     procCmdLine, ARRAYSIZE( procCmdLine ) );
    GetDlgItemTextW( _hMainDlg, IDC_ARGUMENT,    initArgs, ARRAYSIZE( initArgs ) );
    GetDlgItemTextW( _hMainDlg, IDC_INIT_EXPORT, initRoutine, ARRAYSIZE( initRoutine ) );

    HWND hCombo = GetDlgItem( _hMainDlg, IDC_THREADS );
    DWORD thdId = (DWORD)ComboBox_GetItemData( hCombo, ComboBox_GetCurSel( hCombo ) );

    cfg.imagePath   = imagePath;
    cfg.procCmdLine = procCmdLine;
    cfg.initRoutine = initRoutine;
    cfg.initArgs    = initArgs;
    cfg.imagePath   = imagePath;

    cfg.manualMap = (ComboBox_GetCurSel( GetDlgItem( hDlg, IDC_OP_TYPE ) ) == 1);
    cfg.threadHijack = (thdId != 0 && thdId != 0xFFFFFFFF);
    cfg.manualMapFlags = MmapFlags();
    cfg.unlink = Button_GetCheck( GetDlgItem( _hMainDlg, IDC_UNLINK ) ) == 0 ? false : true;

    _config.Save( cfg );

    EndDialog( hDlg, 0 );
    return (INT_PTR)TRUE;
}
开发者ID:hezzrrah,项目名称:Xenos,代码行数:35,代码来源:Dlg_Funcs.cpp

示例12: GetDlgItem

char *GetSelBIOS(HWND hW,int id) {
	HWND hWC = GetDlgItem(hW,id);
	int iSel;
	iSel = ComboBox_GetCurSel(hWC);
	if (iSel<0) return NULL;
	return (char *)ComboBox_GetItemData(hWC, iSel);
}
开发者ID:Nitrofski,项目名称:psxjin,代码行数:7,代码来源:ConfigurePlugins.cpp

示例13: GetDlgItem

// Returns the data for the selected entry in the combo box.
void *DeviceEnumeration::ComboBoxSelected( HWND dialog, int id )
{
	HWND control = GetDlgItem( dialog, id );
	int index = ComboBox_GetCurSel( control );
	if( index < 0 )
		return NULL;
	return (void*)ComboBox_GetItemData( control, index );
}
开发者ID:zonedoutspace,项目名称:evamp,代码行数:9,代码来源:DeviceEnumeration.cpp

示例14: ComboBox_FindItemByData

	int ComboBox_FindItemByData(HWND wnd, t_size id)
	{
		t_size i, count = ComboBox_GetCount(wnd);
		for (i = 0; i < count; i++)
			if (ComboBox_GetItemData(wnd, i) == id)
				return i;
		return -1;
	}
开发者ID:wyrover,项目名称:ui_helpers,代码行数:8,代码来源:win32_helpers.cpp

示例15: GetDlgItem

//-----------------------------------------------------------------------------
// Name: ComboBoxSelected
// Desc: Returns the data for the selected entry in the combo box.
//-----------------------------------------------------------------------------
void* CD3DSettingsDialog::ComboBoxSelected( int id )
{
    HWND hwndCtrl = GetDlgItem( m_hDlg, id );
    int index = ComboBox_GetCurSel( hwndCtrl );
    if( index < 0 )
        return NULL;
    return (void*)ComboBox_GetItemData( hwndCtrl, index );
}
开发者ID:xahgo,项目名称:tama,代码行数:12,代码来源:d3dsettings.cpp


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