void LoggerWin::platformShut() { if(hWnd != NULL) { char szLog[] = "--- GOING AWAY... PRESS SPACE BAR TO CONTINUE ---"; HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); ListBox_AddString(hWndOutput, ""); ListBox_AddString(hWndOutput, szLog); int count = ListBox_GetCount(hWndOutput); ListBox_SetCaretIndex(hWndOutput, count - 1); UpdateWindow(hWndOutput); DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG_PAUSE), hWnd, (DLGPROC)PauseDlgProc); ProfileWin profile; RECT rc; if(GetWindowRect(hWnd, &rc)) profile.setSizeAndPosition(rc.right - rc.left, rc.bottom - rc.top, rc.left, rc.top); DestroyWindow(hWnd); hWnd = NULL; } UnregisterClass(szClassName, hInst); }
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symmask) { ShowWindow(listbox,SW_HIDE); ListBox_ResetContent(listbox); //int style = GetWindowLong(listbox,GWL_STYLE); ListBox_AddString(listbox,"(0x80000000)"); ListBox_SetItemData(listbox,0,0x80000000); //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 = ListBox_AddString(listbox,temp); ListBox_SetItemData(listbox,index,entries[i].vaddress); } } ShowWindow(listbox,SW_SHOW); }
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symmask) { ShowWindow(listbox,SW_HIDE); ListBox_ResetContent(listbox); //int style = GetWindowLong(listbox,GWL_STYLE); ListBox_AddString(listbox,"(0x80000000)"); ListBox_SetItemData(listbox,0,0x80000000); //ListBox_AddString(listbox,"(0x80002000)"); //ListBox_SetItemData(listbox,1,0x80002000); SendMessage(listbox, WM_SETREDRAW, FALSE, 0); SendMessage(listbox, LB_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 = ListBox_AddString(listbox,temp); ListBox_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); }
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symType) { if (activeNeedUpdate_) UpdateActiveSymbols(); wchar_t temp[256]; std::lock_guard<std::recursive_mutex> guard(lock_); SendMessage(listbox, WM_SETREDRAW, FALSE, 0); ListBox_ResetContent(listbox); switch (symType) { case ST_FUNCTION: { SendMessage(listbox, LB_INITSTORAGE, (WPARAM)activeFunctions.size(), (LPARAM)activeFunctions.size() * 30); for (auto it = activeFunctions.begin(), end = activeFunctions.end(); it != end; ++it) { const FunctionEntry& entry = it->second; const char* name = GetLabelName(it->first); if (name != NULL) wsprintf(temp, L"%S", name); else wsprintf(temp, L"0x%08X", it->first); int index = ListBox_AddString(listbox,temp); ListBox_SetItemData(listbox,index,it->first); } } break; case ST_DATA: { int count = ARRAYSIZE(defaultSymbols)+(int)activeData.size(); SendMessage(listbox, LB_INITSTORAGE, (WPARAM)count, (LPARAM)count * 30); for (int i = 0; i < ARRAYSIZE(defaultSymbols); i++) { wsprintf(temp, L"0x%08X (%S)", defaultSymbols[i].address, defaultSymbols[i].name); int index = ListBox_AddString(listbox,temp); ListBox_SetItemData(listbox,index,defaultSymbols[i].address); } for (auto it = activeData.begin(), end = activeData.end(); it != end; ++it) { const DataEntry& entry = it->second; const char* name = GetLabelName(it->first); if (name != NULL) wsprintf(temp, L"%S", name); else wsprintf(temp, L"0x%08X", it->first); int index = ListBox_AddString(listbox,temp); ListBox_SetItemData(listbox,index,it->first); } } break; } SendMessage(listbox, WM_SETREDRAW, TRUE, 0); RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); }
void IAddUserType(HWND hList) { int type = fPB->GetInt(fTypeID); int idx = ListBox_AddString(hList, kUseParamBlockNodeString); if (type == plAnimObjInterface::kUseParamBlockNode && !fPB->GetINode(fNodeParamID)) ListBox_SetCurSel(hList, idx); idx = ListBox_AddString(hList, kUseOwnerNodeString); if (type == plAnimObjInterface::kUseOwnerNode) ListBox_SetCurSel(hList, idx); }
void plResponderProc::AddCommand() { RECT rect; GetWindowRect(GetDlgItem(fhDlg, IDC_ADD_CMD), &rect); // Create the popup menu and get the option the user selects SetForegroundWindow(fhDlg); int type = TrackPopupMenu(fhMenu, TPM_RIGHTALIGN | TPM_NONOTIFY | TPM_RETURNCMD, rect.left, rect.top, 0, fhDlg, NULL); PostMessage(fhDlg, WM_USER, 0, 0); if (type == 0) return; CmdID& cmdID = fMenuCmds[type]; plResponderCmd *cmd = cmdID.first; int cmdIdx = cmdID.second; IParamBlock2 *cmdPB = cmd->CreatePB(cmdIdx); fStatePB->Append(kStateCmdParams, 1, (ReferenceTarget**)&cmdPB); IParamBlock2 *waitPB = ResponderWait::CreatePB(); fStatePB->Append(kStateCmdWait, 1, (ReferenceTarget**)&waitPB); BOOL enabled = TRUE; fStatePB->Append(kStateCmdEnabled, 1, &enabled); const char* name = GetCommandName(fStatePB->Count(kStateCmdParams)-1); int idx = ListBox_AddString(fhList, name); ListBox_SetCurSel(fhList, idx); ICreateCmdRollups(); }
static void update_disasm(HWND hwnd) { SCROLLINFO si; int i,highlight = -1; char str[128]; HWND hctrl = GetDlgItem(hwnd,IDC_DISASMLIST); u32 p = pc; //clear listbox ListBox_ResetContent(hctrl); //draw lines for(i=0;i<29;i++) { memset(str,0,128); sprintf(str,"%04X:\t",p); if(nes->cpu.pc == p) highlight = i; p = cpu_disassemble(&str[6],p); str[14] = '\t'; str[18] = '\t'; ListBox_AddString(hctrl,str); } if(highlight >= 0) ListBox_SetCurSel(hctrl,highlight); si.cbSize = sizeof(SCROLLINFO); si.fMask = SIF_POS; si.nPos = pc; SetScrollInfo(GetDlgItem(hwnd,IDC_DISASMSCROLL),SB_CTL,&si,TRUE); }
/** * input_dinput_callback_add_joysticks_to_listbox(): EnumDevices callback for adding joysticks to a listbox. * @param lpDIIJoy Joystick information. * @param pvRef Listbox to add the joystick information to. * @return DIENUM_CONTINUE to continue the enumeration; DIENUM_STOP to stop the enumeration. */ static BOOL CALLBACK input_dinput_callback_add_joysticks_to_listbox(LPCDIDEVICEINSTANCE lpDIIJoy, LPVOID pvRef) { TCHAR joy_name[64]; // NOTE: _sntprintf() is the TCHAR version of snprintf(). if (lpDIIJoy->tszProductName) { _sntprintf(joy_name, (sizeof(joy_name)/sizeof(TCHAR)), TEXT("Joystick %d: %s"), input_dinput_add_joysticks_count, lpDIIJoy->tszProductName); } else { _sntprintf(joy_name, (sizeof(joy_name)/sizeof(TCHAR)), TEXT("Joystick %d"), input_dinput_add_joysticks_count); } joy_name[(sizeof(joy_name)/sizeof(TCHAR))-1] = 0x00; // Add the joystick name to the listbox. ListBox_AddString((HWND)pvRef, joy_name); // Increment the joystick counter. input_dinput_add_joysticks_count++; // If the joystick counter exceeds the maximum number of joysticks, don't enumerate any more. if (input_dinput_add_joysticks_count >= MAX_JOYS) return DIENUM_STOP; // Next joystick. return DIENUM_CONTINUE; }
LRESULT CALLBACK EventDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND hctlListbox; switch (uMsg) { case WM_PLEASE_DISPLAY: hctlListbox = GetDlgItem(hDlg, IDC_RESULTS); ListBox_SetTopIndex(hctlListbox, ListBox_AddString(hctlListbox, lParam)); break; case WM_CLOSE: DestroyWindow(hDlg); hDlgMain = NULL; break; case WM_DESTROY: return TRUE; break; HANDLE_MSG(hDlg, WM_INITDIALOG, EventDlg_OnInitDialog); HANDLE_MSG(hDlg, WM_COMMAND, EventDlg_OnCommand); default: return (FALSE); } return 0; }
void CSetDlgNetwork::OnBnClickedButtonAddTcp() { // TODO: ここにコントロール通知ハンドラー コードを追加します。 DWORD ip = 0; SendDlgItemMessage(m_hWnd, IDC_IPADDRESS_TCP, IPM_GETADDRESS, 0, (LPARAM)&ip); UINT tcpPort = GetDlgItemInt(m_hWnd, IDC_EDIT_PORT_TCP, NULL, FALSE); NW_SEND_INFO item; item.ip = ip; item.port = tcpPort; Format(item.ipString, L"%d.%d.%d.%d", (item.ip&0xFF000000)>>24, (item.ip&0x00FF0000)>>16, (item.ip&0x0000FF00)>>8, (item.ip&0x000000FF) ); wstring add = L""; Format(add, L"%s:%d",item.ipString.c_str(), item.port); item.broadcastFlag = FALSE; HWND hItem = GetDlgItem(IDC_LIST_IP_TCP); for( int i=0; i<ListBox_GetCount(hItem); i++ ){ WCHAR buff[256]=L""; int len = ListBox_GetTextLen(hItem, i); if( 0 <= len && len < 256 ){ ListBox_GetText(hItem, i, buff); if(lstrcmpi(buff, add.c_str()) == 0 ){ return ; } } } int index = ListBox_AddString(hItem, add.c_str()); ListBox_SetItemData(hItem, index, (int)tcpSendList.size()); tcpSendList.push_back(item); }
void CSetDlgNetwork::OnBnClickedButtonDelUdp() { // TODO: ここにコントロール通知ハンドラー コードを追加します。 HWND hItem = GetDlgItem(IDC_LIST_IP_UDP); int sel = ListBox_GetCurSel(hItem); if( sel != LB_ERR ){ int index = (int)ListBox_GetItemData(hItem, sel); vector<NW_SEND_INFO>::iterator itr; itr = udpSendList.begin(); advance(itr, index); udpSendList.erase(itr); ListBox_ResetContent(hItem); for( int i=0; i<(int)udpSendList.size(); i++ ){ wstring add = L""; Format(add, L"%s:%d",udpSendList[i].ipString.c_str(), udpSendList[i].port); if( udpSendList[i].broadcastFlag == TRUE ){ add+= L" ブロードキャスト"; } index = ListBox_AddString(hItem, add.c_str()); ListBox_SetItemData(hItem, index, i); } } }
/* * StatsListChangeStat: Redisplay current statistic, whose value has changed. * Requires that s is a list type stat in the current group. */ void StatsListChangeStat(Statistic *s) { int index, top; if (s->num < 0 || s->num > ListBox_GetCount(hList)) { debug(("StatListChangeList got illegal stat #%d\n", (int) s->num)); return; } top = ListBox_GetTopIndex(hList); index = StatListFindItem(s->num); if (index == -1) { debug(("StatListChangeList got illegal stat #%d\n", (int) s->num)); return; } WindowBeginUpdate(hList); ListBox_DeleteString(hList, index); index = ListBox_AddString(hList, LookupNameRsc(s->name_res)); ListBox_SetItemData(hList, index, s); ListBox_SetTopIndex(hList, top); WindowEndUpdate(hList); }
void CCreateBoundingWindow::OnClickCreateButton() { int selectedIndex = ComboBox_GetCurSel(mBoundingCategoryComboBox); if (selectedIndex == -1) return; TCHAR boundingName[128]; SendMessage(mBoundingCategoryComboBox, CB_GETLBTEXT, selectedIndex, (LPARAM)boundingName); CEditorScene* scene = CEditorScene::getInstance(); int boundingCategory = selectedIndex; if (selectedIndex == BOX_BOUNDING) { scene->AddBoxBounding(); } else if (selectedIndex == CYLINDER_BOUNDING) { scene->AddCylinderBounding(); } int index = ListBox_AddString(mBoundingsList, boundingName); ListBox_SetItemData(mBoundingsList, index, boundingCategory); }
BOOL ViewItems_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { INT i; HWND hwndCtrl; hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_LIST ); for( i = 0; i < po->nItems; ++i ) { ListBox_AddString( hwndCtrl, po->pItemData[i].item_name ); } ListBox_SetCurSel( hwndCtrl, 0 ); hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_TYPE ); Static_SetText( hwndCtrl, GetItemTypeString( po->pItemData[0].item_type ) ); hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_PIXEL_SIZE ); Edit_LimitText( hwndCtrl, 8 ); ViewItems_ItemChanged( hwnd ); AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // ViewItems_OnInitDialog
BOOL ViewMarks_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { INT i; HWND hwndCtrl; hwndCtrl = GetDlgItem( hwnd, IDC_MARK_LIST ); for( i = 0; i < pLevel->nMarks; ++i ) { ListBox_AddString( hwndCtrl, pLevel->pMarkData[i].mark_name ); } if (pLevel->nLastMark < 0 || pLevel->nLastMark >= pLevel->nMarks) { pLevel->nLastMark = -1; } if (pLevel->nMarks > 0) { ListBox_SetCurSel( hwndCtrl, pLevel->nLastMark ); } AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // ViewMarks_OnInitDialog
void plAgeDescInterface::INewPage() { ST::string name = ST_LITERAL("New Page Name"); // Get the name of the new age from the user int ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_AGE_NAME), GetCOREInterface()->GetMAXHWnd(), NewAgeDlgProc, (LPARAM)&name); if (ret != 1) return; HWND hPages = GetDlgItem(fhDlg, IDC_PAGE_LIST); // Make sure this page doesn't already exist int count = ListBox_GetCount(hPages); for (int i = 0; i < count; i++) { char pageName[256]; ListBox_GetText(hPages, i, pageName); if (!name.compare_i(pageName)) return; } // Add the new page and select it int idx = ListBox_AddString(hPages, name.c_str()); // Choose a new sequence suffix for it plAgePage *newPage = new plAgePage( name, IGetFreePageSeqSuffix( hPages ), 0 ); ListBox_SetItemData( hPages, idx, (LPARAM)newPage ); fDirty = true; }
///////////////////////////////////////// // Dir window callback LRESULT CALLBACK ShDirProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static const int tTabs[] = { 90, 125 }; struct S_DirectoryContent *pDir = (struct S_DirectoryContent *) lParam; HWND hLBWnd = GetDlgItem (hWnd, IDC_LB_SHDIR); int Ark; switch (message) { case WM_INITDIALOG : // Set the window name to either tftpd32 or tftpd64 SetWindowText (hWnd, TFTPD_DIR_TITLE); ListBox_SetTabStops ( hLBWnd, SizeOfTab(tTabs), tTabs ); ListBox_ResetContent ( hLBWnd ); for ( Ark=0 ; Ark < pDir->nb ; Ark++ ) ListBox_AddString ( hLBWnd, pDir->ent[Ark].file_descr ); CenterChildWindow (hWnd, CCW_INSIDE | CCW_VISIBLE); // If GUI is in remote mode, deactivate Explorer Button if ( IsGuiConnectedToRemoteService () ) Button_Enable (GetDlgItem (hWnd, IDC_SD_EXPLORER), FALSE); break; case WM_COMMAND : Handle_VM_Command (hWnd, wParam, lParam); break; case WM_CLOSE : case WM_DESTROY : EndDialog (hWnd, 0); break; } // switch return FALSE; } // ShDirProc
void LangListDialog::update() { if (!isCreated ()) return; auto status = getSpellChecker()->getStatus(); ListBox_ResetContent(HLangList); for (auto &lang : status->languageList) ListBox_AddString(HLangList, lang.aliasName.c_str ()); auto settingsCopy = *getSpellChecker()->getSettings(); wchar_t *multiLangCopy = nullptr; wchar_t *context = nullptr; setString (multiLangCopy, settingsCopy.spellerSettings[SpellerType::hunspell].activeMultiLanguage.data ()); int index = 0; auto token = _tcstok_s(multiLangCopy, _T ("|"), &context); while (token) { index = -1; for (int i = 0; i < static_cast<int> (status->languageList.size ()); ++i) { if (status->languageList[i].originalName == token) { index = i; break; } } if (index != -1) CheckedListBox_SetCheckState(HLangList, index, BST_CHECKED); token = _tcstok_s(NULL, _T ("|"), &context); } CLEAN_AND_ZERO_ARR (multiLangCopy); }
/* * GroupDialogProc: Dialog procedure for group dialog. */ BOOL CALLBACK GroupDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) { int i, index; HWND hList, hCombo; list_type l; switch (message) { case WM_INITDIALOG: // Add groups to list box hCombo = GetDlgItem(hDlg, IDC_GROUPS); SetWindowFont(hCombo, GetFont(FONT_LIST), FALSE); for (i=0; i < num_groups; i++) index = ComboBox_AddString(hCombo, groups[i]); // Add logged on users to list box hList = GetDlgItem(hDlg, IDC_LOGGEDON); SetWindowFont(hList, GetFont(FONT_LIST), FALSE); for (l = *(cinfo->current_users); l != NULL; l = l->next) { object_node *obj = (object_node *) (l->data); ListBox_AddString(hList, LookupNameRsc(obj->name_res)); } PostMessage(hDlg, BK_CREATED, 0, 0); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPMEMBERS), GetFont(FONT_LIST), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_ADDNAME), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_NEWGROUP), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPTELL), GetFont(FONT_EDIT), FALSE); Edit_LimitText(GetDlgItem(hDlg, IDC_NEWGROUP), MAX_GROUPNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_ADDNAME), MAX_CHARNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_GROUPTELL), MAXSAY); if (num_groups >= MAX_NUMGROUPS) EnableWindow(GetDlgItem(hDlg, IDC_NEWGROUP), FALSE); hGroupDialog = hDlg; CenterWindow(hDlg, GetParent(hDlg)); return TRUE; case BK_CREATED: hCombo = GetDlgItem(hDlg, IDC_GROUPS); ComboBox_SetCurSel(hCombo, 0); // Need this for some reason to simulate WM_COMMAND GroupCommand(hDlg, IDC_GROUPS, hCombo, CBN_SELCHANGE); return TRUE; HANDLE_MSG(hDlg, WM_COMMAND, GroupCommand); case WM_DRAWITEM: // windowsx.h macro always returns FALSE return GroupListDrawItem(hDlg, (const DRAWITEMSTRUCT *)(lParam)); case WM_DESTROY: hGroupDialog = NULL; return TRUE; } return FALSE; }
static char raise_killed_monster(HWND hDlg) { HWND listdlg = PrepareListWindow(hDlg); HWND list = GetDlgItem(listdlg,IDC_LIST); char buff[256]; int i; int res; for (i = 0;i<MAX_MOBS;i++) if (~mobs[i].vlajky & MOB_LIVE && mobs[i].cislo_vzoru != 0) { int p; _snprintf(buff,sizeof(buff),"%4d. %s (sector: %d home %d)",i,mobs[i].name,mobs[i].sector,mobs[i].home_pos); kamenik2windows(buff,strlen(buff),buff); p = ListBox_AddString(list,buff); ListBox_SetItemData(list,p,i); } res = PumpDialogMessages(listdlg); while (res == IDOK) { int cnt; for (i = 0,cnt = ListBox_GetCount(list);i<cnt;i++) if (ListBox_GetSel(list,i)) { int idx = ListBox_GetItemData(list,i); mobs[idx].vlajky |= MOB_LIVE; mobs[idx].lives = mobs[idx].vlastnosti[VLS_MAXHIT]; wzprintf("%s znovu povstal(a)\r\n",mobs[idx].name); SEND_LOG("(WIZARD) '%s' has been raised",mobs[idx].name,0); } res = PumpDialogMessages(listdlg); } CloseListWindow(listdlg); return 1; }
void updateLB1( HWND hDlg ) { HWND hWndLB1 = GetDlgItem( hDlg, IDC_LIST1 ); if( g_cfg ) { int i = 0; for( i=0; i<PLAYERS_COUNT; i++ ) { if( g_cfg->order[i] != 0 ) ListBox_AddString( hWndLB1, szPlayers[g_cfg->order[i]] ); } } else { ListBox_AddString( hWndLB1, TEXT("g_cfg is NULL! Config not loaded") ); } }
void IAddUserType(HWND hList) { int idx = ListBox_AddString(hList, kResponderNodeName); int type = fPB->GetInt(fTypeID); if (type == kNodeResponder) ListBox_SetCurSel(hList, idx); }
void PrintProcessNameAndID(DWORD processID, bool theFirst) { TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>"); HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID); if (NULL != hProcess) { HMODULE hMod; DWORD cbNeeded; if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) { GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName) / sizeof(TCHAR)); } } if (_tccmp(szProcessName, L"<unknown>")) { if (theFirst) { twar[i] = processID; i++; } switch (GetPriorityClass(hProcess)) { case IDLE_PRIORITY_CLASS: ListBox_AddString(hWndListOne, _tcscat(szProcessName,L" - IDLE")); break; case NORMAL_PRIORITY_CLASS: ListBox_AddString(hWndListOne, _tcscat(szProcessName, L" - Normal")); break; case REALTIME_PRIORITY_CLASS: ListBox_AddString(hWndListOne, _tcscat(szProcessName, L" - Realtime") ); break; case HIGH_PRIORITY_CLASS: ListBox_AddString(hWndListOne, _tcscat(szProcessName, L" - High")); break; } } CloseHandle(hProcess); }
int EnumPlugins(const char *szSetting,LPARAM lparam) { HWND hlist=(HWND)lparam; ListBox_AddString(hlist,strdup(szSetting)); return 0; }
static void DispInfoExt(HWND hDlg,CShellExt *lpcs) { //クリア long items = ListBox_GetCount(GetDlgItem(hDlg,IDC_LIST_VALUE)); if(items != LB_ERR) { for(int i=0; i<items; i++) { COggExt *oggExt = (COggExt *)ListBox_GetItemData(GetDlgItem(hDlg,IDC_LIST_VALUE),0); if(oggExt) { delete oggExt; } ListBox_DeleteString(GetDlgItem(hDlg,IDC_LIST_VALUE),0); } } CString strDisp; CStringArray strArray; lpcs->m_Ogg.GetCommentNames(strArray); items = 0; for(int i=0; i<strArray.GetSize(); i++) { CString strName = strArray.GetAt(i); CString strValue; CString _strValue; int j = 0; while(1) { if(!lpcs->m_Ogg.GetComment(strName,j++,strValue)) { break; } //標準名は除外 if((j == 1) && ( !strName.Compare(_T("TITLE")) || !strName.Compare(_T("TRACKNUMBER")) || !strName.Compare(_T("ARTIST")) || !strName.Compare(_T("ALBUM")) || !strName.Compare(_T("ALBUMARTIST")) || !strName.Compare(_T("DISCNUMBER")) || !strName.Compare(_T("DATE")) || !strName.Compare(_T("GENRE")) || !strName.Compare(_T("COMMENT"))) ) { continue; } // TRACE(_T("OGG %s %s\n"),strName,strValue); COggExt *oggExt = new COggExt(strName,strValue); ListBox_AddString(GetDlgItem(hDlg,IDC_LIST_VALUE),oggExt->Get1LineDisp()); ListBox_SetItemData(GetDlgItem(hDlg,IDC_LIST_VALUE),items,oggExt); items++; } } }
void plBridgeProc::ILoadList(IParamBlock2* pb, HWND hDlg) { HWND hList = GetDlgItem(hDlg, IDC_SECT_LIST); for (int i = 0; i < pb->Count(plPhysBridgeComponent::kSections); i++) { INode* node = pb->GetINode(plPhysBridgeComponent::kSections, 0, i); ListBox_AddString(hList, node->GetName()); } }
/* * AddItem() */ int TxLbx_AddItem(HWND listBox, const _TUCHAR *text, DWORD itemData , TXLBX_ATTR attr) { int lbxItem; lbxItem = ListBox_AddString(listBox, text); ListBox_SetItemData(listBox, lbxItem, attr | (itemData & 0x00FFFFFF)); return lbxItem; }
void updateLB2( HWND hDlg ) { HWND hWndLB2 = GetDlgItem( hDlg, IDC_LIST2 ); int i = 0; for( i=1; i<=PLAYERS_COUNT; i++ ) { if( !IsPlayerAdded( hDlg, i ) ) ListBox_AddString( hWndLB2, szPlayers[i] ); } }
void CInstanceInfoWindow::AddListBoxItem(u32 id) { TCHAR text[256]; _stprintf_s(text, TEXT("ID%d"), id); int itemIndex = ListBox_AddString(mInstancesListBox, text); ListBox_SetItemData(mInstancesListBox, itemIndex, id); SetFocus(mParentHwnd); }
/* ** Called when tab is displayed. ** */ void CDialogManage::CTabThemes::Initialize() { m_Initialized = true; HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); const std::vector<std::wstring>& themes = Rainmeter->GetAllThemes(); for (int i = 0, isize = themes.size(); i < isize; ++i) { ListBox_AddString(item, themes[i].c_str()); } }