• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ListBox_AddString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ListBox_AddString函数的典型用法代码示例。如果您正苦于以下问题:C++ ListBox_AddString函数的具体用法?C++ ListBox_AddString怎么用?C++ ListBox_AddString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ListBox_AddString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetDlgItem

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);
}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:26,代码来源:loggerw.cpp


示例2: ShowWindow

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);
}
开发者ID:HomerSp,项目名称:ppsspp,代码行数:26,代码来源:SymbolMap.cpp


示例3: ShowWindow

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);
}
开发者ID:jeid3,项目名称:ppsspp,代码行数:30,代码来源:SymbolMap.cpp


示例4: UpdateActiveSymbols

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);
}
开发者ID:AmesianX,项目名称:ppsspp,代码行数:58,代码来源:SymbolMap.cpp


示例5: IAddUserType

    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);
    }
开发者ID:H-uru,项目名称:Plasma,代码行数:13,代码来源:plAnimComponent.cpp


示例6: GetWindowRect

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();
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:32,代码来源:plResponderComponent.cpp


示例7: update_disasm

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);
}
开发者ID:Aleyr,项目名称:nesemu2,代码行数:29,代码来源:debugger.c


示例8: input_dinput_callback_add_joysticks_to_listbox

/**
 * 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;
}
开发者ID:salviati,项目名称:gens-gs-debug,代码行数:39,代码来源:input_dinput.cpp


示例9: EventDlgProc

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;
}
开发者ID:jiangguang5201314,项目名称:ZNginx,代码行数:29,代码来源:EVENTTST.C


示例10: SendDlgItemMessage

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);
}
开发者ID:abt8WG,项目名称:EDCB,代码行数:35,代码来源:SetDlgNetwork.cpp


示例11: GetDlgItem

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);
		}
	}
}
开发者ID:abt8WG,项目名称:EDCB,代码行数:26,代码来源:SetDlgNetwork.cpp


示例12: StatsListChangeStat

/*
 * 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);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:32,代码来源:statlist.c


示例13: ComboBox_GetCurSel

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);
}
开发者ID:Wu1994,项目名称:GameFinal,代码行数:26,代码来源:CCreateBoundingWindow.cpp


示例14: ViewItems_OnInitDialog

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
开发者ID:CireG,项目名称:Alien-Cabal-VEdit,代码行数:27,代码来源:ITEMDLG.C


示例15: ViewMarks_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
开发者ID:CireG,项目名称:Alien-Cabal-VEdit,代码行数:27,代码来源:MRKDLG.C


示例16: ST_LITERAL

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;
}
开发者ID:Hoikas,项目名称:Plasma,代码行数:34,代码来源:plAgeDescInterface.cpp


示例17: ShDirProc

/////////////////////////////////////////
// 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
开发者ID:madnessw,项目名称:thesnow,代码行数:37,代码来源:gui_tftp_dir.c


示例18: getSpellChecker

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);
}
开发者ID:edwpang,项目名称:DSpellCheck,代码行数:29,代码来源:LangListDialog.cpp


示例19: GroupDialogProc

/*
 * 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;
}
开发者ID:Tatsujinichi,项目名称:Meridian59,代码行数:63,代码来源:groupdlg.c


示例20: raise_killed_monster

  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;
  }
开发者ID:svn2github,项目名称:Brany_Skeldalu,代码行数:33,代码来源:WIZARD.C



注:本文中的ListBox_AddString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ListBox_GetCount函数代码示例发布时间:2022-05-30
下一篇:
C++ ListAdd函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap