本文整理汇总了C++中ComboBox_SetItemData函数的典型用法代码示例。如果您正苦于以下问题:C++ ComboBox_SetItemData函数的具体用法?C++ ComboBox_SetItemData怎么用?C++ ComboBox_SetItemData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ComboBox_SetItemData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComboBox_ResetContent
void plNoteTrackDlg::ILoadAnims()
{
if(fAnimID < 0 || !fhAnim)
return;
ComboBox_ResetContent(fhAnim);
// Add the default option
int def = ComboBox_AddString(fhAnim, ENTIRE_ANIMATION_NAME);
ComboBox_SetItemData(fhAnim, def, kDefault);
ComboBox_SetCurSel(fhAnim, def);
if (!fSegMap)
return;
const char *savedAnim = fPB->GetStr(fAnimID);
if (!savedAnim)
savedAnim = "";
// Add the names of the animations
for (SegmentMap::iterator it = fSegMap->begin(); it != fSegMap->end(); it++)
{
SegmentSpec *spec = it->second;
if (spec->fType == SegmentSpec::kAnim)
{
int idx = ComboBox_AddString(fhAnim, spec->fName.c_str());
ComboBox_SetItemData(fhAnim, idx, kName);
// If this is the saved animation name, select it
if (!spec->fName.Compare(savedAnim))
ComboBox_SetCurSel(fhAnim, idx);
}
}
}
示例2: OnInitDialog
void OnInitDialog(HWND hW) {
char *dev;
//int i;
LoadConf();
ComboBox_AddString(GetDlgItem(hW, IDC_BAYTYPE), "Expansion");
ComboBox_AddString(GetDlgItem(hW, IDC_BAYTYPE), "PC Card");
for (int j=0;j<2;j++)
{
for (int i=0; i<pcap_io_get_dev_num(); i++) {
dev = pcap_io_get_dev_desc(i,j);
int itm=ComboBox_AddString(GetDlgItem(hW, IDC_ETHDEV), dev);
ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV),itm,strdup(pcap_io_get_dev_name(i,j)));
if (strcmp(pcap_io_get_dev_name(i,j), config.Eth) == 0) {
ComboBox_SetCurSel(GetDlgItem(hW, IDC_ETHDEV), itm);
}
}
}
vector<tap_adapter> * al=GetTapAdapters();
for (size_t i=0; i<al->size(); i++) {
int itm=ComboBox_AddString(GetDlgItem(hW, IDC_ETHDEV), al[0][i].name.c_str());
ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV),itm,strdup( al[0][i].guid.c_str()));
if (strcmp(al[0][i].guid.c_str(), config.Eth) == 0) {
ComboBox_SetCurSel(GetDlgItem(hW, IDC_ETHDEV), itm);
}
}
Edit_SetText(GetDlgItem(hW, IDC_HDDFILE), config.Hdd);
Button_SetCheck(GetDlgItem(hW, IDC_ETHENABLED), config.ethEnable);
Button_SetCheck(GetDlgItem(hW, IDC_HDDENABLED), config.hddEnable);
}
示例3: GetDlgItem
/// <summary>
/// Retrieve process threads
/// </summary>
/// <returns>Error code</returns>
DWORD MainDlg::FillThreads()
{
HWND hCombo = GetDlgItem( _hMainDlg, IDC_THREADS );
int idx = 0;
ComboBox_ResetContent( hCombo );
auto tMain = _proc.threads().getMain();
if (!tMain)
return ERROR_NOT_FOUND;
// Fake 'New thread'
idx = ComboBox_AddString( hCombo, L"New thread" );
ComboBox_SetItemData( hCombo, idx, 0 );
ComboBox_SetCurSel( hCombo, idx );
for (auto& thd : _proc.threads().getAll( true ))
{
wchar_t text[255] = { 0 };
if (thd == *tMain)
swprintf_s( text, L"Thread %d (Main)", thd.id() );
else
swprintf_s( text, L"Thread %d", thd.id() );
idx = ComboBox_AddString( hCombo, text );
ComboBox_SetItemData( hCombo, idx, thd.id() );
}
return 0;
}
示例4: ShowWindow
void SymbolMap::FillSymbolComboBox(HWND listbox,SymbolType symmask)
{
ShowWindow(listbox,SW_HIDE);
ComboBox_ResetContent(listbox);
//int style = GetWindowLong(listbox,GWL_STYLE);
ComboBox_AddString(listbox,"(0x02000000)");
ComboBox_SetItemData(listbox,0,0x02000000);
//ListBox_AddString(listbox,"(0x80002000)");
//ListBox_SetItemData(listbox,1,0x80002000);
SendMessage(listbox, WM_SETREDRAW, FALSE, 0);
SendMessage(listbox, CB_INITSTORAGE, (WPARAM)entries.size(), (LPARAM)entries.size() * 30);
for (size_t i = 0; i < entries.size(); i++)
{
if (entries[i].type & symmask)
{
char temp[256];
sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
int index = ComboBox_AddString(listbox,temp);
ComboBox_SetItemData(listbox,index,entries[i].vaddress);
}
}
SendMessage(listbox, WM_SETREDRAW, TRUE, 0);
RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
ShowWindow(listbox,SW_SHOW);
}
示例5: ShowWindow
void SymbolMap::FillSymbolComboBox(HWND listbox,SymbolType symmask)
{
ShowWindow(listbox,SW_HIDE);
ComboBox_ResetContent(listbox);
//int style = GetWindowLong(listbox,GWL_STYLE);
ComboBox_AddString(listbox,"(0x02000000)");
ComboBox_SetItemData(listbox,0,0x02000000);
//ListBox_AddString(listbox,"(0x80002000)");
//ListBox_SetItemData(listbox,1,0x80002000);
for (size_t i = 0; i < entries.size(); i++)
{
if (entries[i].type & symmask)
{
char temp[256];
sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
int index = ComboBox_AddString(listbox,temp);
ComboBox_SetItemData(listbox,index,entries[i].vaddress);
}
}
ShowWindow(listbox,SW_SHOW);
}
示例6: CT_LABEL
void CDialogInstall::TabContents::Create(HWND owner)
{
Tab::CreateTabWindow(10, 50, 380, 135, owner);
static const ControlTemplate::Control s_Controls[] =
{
CT_LABEL(-1, 6,
0, 3, 107, 9,
WS_VISIBLE, 0),
CT_COMBOBOX(Id_LanguageComboBox, 0,
107, 0, 222, 14,
WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL, 0),
CT_LABEL(-1, 17,
0, 21, 107, 9,
WS_VISIBLE, 0),
CT_COMBOBOX(Id_InstallationTypeComboBox, 0,
107, 18, 222, 14,
WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL, 0),
CT_LABEL(-1, 7,
0, 43, 107, 9,
WS_VISIBLE, 0),
CT_EDIT(Id_DestinationEdit, 14,
107, 40, 192, 14,
WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY, WS_EX_CLIENTEDGE),
CT_BUTTON(Id_DestinationBrowseButton, 9,
303, 40, 25, 14,
WS_VISIBLE | WS_TABSTOP, 0),
CT_CHECKBOX(Id_LaunchOnLoginCheckBox, 10,
0, 69, 250, 9,
WS_VISIBLE | WS_TABSTOP, 0),
};
CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
HWND item = GetControl(Id_LanguageComboBox);
ComboBox_AddString(item, L"English - English (United States)");
ComboBox_SetCurSel(item, 0);
item = GetControl(Id_InstallationTypeComboBox);
ComboBox_AddString(item, L"Standard 64-bit installation (reccomended)");
ComboBox_SetItemData(item, 0, MAKELPARAM(InstallType::Standard, InstallArch::X64));
ComboBox_AddString(item, L"Standard 32-bit installation");
ComboBox_SetItemData(item, 1, MAKELPARAM(InstallType::Standard, InstallArch::X32));
ComboBox_AddString(item, L"Portable 64-bit installation");
ComboBox_SetItemData(item, 2, MAKELPARAM(InstallType::Portable, InstallArch::X64));
ComboBox_AddString(item, L"Portable 32-bit installation");
ComboBox_SetItemData(item, 3, MAKELPARAM(InstallType::Portable, InstallArch::X32));
ComboBox_SetCurSel(item, 0);
}
示例7: PopulateForm
static void PopulateForm(void)
{
int32_t i,j;
char buf[64];
int32_t mode2d, mode3d;
HWND hwnd2d, hwnd3d;
hwnd2d = GetDlgItem(pages[TAB_CONFIG], IDC2DVMODE);
hwnd3d = GetDlgItem(pages[TAB_CONFIG], IDC3DVMODE);
mode2d = checkvideomode(&settings.xdim2d, &settings.ydim2d, 8, settings.fullscreen, 1);
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
if (mode2d < 0) mode2d = 0;
if (mode3d < 0)
{
int32_t cd[] = { 32, 24, 16, 15, 8, 0 };
for (i=0; cd[i];) {
if (cd[i] >= settings.bpp3d) i++;
else break;
}
for (; cd[i]; i++)
{
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
if (mode3d < 0) continue;
settings.bpp3d = cd[i];
break;
}
}
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), (settings.fullscreen ? BST_CHECKED : BST_UNCHECKED));
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
(void)ComboBox_ResetContent(hwnd2d);
(void)ComboBox_ResetContent(hwnd3d);
for (i=0; i<validmodecnt; i++)
{
if (validmode[i].fs != settings.fullscreen) continue;
// all modes get added to the 3D mode list
Bsprintf(buf, "%d x %d %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
j = ComboBox_AddString(hwnd3d, buf);
(void)ComboBox_SetItemData(hwnd3d, j, i);
if (i == mode3d)(void)ComboBox_SetCurSel(hwnd3d, j);
// only 8-bit modes get used for 2D
if (validmode[i].bpp != 8 || validmode[i].xdim < 640 || validmode[i].ydim < 480) continue;
Bsprintf(buf, "%d x %d", validmode[i].xdim, validmode[i].ydim);
j = ComboBox_AddString(hwnd2d, buf);
(void)ComboBox_SetItemData(hwnd2d, j, i);
if (i == mode2d)(void)ComboBox_SetCurSel(hwnd2d, j);
}
}
示例8: ConfigControl
/*****************************************************************************
* ModuleConfigControl implementation
*****************************************************************************/
ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
module_config_t *p_item,
HWND parent, HINSTANCE hInst,
int * py_pos )
: ConfigControl( p_this, p_item, parent, hInst )
{
module_t **p_list;
module_t *p_parser;
label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
WS_CHILD | WS_VISIBLE | SS_LEFT,
5, *py_pos, 200, 15,
parent, NULL, hInst, NULL );
*py_pos += 15 + 10;
combo = CreateWindow( _T("COMBOBOX"), _T(""),
WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL |
CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL,
20, *py_pos, 180, 5*15 + 6,
parent, NULL, hInst, NULL);
*py_pos += 15 + 10;
/* build a list of available modules */
p_list = module_list_get( NULL );
ComboBox_AddString( combo, _T("Default") );
ComboBox_SetItemData( combo, 0, (void *)NULL );
ComboBox_SetCurSel( combo, 0 );
//ComboBox_SetText( combo, _T("Default") );
for( size_t i_index = 0; p_list[i_index]; i_index++ )
{
p_parser = p_list[i_index];
if( module_provides( p_parser, p_item->psz_type ) )
{
ComboBox_AddString( combo, _FROMMB(module_GetLongName( p_parser ) ));
ComboBox_SetItemData( combo, i_index,
(void *) module_get_object( p_parser ) );
if( p_item->value.psz && !strcmp( p_item->value.psz,
module_get_object( p_parser )) )
{
ComboBox_SetCurSel( combo, i_index );
//ComboBox_SetText( combo, _FROMMB( module_GetLongName(p_parser)) );
}
}
}
module_list_free( p_list );
}
示例9: OnInit
//================================================================================================
//------------------------//----------------------------------+++--> Initialize the "Timer" Dialog:
void OnInit(HWND hDlg) //-----------------------------------------------------------------+++-->
{
HWND timer_cb = GetDlgItem(hDlg, IDC_TIMERNAME);
HWND file_cb = GetDlgItem(hDlg, IDC_TIMERFILE);
char subkey[TNY_BUFF];
size_t offset;
int idx, count;
timeropt_t* pts;
SendMessage(hDlg, WM_SETICON, ICON_SMALL,(LPARAM)g_hIconTClock);
SendMessage(hDlg, WM_SETICON, ICON_BIG,(LPARAM)g_hIconTClock);
// init dialog items
SendDlgItemMessage(hDlg, IDC_TIMERSECSPIN, UDM_SETRANGE32, 0,59); // 60 Seconds Max
SendDlgItemMessage(hDlg, IDC_TIMERMINSPIN, UDM_SETRANGE32, 0,59); // 60 Minutes Max
SendDlgItemMessage(hDlg, IDC_TIMERHORSPIN, UDM_SETRANGE32, 0,23); // 24 Hours Max
SendDlgItemMessage(hDlg, IDC_TIMERDAYSPIN, UDM_SETRANGE32, 0,7); // 7 Days Max
/// add default sound files to file dropdown
ComboBoxArray_AddSoundFiles(&file_cb, 1);
// add timer to combobox
offset=wsprintf(subkey,"%s\\Timer",g_szTimersSubKey);
count=api.GetInt(g_szTimersSubKey, "NumberOfTimers", 0);
for(idx=0; idx<count; ++idx) {
pts = (timeropt_t*)malloc(sizeof(timeropt_t));
wsprintf(subkey+offset,"%d",idx+1);
pts->second = api.GetInt(subkey, "Seconds", 0);
pts->minute = api.GetInt(subkey, "Minutes", 10);
pts->hour = api.GetInt(subkey, "Hours", 0);
pts->day = api.GetInt(subkey, "Days", 0);
api.GetStr(subkey, "Name", pts->name, sizeof(pts->name), "");
api.GetStr(subkey, "File", pts->fname, sizeof(pts->fname), "");
pts->bBlink = (char)api.GetInt(subkey, "Blink", FALSE);
pts->bRepeat = (char)api.GetInt(subkey, "Repeat", FALSE);
pts->bActive = (char)api.GetInt(subkey, "Active", FALSE);
ComboBox_AddString(timer_cb, pts->name);
ComboBox_SetItemData(timer_cb, idx, pts);
}
// add "new timer" item
pts = (timeropt_t*)calloc(1, sizeof(timeropt_t));
memcpy(pts->name, "<Add New...>", 13);
ComboBox_AddString(timer_cb, pts->name);
ComboBox_SetItemData(timer_cb, count, pts);
ComboBox_SetCurSel(timer_cb, 0);
OnTimerName(hDlg);
SendDlgItemMessage(hDlg, IDC_TIMERTEST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconPlay);
SendDlgItemMessage(hDlg, IDC_TIMERDEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconDel);
api.PositionWindow(hDlg,21);
}
示例10: GetDlgItem
/**
* This functions fills a combobox given by @hCtrl with
* all items of the global timezone manager
*
* @param hDlg - HWND of the owning propertysheet page
* @param idCtrl - the ID of the control to associate with this class's instance
* @param pszSetting - the database setting to be handled by this class
*
* @return CTzCombo*
**/
CBaseCtrl* CTzCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting)
{
CTzCombo *ctrl = NULL;
HWND hCtrl = GetDlgItem(hDlg, idCtrl);
ctrl = new CTzCombo(hDlg, idCtrl, pszSetting);
if (ctrl) {
//use new core tz interface
if (tmi.prepareList) {
//set the adress of our timezone handle as itemdata
//caller can obtain the handle htz to extract all relevant information
ctrl->_curSel = 0;
tmi.prepareList(NULL, hCtrl, TZF_PLF_CB);
}
//fallback use old UIEX method
else {
ctrl->_curSel = ComboBox_AddString(hCtrl, TranslateT("<Unspecified>"));
if (SUCCEEDED(ctrl->_curSel)) {
ComboBox_SetItemData(hCtrl, ctrl->_curSel, NULL);
}
ComboBox_SetCurSel(hCtrl, ctrl->_curSel);
EnumTimeZones(EnumNamesProc, (LPARAM)hCtrl);
}
}
return (ctrl);
}
示例11: sizeof
/// <summary>
/// Enumerate processes
/// </summary>
/// <returns>Error code</returns>
DWORD MainDlg::FillProcessList()
{
PROCESSENTRY32W pe32 = { 0 };
pe32.dwSize = sizeof(pe32);
HWND hCombo = GetDlgItem( _hMainDlg, IDC_COMBO_PROC );
ComboBox_ResetContent( hCombo );
HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if (hSnap == NULL)
return GetLastError();
for (BOOL res = Process32FirstW( hSnap, &pe32 ); res; res = Process32NextW( hSnap, &pe32 ))
{
wchar_t text[255] = { 0 };
swprintf_s( text, L"%ls (%d)", pe32.szExeFile, pe32.th32ProcessID );
int idx = ComboBox_AddString( hCombo, text );
ComboBox_SetItemData( hCombo, idx, pe32.th32ProcessID );
}
CloseHandle( hSnap );
return 0;
}
示例12: ComboBox_ResetContent
void CComWnd::com_update_item_list()
{
list_callback_ud ud;
ud.that = this;
struct {
list_callback_ud::e_type type;
i_com_list* plist;
HWND hwnd;
} ups[] = {
{list_callback_ud::e_type::cp, _comm.comports()->update_list() , _hCP},
{list_callback_ud::e_type::br, _comm.baudrates()->update_list() , _hBR},
{list_callback_ud::e_type::pa, _comm.parities()->update_list() , _hPA},
{list_callback_ud::e_type::sb, _comm.stopbits()->update_list() , _hSB},
{list_callback_ud::e_type::db, _comm.databits()->update_list() , _hDB},
};
for(int i=0; i<sizeof(ups)/sizeof(*ups); i++){
ud.type = ups[i].type;
ud.hwnd = ups[i].hwnd;
ComboBox_ResetContent(ud.hwnd);
ups[i].plist->callback(&CComWnd::com_udpate_list_callback, &ud);
if (ComboBox_GetCount(ud.hwnd) > 0){
ComboBox_SetCurSel(ud.hwnd, 0);
}
}
int ii = ComboBox_InsertString(_hBR, -1, "<输入>");
ComboBox_SetItemData(_hBR, ii, 1); // 1 - 自定义
}
示例13: DirectDrawEnumCallbackEx
static BOOL WINAPI DirectDrawEnumCallbackEx( GUID FAR* pGUID, LPSTR strDesc,
LPSTR strName, VOID* pV,
HMONITOR hMonitor )
{
// Use the GUID to create the DirectDraw object, so that information
// can be extracted from it.
LPDIRECTDRAW pDD;
LPDIRECTDRAW4 g_pDD;
LPDIRECT3D3 pD3D;
HRESULT (WINAPI *pDDrawCreateFn)(GUID *,LPDIRECTDRAW *,IUnknown *);
pDDrawCreateFn = (LPVOID)GetProcAddress( hDDrawDLL, "DirectDrawCreate" );
if( pDDrawCreateFn == NULL || FAILED( pDDrawCreateFn( pGUID, &pDD, 0L ) ) )
{
return D3DENUMRET_OK;
}
// Query the DirectDraw driver for access to Direct3D.
if( FAILED(IDirectDraw_QueryInterface(pDD, &IID_IDirectDraw4, (VOID**)&g_pDD)))
{
IDirectDraw_Release(pDD);
return D3DENUMRET_OK;
}
IDirectDraw_Release(pDD);
// Query the DirectDraw driver for access to Direct3D.
if( FAILED( IDirectDraw4_QueryInterface(g_pDD,&IID_IDirect3D3, (VOID**)&pD3D)))
{
IDirectDraw4_Release(g_pDD);
return D3DENUMRET_OK;
}
bDeviceOK=FALSE;
// Now, enumerate all the 3D devices
IDirect3D3_EnumDevices(pD3D,Enum3DDevicesCallback,NULL);
if(bDeviceOK)
{
HWND hWC=GetDlgItem(gHWND,IDC_DEVICE);
int i=ComboBox_AddString(hWC,strDesc);
GUID * g=(GUID *)malloc(sizeof(GUID));
if(NULL != pGUID) *g=*pGUID;
else memset(g,0,sizeof(GUID));
ComboBox_SetItemData(hWC,i,g);
}
IDirect3D3_Release(pD3D);
IDirectDraw4_Release(g_pDD);
return DDENUMRET_OK;
}
示例14: swprintf_s
void CFixApp::PopulateDialog()
{
//Populate the GUI scale combobox
for (size_t i = 1; i < 6; i++)
{
wchar_t szBuf[3];
swprintf_s(szBuf, L"x%Iu", i);
ComboBox_AddString(m_hWndCBGUIScales, szBuf);
}
ComboBox_SetCurSel(m_hWndCBGUIScales, 0);
//Populate the resolution combobox
DEVMODE dm = {};
dm.dmSize = sizeof(dm);
Resolution r= {};
for(DWORD iModeNum = 0; EnumDisplaySettings(NULL, iModeNum, &dm) != FALSE; iModeNum++)
{
if((dm.dmPelsWidth != r.iX || dm.dmPelsHeight != r.iY) && dm.dmBitsPerPel == 32) //Only add each res once, but don't actually check if it matches the current color depth/refresh rate
{
r.iX = dm.dmPelsWidth;
r.iY = dm.dmPelsHeight;
m_Resolutions.push_back(r);
wchar_t szBuffer[20];
_snwprintf_s(szBuffer, _TRUNCATE, L"%Iux%Iu", r.iX, r.iY);
int iIndex = ComboBox_AddString(m_hWndCBResolutions, szBuffer);
ComboBox_SetItemData(m_hWndCBResolutions, iIndex, &(m_Resolutions.back()));
}
}
ComboBox_SetCurSel(m_hWndCBResolutions, 0);
//Renderers (based on UnEngineWin.h), requires appInit() to have been called
TArray<FRegistryObjectInfo> Classes;
Classes.Empty();
UObject::GetRegistryObjects( Classes, UClass::StaticClass(), URenderDevice::StaticClass(), 0 );
for( TArray<FRegistryObjectInfo>::TIterator It(Classes); It; ++It )
{
FString Path = It->Object, Left, Right;
if( Path.Split(L".",&Left,&Right) )
{
const wchar_t* pszDesc = Localize(*Right,L"ClassCaption",*Left);
assert(pszDesc);
if(ComboBox_FindStringExact(m_hWndCBRenderers, -1, pszDesc) == CB_ERR)
{
ComboBox_AddString(m_hWndCBRenderers, pszDesc);
m_Renderers.emplace_back(static_cast<wchar_t*>(Path.GetCharArray().GetData()));
}
}
}
}
示例15: GetDlgItem
/*
** Called when tab is displayed.
**
*/
void CDialogManage::CTabSettings::Initialize()
{
m_Initialized = true;
// Scan for languages
HWND item = GetDlgItem(m_Window, IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX);
std::wstring files = Rainmeter->GetPath() + L"Languages\\*.dll";
WIN32_FIND_DATA fd;
HANDLE hSearch = FindFirstFile(files.c_str(), &fd);
if (hSearch != INVALID_HANDLE_VALUE)
{
do
{
WCHAR* pos = wcschr(fd.cFileName, L'.');
if (pos)
{
LCID lcid = (LCID)wcstoul(fd.cFileName, &pos, 10);
if (pos != fd.cFileName &&
_wcsicmp(pos, L".dll") == 0 &&
GetLocaleInfo(lcid, LOCALE_SENGLISHLANGUAGENAME, fd.cFileName, MAX_PATH) > 0)
{
// Strip brackets in language name
std::wstring text = fd.cFileName;
text += L" - ";
GetLocaleInfo(lcid, LOCALE_SNATIVELANGUAGENAME, fd.cFileName, MAX_PATH);
text += fd.cFileName;
int index = ComboBox_AddString(item, text.c_str());
ComboBox_SetItemData(item, index, (LPARAM)lcid);
if (lcid == Rainmeter->GetResourceLCID())
{
ComboBox_SetCurSel(item, index);
}
}
}
}
while (FindNextFile(hSearch, &fd));
FindClose(hSearch);
}
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX), !Rainmeter->GetDisableVersionCheck());
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX), Rainmeter->GetDisableDragging());
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX), Rainmeter->GetLogging());
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX), Rainmeter->GetDebug());
BOOL isLogFile = (_waccess(Rainmeter->GetLogFile().c_str(), 0) != -1);
EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON), isLogFile);
EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON), isLogFile);
}