当前位置: 首页>>代码示例>>C++>>正文


C++ ListBox_AddString函数代码示例

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


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


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