/* * UpdateAllyLists: Helper function to clear and update the alliance info */ void UpdateAllyLists(HWND hDlg) { ListBox_ResetContent(GetDlgItem(hDlg, IDC_ALLYGUILDS)); ListBox_ResetContent(GetDlgItem(hDlg, IDC_GUILDS)); ListBox_ResetContent(GetDlgItem(hDlg, IDC_ENEMYGUILDS)); RequestGuildList(); return; }
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); } } }
/* * LookListSetContents: Set contents & highlight of list box in Look dialog. */ void LookListSetContents(HWND hwndListBox, list_type contents, int flags) { list_type l; object_node *obj; WindowBeginUpdate(hwndListBox); ListBox_ResetContent(hwndListBox); /* Fill in list box with stuff from passed-in list */ for (l = contents; l != NULL; l = l->next) { /* We need to make a copy of this object, because the original object might be freed by the game before this dialog ends */ obj = ObjectCopy((object_node *) (l->data)); ItemListAddItem(hwndListBox, obj, -1, !(flags & LD_AMOUNTS)); /* Add to end */ } WindowEndUpdate(hwndListBox); /* In single selection box, make 1st item default. In multiple selection, * only highlight 1st item if there is just 1 item AND item doesn't need an amount */ if ((flags & LD_MULTIPLESEL) && contents->next == NULL) { obj = (object_node *) contents->data; if (!(info->flags & LD_AMOUNTS) || !IsNumberObj(obj->id)) { ListBox_SetSel(hwndListBox, TRUE, 0); info->selected[0] = True; } } else ListBox_SetCurSel(hwndListBox, 0); }
///////////////////////////////////////// // 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
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); }
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 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); }
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 wxListBox::Clear() { Free(); ListBox_ResetContent(GetHwnd()); m_noItems = 0; SetHorizontalExtent(); }
void wxListBox::DoClear() { Free(); ListBox_ResetContent(GetHwnd()); m_noItems = 0; m_updateHorizontalExtent = true; UpdateOldSelections(); }
/* * AdminStartResponse: We've just started a new response of the given type. */ void AdminStartResponse(int type) { num_lines = 0; switch (type) { case ADMIN_OBJECT: WindowBeginUpdate(hObjectList); ListBox_ResetContent(hObjectList); break; } }
void plResponderProc::LoadList() { ListBox_ResetContent(fhList); for (int i = 0; i < fStatePB->Count(kStateCmdParams); i++) { const char* name = GetCommandName(i); ListBox_AddString(fhList, name); } ListBox_SetCurSel(fhList, -1); }
void ProjectConfigDialog::updatePackagePath(void) { HWND listbox = GetDlgItem(m_hwndDialog, IDC_LIST_PACKAGE_SEARCH_PATHS); ListBox_ResetContent(listbox); const vector<string> paths = m_project.getPackagePathArray(); for (vector<string>::const_iterator it = paths.begin(); it != paths.end(); ++it) { wstring item; item.assign(it->begin(), it->end()); ListBox_AddString(listbox, item.c_str()); } }
void plMtlEventProc::ILoadUser(HWND hWnd, IParamBlock2* pb) { HWND hList = GetDlgItem(hWnd, IDC_EVENT_LIST); ListBox_ResetContent(hList); // // If we don't have a valid material, we should be disabled // Mtl* mtl = pb->GetMtl(kMtlMtl); if (!mtl) { EnableWindow(hList, FALSE); return; } else EnableWindow(hList, TRUE); // // Load the events // int idx; idx = ListBox_AddStringData(hList, "(Begin)", kAnimEventBegin); if (pb->GetInt(kMtlBegin)) ListBox_SetSel(hList, TRUE, idx); idx = ListBox_AddStringData(hList, "(End)", kAnimEventEnd); if (pb->GetInt(kMtlEnd)) ListBox_SetSel(hList, TRUE, idx); if (mtl) { ST::string mtlAnim = ST::string::from_utf8(pb->GetStr(kMtlAnim)); // Get the shared animations for all the nodes this component is applied to plNotetrackAnim anim(mtl, nil); plAnimInfo info = anim.GetAnimInfo(mtlAnim); RemoveDeadMarkers(pb, kMtlMarkers, info); // Get all the markers in this animation ST::string marker; while (!(marker = info.GetNextMarkerName()).is_empty()) { idx = ListBox_AddStringData(hList, marker.c_str(), kAnimEventMarker); if (IsMarkerSelected(pb, kMtlMarkers, marker)) ListBox_SetSel(hList, TRUE, idx); } } }
void plAnimEventProc::ILoadUser(HWND hWnd, IParamBlock2* pb) { HWND hList = GetDlgItem(hWnd, IDC_EVENT_LIST); ListBox_ResetContent(hList); plAnimComponentBase* comp; plMaxNode* node; // // If we don't have a valid comp and node, we should be disabled // if (!GetCompAndNode(pb, (plComponentBase*&)comp, node)) { EnableWindow(hList, FALSE); return; } else EnableWindow(hList, TRUE); // // Load the events // int idx; idx = ListBox_AddStringData(hList, "(Begin)", kAnimEventBegin); if (pb->GetInt(kAnimBegin)) ListBox_SetSel(hList, TRUE, idx); idx = ListBox_AddStringData(hList, "(End)", kAnimEventEnd); if (pb->GetInt(kAnimEnd)) ListBox_SetSel(hList, TRUE, idx); if (comp) { // Get the shared animations for all the nodes this component is applied to plNotetrackAnim anim(comp, nil); plAnimInfo info = anim.GetAnimInfo(comp->GetAnimName()); RemoveDeadMarkers(pb, kAnimMarkers, info); // Get all the markers in this animation ST::string marker; while (!(marker = info.GetNextMarkerName()).is_empty()) { idx = ListBox_AddStringData(hList, marker.c_str(), kAnimEventMarker); if (IsMarkerSelected(pb, kAnimMarkers, marker)) ListBox_SetSel(hList, TRUE, idx); } } }
/* ** Updates the list of skins. ** */ void DialogAbout::TabSkins::UpdateSkinList() { // Delete all entries HWND item = GetControl(Id_SkinsListBox); ListBox_ResetContent(item); // Add entries for each skin std::wstring::size_type maxLength = 0; const std::map<std::wstring, Skin*>& windows = GetRainmeter().GetAllSkins(); std::map<std::wstring, Skin*>::const_iterator iter = windows.begin(); bool found = false; for ( ; iter != windows.end(); ++iter) { const std::wstring& skinName = (*iter).first; std::wstring::size_type curLength = skinName.length(); if (curLength > maxLength) { maxLength = curLength; } const WCHAR* name = skinName.c_str(); int index = ListBox_AddString(item, name); if (!found && m_SkinWindow == (*iter).second) { found = true; m_SkinWindow = (*iter).second; ListBox_SetCurSel(item, index); } } ListBox_SetHorizontalExtent(item, 6 * maxLength); if (!found) { if (windows.empty()) { m_SkinWindow = nullptr; item = GetControl(Id_ItemsListView); ListView_DeleteAllItems(item); } else { // Default to first skin m_SkinWindow = (*windows.begin()).second; ListBox_SetCurSel(item, 0); UpdateMeasureList(m_SkinWindow); } } }
/* * MailGetMessageList: Load filenames of all mail messages, and store in a list box. */ void MailGetMessageList(void) { HANDLE hFindFile; WIN32_FIND_DATA file_info; char path[MAX_PATH + FILENAME_MAX]; int index, msgnum; MailHeader header; /* Load messages in, in sorted order */ if (hMsgList == NULL) hMsgList = CreateWindow("listbox", "", WS_CHILD | LBS_SORT, 0, 0, 0, 0, cinfo->hMain, NULL, hInst, NULL); else ListBox_ResetContent(hMsgList); sprintf(path,"%s\\%s", MAIL_DIR, MAIL_SPEC); hFindFile = FindFirstFile(path, &file_info); if (hFindFile == INVALID_HANDLE_VALUE) return; while (1) { // Skip directories if (!(file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { /* Set itemdata of each entry to message header info */ msgnum = atoi(file_info.cFileName); sprintf(path, "%s\\%s", MAIL_DIR, file_info.cFileName); index = ListBox_AddString(hMsgList, path); ListBox_SetItemData(hMsgList, index, msgnum); } if (FindNextFile(hFindFile, &file_info) == FALSE) break; } FindClose(hFindFile); // Add messages to mail dialog for (index = 0; index < ListBox_GetCount(hMsgList); index++) { msgnum = ListBox_GetItemData(hMsgList, index); ListBox_GetText(hMsgList, index, path); // Send summary string to mail dialog if (hReadMailDlg != NULL && MailParseMessageHeader(msgnum, path, &header)) SendMessage(hReadMailDlg, BK_NEWMAIL, msgnum, (LPARAM) &header); } }
/* ** Updates the list of skins. ** */ void CDialogAbout::CTabSkins::UpdateSkinList() { // Delete all entries HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTBOX); ListBox_ResetContent(item); // Add entries for each skin std::wstring::size_type maxLength = 0; const std::map<std::wstring, CMeterWindow*>& windows = Rainmeter->GetAllMeterWindows(); std::map<std::wstring, CMeterWindow*>::const_iterator iter = windows.begin(); bool found = false; for ( ; iter != windows.end(); ++iter) { const std::wstring& skinName = (*iter).first; std::wstring::size_type curLength = skinName.length(); if (curLength > maxLength) { maxLength = curLength; } const WCHAR* name = skinName.c_str(); int index = ListBox_AddString(item, name); if (!found && m_SkinWindow == (*iter).second) { found = true; m_SkinWindow = (*iter).second; ListBox_SetCurSel(item, index); } } ListBox_SetHorizontalExtent(item, 6 * maxLength); if (!found) { if (windows.empty()) { m_SkinWindow = NULL; item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW); ListView_DeleteAllItems(item); } else { // Default to first skin m_SkinWindow = (*windows.begin()).second; ListBox_SetCurSel(item, 0); UpdateMeasureList(m_SkinWindow); } } }
void UninstallerShortcutsListbox::updateListbox() const { SendMessage(m_listbox, WM_SETREDRAW, FALSE, 0); ListBox_ResetContent(m_listbox); size_t maxWidth = 0; for (const wstring& file : m_files) { ListBox_AddString(m_listbox, file.data()); maxWidth = __max(maxWidth, file.size()); } ListBox_SetHorizontalExtent(m_listbox, getTextWidth(m_dialogbox, maxWidth)); SendMessage(m_listbox, WM_SETREDRAW, TRUE, 0); RedrawWindow(m_listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); }
void SymbolMap::FillListBoxBLinks(HWND listbox, int num) { ListBox_ResetContent(listbox); int style = GetWindowLong(listbox,GWL_STYLE); MapEntry &e = entries[num]; #ifdef BWLINKS for (int i=0; i<e.backwardLinks.size(); i++) { u32 addr = e.backwardLinks[i]; int index = ListBox_AddString(listbox,SymbolMap::GetSymbolName(SymbolMap::GetSymbolNum(addr))); ListBox_SetItemData(listbox,index,addr); } #endif }
void wxListBox::DoClear() { #if wxUSE_OWNER_DRAWN if ( HasFlag(wxLB_OWNERDRAW) ) { WX_CLEAR_ARRAY(m_aItems); } #endif // wxUSE_OWNER_DRAWN ListBox_ResetContent(GetHwnd()); m_noItems = 0; MSWOnItemsChanged(); UpdateOldSelections(); }
///////////////////////////////////////////////////////////////////////// //Function: UpdateObjectList //Description: Update the Available object list ///////////////////////////////////////////////////////////////////////// void UpdateObjectList (HWND hDlg, int buttonID) { LONG theGetType ; TYPEID IDtype; // clear all strings from the list box //SendDlgItemMessage(hDlg, IDD_OBJECTSLIST, LB_RESETCONTENT, 0, 0) ; ListBox_ResetContent (GetDlgItem (hDlg, IDD_OBJECTSLIST)) ; EnableWindow(GetDlgItem(hDlg, addB), FALSE) ; // if "other" object types are selected if(buttonID == otherB) { theGetType = AOBJ_GETFIRSTKEY ; while((IDtype=ATypeGetNext(&theGetType)) !=0) { if(IDtype!=OTYPE_TEXT && IDtype!=OTYPE_NUMBER && IDtype!=OTYPE_PICTURE && IDtype!=OTYPE_LIST) DisplayObj(hDlg, IDtype) ; } return ; } //if"text","number","picture","time","date" object types are selected switch(buttonID) { case textB: IDtype = OTYPE_TEXT ; break ; case numberB: IDtype = OTYPE_NUMBER; break ; case pictureB: IDtype = OTYPE_PICTURE; break; case listB: IDtype = OTYPE_LIST ; break; } DisplayObj(hDlg, IDtype) ; return ; }
void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) { // avoid flicker - but don't need to do this for a hidden listbox bool hideAndShow = IsShown(); if ( hideAndShow ) { ShowWindow(GetHwnd(), SW_HIDE); } ListBox_ResetContent(GetHwnd()); m_noItems = choices.GetCount(); int i; for (i = 0; i < m_noItems; i++) { ListBox_AddString(GetHwnd(), choices[i]); if ( clientData ) { SetClientData(i, clientData[i]); } } #if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { // first delete old items WX_CLEAR_ARRAY(m_aItems); // then create new ones for ( size_t ui = 0; ui < (size_t)m_noItems; ui++ ) { wxOwnerDrawn *pNewItem = CreateLboxItem(ui); pNewItem->SetName(choices[ui]); m_aItems.Add(pNewItem); ListBox_SetItemData(GetHwnd(), ui, pNewItem); } } #endif // wxUSE_OWNER_DRAWN SetHorizontalExtent(); if ( hideAndShow ) { // show the listbox back if we hid it ShowWindow(GetHwnd(), SW_SHOW); } InvalidateBestSize(); }
/* This function deletes the out-basket. */ void FASTCALL DestroyOutBasket( void ) { /* If the out-basket window is open, delete * the contents of the list box. */ if( hwndOutBasket ) { HWND hwndList; hwndList = GetDlgItem( hwndOutBasket, IDD_LIST ); ListBox_ResetContent( hwndList ); } /* Delete all out-basket items. */ Amob_ClearMemory(); }
VOID Dlg_PopulateModuleList(HWND hwnd) { HWND hwndModuleHelp = GetDlgItem(hwnd, IDC_MODULEHELP); ListBox_ResetContent(hwndModuleHelp); CToolhelp thProcesses(TH32CS_SNAPPROCESS); PROCESSENTRY32 pe = { sizeof(pe) }; BOOL fOk = thProcesses.ProcessFirst(&pe); for (; fOk; fOk = thProcesses.ProcessNext(&pe)) { CToolhelp thModules(TH32CS_SNAPMODULE, pe.th32ProcessID); MODULEENTRY32 me = { sizeof(me) }; BOOL fOk = thModules.ModuleFirst(&me); for (; fOk; fOk = thModules.ModuleNext(&me)) { int n = ListBox_FindStringExact(hwndModuleHelp, -1, me.szExePath); if (n == LB_ERR) { // This module hasn't been added before ListBox_AddString(hwndModuleHelp, me.szExePath); } } } HWND hwndList = GetDlgItem(hwnd, IDC_PROCESSMODULELIST); SetWindowRedraw(hwndList, FALSE); ComboBox_ResetContent(hwndList); int nNumModules = ListBox_GetCount(hwndModuleHelp); for (int i = 0; i < nNumModules; i++) { TCHAR sz[1024]; ListBox_GetText(hwndModuleHelp, i, sz); // Place module name (without its path) in the list int nIndex = ComboBox_AddString(hwndList, _tcsrchr(sz, TEXT('\\')) + 1); // Associate the index of the full path with the added item ComboBox_SetItemData(hwndList, nIndex, i); } ComboBox_SetCurSel(hwndList, 0); // Select the first entry // Simulate the user selecting this first item so that the // results pane shows something interesting FORWARD_WM_COMMAND(hwnd, IDC_PROCESSMODULELIST, hwndList, CBN_SELCHANGE, SendMessage); SetWindowRedraw(hwndList, TRUE); InvalidateRect(hwndList, NULL, FALSE); }
///////////////////////////////////////////////////////////////////////// //Function: InitDialog //Description: Initialize the dialog box ///////////////////////////////////////////////////////////////////////// void InitDialog ( HWND hDlg, OBJECTID gObject) { LPOBJECTID gObjPtr ; DWORD objIndex ; char * lpszString ; char buffer[OBJECTNAMESIZE] ; int i ; AObjGetName(gObject, buffer, OBJECTNAMESIZE) ; SetWindowText(hDlg, buffer) ; lpszString = new char[256] ; // check the "Text" radio button CheckRadioButton (hDlg, textB, otherB, textB) ; // initialize the Object Selection list UpdateObjectList (hDlg, textB) ; // disable the remove and edit buttons EnableWindow(GetDlgItem(hDlg, removeB), FALSE) ; EnableWindow (GetDlgItem(hDlg, editB), FALSE) ; // initialize the object list //SendDlgItemMessage(hDlg, IDD_FIELDSLIST, LB_RESETCONTENT, 0, 0) ; ListBox_ResetContent (GetDlgItem(hDlg, IDD_FIELDSLIST)) ; gObjPtr = (LPOBJECTID) AObjLockData(gObject, 0) ; if (gObjPtr != NULL) { for (i=0; i< AObjGetDataSize(gObject, 0)/sizeof(OBJECTID); i++) { AObjGetName(gObjPtr[i], lpszString, 255) ; //objIndex = SendDlgItemMessage(hDlg, IDD_FIELDSLIST, LB_ADDSTRING, 0, (long)lpszString) ; //SendDlgItemMessage(hDlg,IDD_FIELDSLIST, LB_SETITEMDATA, (WPARAM)objIndex, (long)gObjPtr[i]) ; objIndex = ListBox_AddString (GetDlgItem (hDlg, IDD_FIELDSLIST), lpszString) ; ListBox_SetItemData (GetDlgItem (hDlg, IDD_FIELDSLIST), objIndex, gObjPtr[i]) ; } AObjUnlockData(gObject, 0); } delete (lpszString) ; return ; }
VOID EditNoise_InitList(HWND hwnd) { INT i; HWND hwndCtrl; hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_LIST); ListBox_ResetContent(hwndCtrl); for(i = 0; i < po->nSounds; ++i) { ListBox_AddString(hwndCtrl, po->pSoundData[i].sound_name); } ListBox_SetCurSel(hwndCtrl, nNewSoundIndex); return; } // EditNoise_InitList
void LoggerWin::dumpStringToMainWindow(char * string) { // listboxes don't want <CR> and <LF> so cut them off if any. The order is important. char * p = strrchr(string, '\n'); if(p) *p = '\0'; p = strrchr(string, '\r'); if(p) *p = '\0'; HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); ListBox_AddString(hWndOutput, string); int count = ListBox_GetCount(hWndOutput); if(count == 32767) ListBox_ResetContent(hWndOutput); ListBox_SetCaretIndex(hWndOutput, count - 1); UpdateWindow(hWndOutput); }
void w32g_clear_playlist(void) { HWND hListBox; hListBox = playlist_box(); while(playlist.nfiles > 0) { playlist.nfiles--; free(playlist.list[playlist.nfiles].filename); #if 0 if(hListBox) ListBox_DeleteString(hListBox, playlist.nfiles); #endif } // LB_RESETCONTENT if(hListBox) ListBox_ResetContent(hListBox); playlist.selected = 0; SetNumListWnd(0,0); }