Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
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);
}
Example #4
0
bool plResponderAnimProc::IUserCommand(HWND hWnd, IParamBlock2* pb, int cmd, int resID)
{
    if (cmd == CBN_SELCHANGE && resID == IDC_LOOP_COMBO)
    {
        HWND hCombo = GetDlgItem(hWnd, IDC_LOOP_COMBO);
        int sel = ComboBox_GetCurSel(hCombo);

        // If this is an actual loop (not the entire animation) get its name and save it
        if (sel != CB_ERR)
        {
            if (ComboBox_GetItemData(hCombo, sel) == 1)
            {
                char buf[256];
                ComboBox_GetText(hCombo, buf, sizeof(buf));
                pb->SetValue(kAnimLoop, 0, buf);
            }
            else
                pb->SetValue(kAnimLoop, 0, "");
        }

        return true;
    }

    return false;
}
Example #5
0
// 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();
}
Example #6
0
LRESULT ComboBox_GetSelectedItemData(HWND hWnd)
{
	int selIdx = ComboBox_GetCurSel(hWnd);
	if (selIdx == LB_ERR)
		return LB_ERR;
	return ComboBox_GetItemData(hWnd, selIdx);
}
Example #7
0
// Get selected filter fro GUI (if any) and send its filter index to parent window
void SppTabFltr::UpdateFilter(void)
{
	// Send the ID (in data) of the selected item to the parent window
	HWND hFilterList = GetDlgItem(m_hDlg,  IDC_COMBO_FILTERS);
	int FilterId; 
	int iCurSel = ComboBox_GetCurSel(hFilterList);
	if (iCurSel==CB_ERR)
	{
		SendMessage(m_TopDlgWnd, WMSPP_DLG_FILTER, (WPARAM)-1, 0);
		return;
	}

	FilterId = (int)ComboBox_GetItemData (hFilterList, iCurSel);
	SendMessage(m_TopDlgWnd, WMSPP_DLG_FILTER, (WPARAM)FilterId, 0);

	// Inform Parent
	ComboBox_GetLBText (hFilterList,iCurSel,m_FilterName);


	// Checks the checkbox
	HWND hFilterCB		= GetDlgItem(m_hDlg,  IDC_CH_FILTER);
	EnableWindow(hFilterCB, true);
	Button_SetCheck(hFilterCB, BST_CHECKED);
	ShowChannelArea( m_hDlg, true);
	m_FilterActive = true;
	SentFilterInfo2Parent();
}
Example #8
0
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;
    }
}
Example #9
0
	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;
	}
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();
}
Example #11
0
char *ModuleConfigControl::GetPszValue()
{
    int selected = ComboBox_GetCurSel( combo );
    if( selected != -1 )
        return (char *)ComboBox_GetItemData( combo, selected );
    else return NULL;
}
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));
}
Example #13
0
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;
}
Example #14
0
static void GetDialogInfo (HWND hwnd, LPSTRUCTINFO lpinfo)
{
	char szBuf[100];

	GetDlgItemText (hwnd, IDC_ROWS, szBuf, sizeof (szBuf));
	lpinfo->dwRows = my_atodw(szBuf);

	GetDlgItemText (hwnd, IDC_ROWWIDTH, szBuf, sizeof (szBuf));
	lpinfo->nRowWidth = my_atoi(szBuf);

	GetDlgItemText (hwnd, IDC_UNIQUEKEYS, szBuf, sizeof (szBuf));
	lpinfo->dwUniqueKeys = my_atodw(szBuf);

	GetDlgItemText (hwnd, IDC_KEYWIDTH, szBuf, sizeof (szBuf));
	lpinfo->nKeyWidth = my_atoi(szBuf);

	GetDlgItemText (hwnd, IDC_DATA, szBuf, sizeof (szBuf));
	lpinfo->fillFactors.nData = my_atoi(szBuf);

	GetDlgItemText (hwnd, IDC_INDEX, szBuf, sizeof (szBuf));
	lpinfo->fillFactors.nIndex = my_atoi(szBuf);

	GetDlgItemText (hwnd, IDC_LEAF, szBuf, sizeof (szBuf));
	lpinfo->fillFactors.nLeaf = my_atoi(szBuf);



	if (lpinfo->nIngresVersion != OIVERS_12)   {
		HWND hwndCtl = GetDlgItem (hwnd, IDC_PAGESIZE);
		lpinfo->dwPageSize = ComboBox_GetItemData(hwndCtl, ComboBox_GetCurSel(hwndCtl));
	}
	else
		lpinfo->dwPageSize = 2048;

	if (lpinfo->nIngresVersion >= OIVERS_26)   {
		BOOL bIndex = Button_GetCheck (GetDlgItem (hwnd, IDC_TYPE_INDEX));
		int ipos = 0;
		long lpagesize = lpinfo->dwPageSize;
		while (lpagesize>2048) {
			ipos++;
			lpagesize/=2;
		}
		if (ipos>5) {
			myerror(ERR_INGRESPAGES);
			ipos=0;
		}
		if (bIndex)
			ipos+=6;
		lpinfo->iPageType = pagetypespertabletypes[ipos];
	}
	else if (lpinfo->nIngresVersion >= OIVERS_20)   {
		if (lpinfo->dwPageSize == 2048)
			lpinfo->iPageType = PAGE_TYPE_V1;
		else
			lpinfo->iPageType = PAGE_TYPE_V2;
	}
	else /* before 2.0 */
			lpinfo->iPageType = PAGE_TYPE_V1;

}
Example #15
0
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);
}
Example #16
0
// 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 );
}
Example #17
0
	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;
	}
Example #18
0
//-----------------------------------------------------------------------------
// 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 );
}
Example #19
0
static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
	switch (id)
	{
		case IDOK:
		{
            int index;
            HWND hwndCombo = GetDlgItem (hwnd, IDC_COMBOPAGESIZE);

			LPTABLEPARAMS lptbl = GetDlgProp(hwnd);
         HWND hwndLocations = GetDlgItem(hwnd, IDC_LOCATIONS);
         HWND hwndSecOption = GetDlgItem(hwnd, IDC_SEC_AUDIT_OPTION);
         HWND hwndLabel = GetDlgItem(hwnd, IDC_LABEL_GRAN);
         HWND hwndKey = GetDlgItem(hwnd, IDC_SEC_AUDIT_KEY);
         int nIdx;

         FreeObjectList (lptbl->lpLocations);  // Vut adds
         lptbl->lpLocations = NULL;            // Vut adds
         lptbl->lpLocations = CreateList4CheckedObjects (hwndLocations);
         lptbl->bJournaling = IsDlgButtonChecked(hwnd, IDC_JOURNALING);
         lptbl->bDuplicates = IsDlgButtonChecked(hwnd, IDC_DUPLICATES);
         index = ComboBox_GetCurSel (hwndCombo);
         if (index != -1)
         {
                lptbl->uPage_size = (LONG)ComboBox_GetItemData (hwndCombo, index);
                if (lptbl->uPage_size == 2048L)
                    lptbl->uPage_size = 0L;
         }
         ComboBox_GetText(hwndKey, lptbl->szSecAuditKey, sizeof(lptbl->szSecAuditKey));

			nIdx = ComboBox_GetCurSel(hwndSecOption);
			lptbl->nSecAudit = (int)ComboBox_GetItemData(hwndSecOption, nIdx);

			nIdx = ComboBox_GetCurSel(hwndLabel);
			lptbl->nLabelGran = (int)ComboBox_GetItemData(hwndLabel, nIdx);

			EndDialog(hwnd, 1);
			break;
		}

		case IDCANCEL:
			EndDialog(hwnd, 0);
			break;
	}
}
Example #20
0
void SetGPUKey(HWND hWC,char szKey)
{
 int i,iCnt=ComboBox_GetCount(hWC);
 for(i=0;i<iCnt;i++)
  {
   if(ComboBox_GetItemData(hWC,i)==szKey) break;
  }
 if(i!=iCnt) ComboBox_SetCurSel(hWC,i);
}                                 
Example #21
0
//================================================================================================
//-----------------------//-----------------------------+++--> Delete One of the Configured Timers:
void OnDel(HWND hDlg)   //------------------------------------------------------------------+++-->
{
	HWND timer_cb = GetDlgItem(hDlg, IDC_TIMERNAME);
	char name[TNY_BUFF];
	char subkey[TNY_BUFF];
	size_t offset;
	int idx, idx2, count;
	
	offset=wsprintf(subkey, "%s\\Timer", g_szTimersSubKey);
	ComboBox_GetText(timer_cb, name, sizeof(name));
	count = ComboBox_GetCount(timer_cb) -1;
	for(idx=0; idx<count; ++idx) {
		timeropt_t* pts = (timeropt_t*)ComboBox_GetItemData(timer_cb, idx);
		if(!strcmp(name,pts->name)){
			break;
		}
	}
	if(idx==count) return;
	StopTimer(idx);
	
	for(idx2=idx+1; idx2<count; ++idx2) {
		timeropt_t* pts;
		pts = (timeropt_t*)ComboBox_GetItemData(timer_cb, idx2);
		wsprintf(subkey+offset, "%d", idx2); // we're 1 behind, as needed
		api.SetStr(subkey, "Name",		pts->name);
		api.SetInt(subkey, "Seconds",	pts->second);
		api.SetInt(subkey, "Minutes",	pts->minute);
		api.SetInt(subkey, "Hours",	pts->hour);
		api.SetInt(subkey, "Days",	pts->day);
		api.SetStr(subkey, "File",		pts->fname);
		api.SetInt(subkey, "Repeat",	pts->bRepeat);
		api.SetInt(subkey, "Blink",	pts->bBlink);
		api.SetInt(subkey, "Active",	pts->bActive);
	}
	wsprintf(subkey+offset, "%d", count);
	api.DelKey(subkey);
	api.SetInt(g_szTimersSubKey, "NumberOfTimers", --count);
	free((void*)ComboBox_GetItemData(timer_cb,idx));
	ComboBox_DeleteString(timer_cb,idx);
	
	ComboBox_SetCurSel(timer_cb, (idx>0)?(idx-1):idx);
	OnTimerName(hDlg);
	PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE);
}
Example #22
0
//---------------------------------------------------------------------------
//Workaround for MS bug ComboBox_SelectItemData
int ComboBox_SelectItemData(HWND hwndCtl, int indexStart, LPARAM data) {
	int i = 0;
	for ( i ; i < ComboBox_GetCount(hwndCtl); i++) {
		if(data == ComboBox_GetItemData(hwndCtl, i)) {
			ComboBox_SetCurSel (hwndCtl,i);
			return i;
		}
	}
	return CB_ERR;
}
Example #23
0
void FreeGui(HWND hW)
{
 int i,iCnt;
 HWND hWC=GetDlgItem(hW,IDC_DEVICE);
 iCnt=ComboBox_GetCount(hWC);
 for(i=0;i<iCnt;i++)
  {
   free((GUID *)ComboBox_GetItemData(hWC,i));
  }
}
Example #24
0
void CEpgDataCap_BonDlg::OnCbnSelchangeComboService()
{
	// TODO: ここにコントロール通知ハンドラー コードを追加します。
	int sel = ComboBox_GetCurSel(GetDlgItem(IDC_COMBO_SERVICE));
	if( sel != CB_ERR ){
		DWORD index = (DWORD)ComboBox_GetItemData(GetDlgItem(IDC_COMBO_SERVICE), sel);
		SelectService(this->serviceList[index].originalNetworkID, this->serviceList[index].transportStreamID, this->serviceList[index].serviceID, this->serviceList[index].space, this->serviceList[index].ch );
	}
	ChgIconStatus();
}
Example #25
0
/**
 * This method does a binary search in the sorted
 * ComboBox for the item index. (new core tz interface)
 *
 * @param	pTimeZone		- LPTIME_ZONE_INFORMATION to find.
 *
 * @retval	CB_ERR			- item not found
 * @retval	0...n			- index of the combobox item
 **/
int CTzCombo::Find(LPTIME_ZONE_INFORMATION pTimeZone) const
{
	int nItemIndex;
	int nItemCount = ComboBox_GetCount(_hwnd);

	for (nItemIndex = 0; nItemIndex < nItemCount; nItemIndex++) {
		if (pTimeZone == tmi.getTzi((HANDLE)ComboBox_GetItemData(_hwnd, nItemIndex)))
			return nItemIndex;
	}
	return CB_ERR;
}
Example #26
0
//================================================================================================
//------------------------//------------------------+++--> free memories associated with combo box:
void OnDestroy(HWND hDlg)   //--------------------------------------------------------------+++-->
{
	HWND timer_cb = GetDlgItem(hDlg, IDC_TIMERNAME);
	int idx;
	int count = ComboBox_GetCount(timer_cb);
	StopFile();
	for(idx=0; idx<count; ++idx) {
		free((void*)ComboBox_GetItemData(timer_cb,idx));
	}
	g_hDlgTimer = NULL;
}
Example #27
0
/// <summary>
/// Validate image before injection
/// </summary>
/// <param name="path">Image path</param>
/// <param name="init">Initizliation routine</param>
/// <returns></returns>
DWORD MainDlg::ValidateImage( const wchar_t* path, const char* init )
{
    DWORD status  = ERROR_SUCCESS;
    auto& barrier = _proc.core().native()->GetWow64Barrier();
    DWORD thdId = _newProcess ? 0 : (DWORD)ComboBox_GetItemData( GetDlgItem( _hMainDlg, IDC_THREADS ), 
                                                                 ComboBox_GetCurSel( GetDlgItem( _hMainDlg, IDC_THREADS ) ) );

    bool isManual = (ComboBox_GetCurSel( GetDlgItem( _hMainDlg, IDC_OP_TYPE ) ) == 1);

    return ValidateArch( path, barrier, thdId, isManual );
}
Example #28
0
/**
 * This method fills @szTime with the current time
 * according to the combobox's selected timezone.
 *
 * @param		szTime		- string to fill with the current time
 * @param		cchTime		- number of characters the string can take
 *
 * @return	nothing
 **/
void CTzCombo::GetTime(LPTSTR szTime, WORD cchTime)
{
	//use new core tz interface
	if (tmi.printDateTime) {
		tmi.printDateTime((HANDLE)ComboBox_GetItemData(_hwnd, _curSel), _T("t"), szTime, cchTime, 0);
	}
	//fallback use old UIEX method
	else {
		const CTimeZone *pTimeZone = (CTimeZone*)ComboBox_GetItemData(_hwnd, _curSel);
		if (PtrIsValid(pTimeZone)) {
			MTime now;
			TIME_ZONE_INFORMATION tzi = *pTimeZone;

			now.GetTimeUTC();
			now.UTCToTzSpecificLocal(&tzi);
			now.TimeFormat(szTime, cchTime);
		}
		else mir_tcscpy(szTime, _T("--:--"));
	}
}
Example #29
0
const char *plNoteTrackDlg::IGetSel(HWND hCombo)
{
    int sel = ComboBox_GetCurSel(hCombo);
    if (sel != CB_ERR && ComboBox_GetItemData(hCombo, sel) == kName)
    {
        char buf[256];
        ComboBox_GetText(hCombo, buf, sizeof(buf));
        return (*fSegMap)[plString::FromUtf8(buf)]->fName.c_str();
    }

    return "";
}
Example #30
0
/**
 * This method does a binary search in the sorted
 * ComboBox for the item index. (old UIEX method)
 *
 * @param	pTimeZone		- CTimeZone compobox item data.
 *
 * @retval	CB_ERR			- item not found
 * @retval	0...n			- index of the combobox item
 **/
int CTzCombo::Find(CTimeZone *pTimeZone) const
{
	int nItemIndex;
	int nItemCount = ComboBox_GetCount(_hwnd);

	for (nItemIndex = 0; nItemIndex < nItemCount; nItemIndex++)
	{
		if (pTimeZone == (CTimeZone *)ComboBox_GetItemData(_hwnd, nItemIndex))
			return nItemIndex;
	}
	return CB_ERR;
}