本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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();
}
示例9: ComboBox_GetCurSel
char *ModuleConfigControl::GetPszValue()
{
int selected = ComboBox_GetCurSel( combo );
if( selected != -1 )
return (char *)ComboBox_GetItemData( combo, selected );
else return NULL;
}
示例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));
}
示例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;
}
示例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);
}
示例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 );
}
示例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;
}
示例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 );
}