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

C++ ListView_InsertItem函数代码示例

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

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



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

示例1: wxCHECK_RET

void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
{
    wxCHECK_RET( IsValidInsert( pos ),
                 wxT("invalid index in wxListBox::InsertItems") );

    for( unsigned int i = 0; i < items.GetCount(); i++ )
    {
        LVITEM newItem;
        wxZeroMemory(newItem);
        newItem.iItem = i+pos;
        int ret = ListView_InsertItem( (HWND)GetHWND(), & newItem );
        wxASSERT_MSG( int(i+pos) == ret , _T("Item not added") );
        SetString( ret , items[i] );
        m_itemsClientData.Insert(NULL, ret);
    }
}
开发者ID:EdgarTx,项目名称:wx,代码行数:16,代码来源:checklst.cpp


示例2: ListView_GetItemCount

void pListView::append(const lstring& list) {
  wchar_t empty[] = L"";
  unsigned row = ListView_GetItemCount(hwnd);
  LVITEM item;
  item.mask = LVIF_TEXT;
  item.iItem = row;
  item.iSubItem = 0;
  item.pszText = empty;
  locked = true;
  ListView_InsertItem(hwnd, &item);
  locked = false;
  for(unsigned column = 0; column < list.size(); column++) {
    utf16_t wtext(list(column, ""));
    ListView_SetItemText(hwnd, row, column, wtext);
  }
}
开发者ID:quequotion,项目名称:higan-qq,代码行数:16,代码来源:list-view.cpp


示例3: switch

/*
** Adds item to log.
**
*/
void CDialogAbout::CTabLog::AddItem(int level, LPCWSTR time, LPCWSTR message)
{
	WCHAR buffer[32];
	LVITEM vitem;
	vitem.mask = LVIF_IMAGE | LVIF_TEXT;
	vitem.iItem = 0;
	vitem.iSubItem = 0;
	vitem.pszText = buffer;
	HWND item;

	switch (level)
	{
	case LOG_ERROR:
		if (!m_Error) return;
		item = GetDlgItem(m_Window, IDC_ABOUTLOG_ERROR_CHECKBOX);
		vitem.iImage = 0;
		break;

	case LOG_WARNING:
		if (!m_Warning) return;
		item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
		vitem.iImage = 1;
		break;

	case LOG_NOTICE:
		if (!m_Notice) return;
		item = GetDlgItem(m_Window, IDC_ABOUTLOG_NOTICE_CHECKBOX);
		vitem.iImage = 2;
		break;

	case LOG_DEBUG:
		if (!m_Debug) return;
		item = GetDlgItem(m_Window, IDC_ABOUTLOG_DEBUG_CHECKBOX);
		vitem.iImage = -1;
		break;
	}

	GetWindowText(item, buffer, 32);
	item = GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW);
	ListView_InsertItem(item, &vitem);
	ListView_SetItemText(item, vitem.iItem, 1, (WCHAR*)time);
	ListView_SetItemText(item, vitem.iItem, 2, (WCHAR*)message);
	if (!ListView_IsItemVisible(item, 0))
	{
		ListView_Scroll(item, 0, 16);
	}
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:51,代码来源:DialogAbout.cpp


示例4: assert

// Constructor for motion training sample (includes motion history image)
TrainingSample::TrainingSample(IplImage* srcImage, IplImage* motionHist, HWND lc, HIMAGELIST il, Rect bounds, int groupId) {
	// this constructor should only be called for motion sample type
	assert(groupId == GROUPID_MOTIONSAMPLES);

	hwndListControl = lc;
    hImageList = il;
    iGroupId = groupId;
	iOrigId = groupId;
	selectBounds = bounds;
    motionTrack.clear();

    fullImageCopy = cvCreateImage(cvSize(bounds.Width,bounds.Height),IPL_DEPTH_8U, 3); 
    motionHistory = cvCreateImage(cvSize(motionHist->width,motionHist->height),IPL_DEPTH_32F, 1);
	resizedImage = cvCreateImage(cvSize(LISTVIEW_SAMPLE_X,LISTVIEW_SAMPLE_Y),IPL_DEPTH_8U, 3); 
    bmpImage = new Bitmap(LISTVIEW_SAMPLE_X, LISTVIEW_SAMPLE_Y, PixelFormat24bppRGB);

    cvSetImageROI(srcImage, cvRect( bounds.X, bounds.Y, bounds.Width, bounds.Height));
    cvCopyImage(srcImage, fullImageCopy);

    if (srcImage->width >= LISTVIEW_SAMPLE_X && srcImage->height >= LISTVIEW_SAMPLE_Y) {
        cvResize(srcImage, resizedImage, CV_INTER_AREA);
    } else { 
        cvResize(srcImage, resizedImage, CV_INTER_LINEAR);
    }
    cvResetImageROI(srcImage);

	// copy entire frame motion history image (motion history analysis doesn't work as well on partial frame)
	cvCopyImage(motionHist, motionHistory);

    IplToBitmap(resizedImage, bmpImage);
    bmpImage->GetHBITMAP(NULL, &hbmImage);

    // Add image to imagelist
    int imgIndex = ImageList_Add(hImageList, hbmImage, NULL);

    // Add item to list view
    lvi.mask = LVIF_IMAGE | LVIF_STATE | LVIF_GROUPID;
    lvi.state = 0;
    lvi.stateMask = 0;
    lvi.iGroupId = groupId;
    lvi.iItem = imgIndex;
    lvi.iImage = imgIndex;
    lvi.iSubItem = 0;
    int newListItemPos = ListView_InsertItem(hwndListControl, &lvi);

    id = ListView_MapIndexToID(hwndListControl, newListItemPos);
}
开发者ID:gotomypc,项目名称:eyepatch,代码行数:48,代码来源:TrainingSample.cpp


示例5: AddToAlert

VOID AddToAlert(SYSTEMTIME rTime, unsigned char *buffer, int numbytes, char *col1, char *col2, char *col3, char *col4, char *col5, char *col6)
{
	int				position;
	LV_ITEM			lvI;
	char			str[64];
	struct packet	*pkt;


	++count;
	bytes_used += numbytes;
	wsprintf(str, "%d packets / %d bytes decoded", count, bytes_used);
	SendMessage(hWndStatus, SB_SETTEXT, (WPARAM) 2, (LPARAM) str);

	wsprintf(str, "%.2d:%.2d:%.2d:%.3d", rTime.wHour, rTime.wMinute, rTime.wSecond, rTime.wMilliseconds);

	lvI.mask = LVIF_TEXT | LVIF_PARAM;
	position = ListView_GetItemCount(hWndAlertList);

	lvI.iItem = position;
	lvI.iSubItem = 0;
	lvI.pszText = str; 
	lvI.cchTextMax = 64;

	pkt = malloc(sizeof(struct packet));
	pkt->size = numbytes;
	pkt->data = malloc(numbytes);
	memcpy(pkt->data, buffer, numbytes);
	pkt->time = rTime;
	lvI.lParam = (LPARAM)pkt;

	position = ListView_InsertItem(hWndAlertList, &lvI);
	ListView_SetItemText( hWndAlertList, position, 1, col1);
	ListView_SetItemText( hWndAlertList, position, 2, col2);
	ListView_SetItemText( hWndAlertList, position, 3, col3);
	ListView_SetItemText( hWndAlertList, position, 4, col4);
	ListView_SetItemText( hWndAlertList, position, 5, col5);
	ListView_SetItemText( hWndAlertList, position, 6, col6);
	ListView_EnsureVisible(hWndAlertList, position, FALSE);

	
	if (count > 65000)
	{
		g_bShutdown = TRUE;
		//MessageBox(hWndMain, "Maximum packet count reached. Capture stopped.", APP_NAME, MB_OK | MB_ICONEXCLAMATION);
	}
	return;
}
开发者ID:codercold,项目名称:networkspy,代码行数:47,代码来源:PktRecv.c


示例6: GetDlgItem

void CSetPgDebug::debugLogCommand(LogCommandsData* apData)
{
	if (!apData)
		return;

	/*
		struct LogCommandsData
		{
			BOOL  bInput, bMainThread;
			DWORD nTick, nDur, nCmd, nSize, nPID;
			wchar_t szPipe[64];
		};
	*/

	wchar_t szText[128];
	HWND hList = GetDlgItem(mh_Dlg, lbActivityLog);

	wcscpy_c(szText, apData->bInput ? L"In" : L"Out");

	LVITEM lvi = {LVIF_TEXT|LVIF_STATE};
	lvi.state = lvi.stateMask = LVIS_SELECTED|LVIS_FOCUSED;
	lvi.pszText = szText;
	int nItem = ListView_InsertItem(hList, &lvi);

	int nMin = apData->nTick / 60000; apData->nTick -= nMin*60000;
	int nSec = apData->nTick / 1000;
	int nMS = apData->nTick % 1000;
	_wsprintf(szText, SKIPLEN(countof(szText)) L"%02i:%02i:%03i", nMin, nSec, nMS);
	ListView_SetItemText(hList, nItem, lcc_Time, szText);

	_wsprintf(szText, SKIPLEN(countof(szText)) apData->bInput ? L"" : L"%u", apData->nDur);
	ListView_SetItemText(hList, nItem, lcc_Duration, szText);

	_wsprintf(szText, SKIPLEN(countof(szText)) L"%u", apData->nCmd);
	ListView_SetItemText(hList, nItem, lcc_Command, szText);

	_wsprintf(szText, SKIPLEN(countof(szText)) L"%u", apData->nSize);
	ListView_SetItemText(hList, nItem, lcc_Size, szText);

	_wsprintf(szText, SKIPLEN(countof(szText)) apData->nPID ? L"%u" : L"", apData->nPID);
	ListView_SetItemText(hList, nItem, lcc_PID, szText);

	ListView_SetItemText(hList, nItem, lcc_Pipe, apData->szPipe);

	free(apData);
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:46,代码来源:SetPgDebug.cpp


示例7: PhAddListViewItem

INT PhAddListViewItem(
    _In_ HWND ListViewHandle,
    _In_ INT Index,
    _In_ PWSTR Text,
    _In_opt_ PVOID Param
    )
{
    LVITEM item;

    item.mask = LVIF_TEXT | LVIF_PARAM;
    item.iItem = Index;
    item.iSubItem = 0;
    item.pszText = Text;
    item.lParam = (LPARAM)Param;

    return ListView_InsertItem(ListViewHandle, &item);
}
开发者ID:lei720,项目名称:processhacker2,代码行数:17,代码来源:guisup.c


示例8: AddItem

void AddItem(DWORD dwNum, struct entry_wav *sWav)
{
    LVITEM lv = {0};
    BYTE bSize[MAX_PATH];
    BYTE bOffset[MAX_PATH];
    BYTE bName[40];

    lv.iItem = 0;
    ListView_InsertItem(hListView, &lv);
    memcpy(bName, sWav->bName, 40);
    FixWavNameFile(bName);
    ListView_SetItemText(hListView, 0, 0, bName);
    sprintf(bOffset, "0x%X", sWav->dwOffset);
    ListView_SetItemText(hListView, 0, 1, bOffset);
    sprintf(bSize, "%d", sWav->dwSize);
    ListView_SetItemText(hListView, 0, 2, bSize);
}
开发者ID:w4kfu,项目名称:homm3_fun,代码行数:17,代码来源:main.c


示例9: UpdateUsersList

static VOID
UpdateUsersList(HWND hwndListView)
{
    NET_API_STATUS netStatus;
    PUSER_INFO_20 pBuffer;
    DWORD entriesread;
    DWORD totalentries;
    DWORD resume_handle = 0;
    DWORD i;
    LV_ITEM lvi;
    INT iItem;


    for (;;)
    {
        netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT,
                                (LPBYTE*)&pBuffer,
                                1024, &entriesread,
                                &totalentries, &resume_handle);
        if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
            break;

        for (i = 0; i < entriesread; i++)
        {
           memset(&lvi, 0x00, sizeof(lvi));
           lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
           lvi.pszText = pBuffer[i].usri20_name;
           lvi.state = 0;
           lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
           iItem = ListView_InsertItem(hwndListView, &lvi);

           ListView_SetItemText(hwndListView, iItem, 1,
                                pBuffer[i].usri20_full_name);

           ListView_SetItemText(hwndListView, iItem, 2,
                                pBuffer[i].usri20_comment);
        }

        NetApiBufferFree(pBuffer);

        /* No more data left */
        if (netStatus != ERROR_MORE_DATA)
            break;
    }

}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:46,代码来源:users.c


示例10: insertColumn

void VerticalFileSwitcherListView::initList()
{
    TaskListInfo taskListInfo;
    static HWND nppHwnd = ::GetParent(_hParent);
    ::SendMessage(nppHwnd, WM_GETTASKLISTINFO, (WPARAM)&taskListInfo, TRUE);

    NppParameters *nppParams = NppParameters::getInstance();
    NativeLangSpeaker *pNativeSpeaker = nppParams->getNativeLangSpeaker();
    generic_string nameStr = pNativeSpeaker->getAttrNameStr(TEXT("Name"), FS_ROOTNODE, FS_CLMNNAME);
    insertColumn(nameStr.c_str(), 150, 0);

    bool isExtColumn = !nppParams->getNppGUI()._fileSwitcherWithoutExtColumn;
    if (isExtColumn)
    {
        generic_string extStr = pNativeSpeaker->getAttrNameStr(TEXT("Ext."), FS_ROOTNODE, FS_CLMNEXT);
        insertColumn(extStr.c_str(), 50, 1);
    }

    for (size_t i = 0, len = taskListInfo._tlfsLst.size(); i < len ; ++i)
    {
        TaskLstFnStatus & fileNameStatus = taskListInfo._tlfsLst[i];

        TaskLstFnStatus *tl = new TaskLstFnStatus(fileNameStatus._iView, fileNameStatus._docIndex, fileNameStatus._fn, fileNameStatus._status, (void *)fileNameStatus._bufID);

        TCHAR fn[MAX_PATH];
        lstrcpy(fn, ::PathFindFileName(fileNameStatus._fn.c_str()));

        if (isExtColumn)
        {
            ::PathRemoveExtension(fn);
        }
        LVITEM item;
        item.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;

        item.pszText = fn;
        item.iItem = i;
        item.iSubItem = 0;
        item.iImage = fileNameStatus._status;
        item.lParam = (LPARAM)tl;
        ListView_InsertItem(_hSelf, &item);
        if (isExtColumn)
        {
            ListView_SetItemText(_hSelf, i, 1, (LPTSTR)::PathFindExtension(fileNameStatus._fn.c_str()));
        }
    }
}
开发者ID:Wagnerp,项目名称:notplusplus,代码行数:46,代码来源:VerticalFileSwitcherListView.cpp


示例11: DetailPrint

/*
 * Displays a message in NSIS details window, roughly the same as NSIS' DetailPrint
 */
void DetailPrint(const TCHAR *pStr)  /* LogMessage() */
{
	if (!g_hwndList) return;
	if (!lstrlen(pStr)) return;

	{
		LVITEM item={0};
		int nItemCount=SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
		item.mask=LVIF_TEXT;
		item.pszText=(TCHAR *)pStr;
		item.cchTextMax=0;  /* =6 */
		item.iItem=nItemCount;
		/* SendMessage(g_hwndList, LVM_INSERTITEM, 0, (LPARAM)&item); */
		ListView_InsertItem(g_hwndList, &item);
		ListView_EnsureVisible(g_hwndList, item.iItem, 0);
	}
}
开发者ID:tpn,项目名称:nsis-untgz,代码行数:20,代码来源:nsisUtils.c


示例12: AddDatabaseToList

static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir)
{
	LV_ITEM lvi;
	lvi.mask = LVIF_PARAM;
	lvi.iSubItem = 0;
	for (lvi.iItem = ListView_GetItemCount(hwndList) - 1; lvi.iItem >= 0; lvi.iItem--) {
		ListView_GetItem(hwndList, &lvi);
		if (!_tcsicmp((TCHAR*)lvi.lParam, filename))
			return lvi.iItem;
	}

	_stat st;
	if (_tstat(filename, &st) == -1)
		return -1;

	DWORD totalSize = st.st_size;

	bool isBroken = CheckBroken(filename);

	const TCHAR *pName = _tcsrchr(filename, '\\');
	if (pName == NULL)
		pName = (LPTSTR)filename;
	else
		pName++;

	TCHAR szName[MAX_PATH];
	mir_sntprintf(szName, MAX_PATH, _T("%s%s"), dir, pName);

	TCHAR *pDot = _tcsrchr(szName, '.');
	if (pDot != NULL && !_tcsicmp(pDot, _T(".dat")))
		*pDot = 0;

	lvi.iItem = 0;
	lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
	lvi.iSubItem = 0;
	lvi.lParam = (LPARAM)_tcsdup(filename);
	lvi.pszText = szName;
	lvi.iImage = (isBroken) ? 1 : 0;

	int iNewItem = ListView_InsertItem(hwndList, &lvi);
	TCHAR szSize[20];
	mir_sntprintf(szSize, SIZEOF(szSize), _T("%.2lf MB"), totalSize / 1048576.0);
	ListView_SetItemText(hwndList, iNewItem, 1, szSize);
	return iNewItem;
}
开发者ID:fatty-,项目名称:miranda-ng,代码行数:45,代码来源:selectdb.cpp


示例13: OnNewVariable

static VOID
OnNewVariable(HWND hwndDlg,
              INT iDlgItem)
{
    HWND hwndListView;
    PVARIABLE_DATA VarData;
    LV_ITEM lvi;
    INT iItem;

    hwndListView = GetDlgItem(hwndDlg, iDlgItem);

    VarData = GlobalAlloc(GPTR, sizeof(VARIABLE_DATA));

    if (DialogBoxParam(hApplet,
                       MAKEINTRESOURCE(IDD_EDIT_VARIABLE),
                       hwndDlg,
                       EditVariableDlgProc,
                       (LPARAM)VarData) <= 0)
    {
        if (VarData->lpName != NULL)
            GlobalFree(VarData->lpName);

        if (VarData->lpRawValue != NULL)
            GlobalFree(VarData->lpRawValue);

        if (VarData->lpCookedValue != NULL)
            GlobalFree(VarData->lpCookedValue);

        GlobalFree(VarData);
    }
    else
    {
        if (VarData->lpName != NULL && (VarData->lpCookedValue || VarData->lpRawValue))
        {
            memset(&lvi, 0x00, sizeof(lvi));
            lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
            lvi.lParam = (LPARAM)VarData;
            lvi.pszText = VarData->lpName;
            lvi.state = 0;
            iItem = ListView_InsertItem(hwndListView, &lvi);

            ListView_SetItemText(hwndListView, iItem, 1, VarData->lpCookedValue);
        }
    }
}
开发者ID:reactos,项目名称:reactos,代码行数:45,代码来源:environment.c


示例14: append_debug_item

static void append_debug_item(const char *timestamp, const char *level,
                              const char *category, const char *file,
                              const char *line, const char *function,
                              const char *message) {
	SCROLLINFO si;
	LVITEM lvi;

	si.cbSize = sizeof(si);
	si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;

	GetScrollInfo(_debug_list_view, SB_VERT, &si);

	lvi.mask = LVIF_TEXT;

	lvi.iItem = ListView_GetItemCount(_debug_list_view);
	lvi.iSubItem = 0;
	lvi.pszText = (char *)timestamp;
	ListView_InsertItem(_debug_list_view, &lvi);

	lvi.iSubItem = 1;
	lvi.pszText = (char *)level;
	ListView_SetItem(_debug_list_view, &lvi);

	lvi.iSubItem = 2;
	lvi.pszText = (char *)category;
	ListView_SetItem(_debug_list_view, &lvi);

	lvi.iSubItem = 3;
	lvi.pszText = (char *)(*file != '\0' ? file : function);
	ListView_SetItem(_debug_list_view, &lvi);

	lvi.iSubItem = 4;
	lvi.pszText = (char *)line;
	ListView_SetItem(_debug_list_view, &lvi);

	lvi.iSubItem = 5;
	lvi.pszText = (char *)message;
	ListView_SetItem(_debug_list_view, &lvi);

	if (si.nPos >= si.nMax - (int)si.nPage) {
		ListView_EnsureVisible(_debug_list_view, lvi.iItem, FALSE);
	}

	update_status_bar_message_count();
}
开发者ID:Loremipsum1988,项目名称:brickd,代码行数:45,代码来源:logviewer.c


示例15: mm_add_mod_item

void mm_add_mod_item(mm_mod_item* modItem)
{
    mm_mod_item_list[freeModSlot] = modItem;

    // add it to the list
    LVITEM listviewItem = { 0 };
    listviewItem.iItem = freeModSlot;

    ListView_InsertItem(mm_mod_list, &listviewItem);

    // toggle the checkbox if the mod has been installed
    listviewItem = { 0 };
    listviewItem.mask = LVIF_STATE;
    listviewItem.state = modItem->enabled ? 0x2000 : 0x1000; // Cosmic magic constants from hell
    listviewItem.stateMask = 0xF000;
    listviewItem.iItem = freeModSlot;
    listviewItem.iSubItem = MOD_LIST_COLUMN_ENABLED;

    ListView_SetItem(mm_mod_list, &listviewItem);

    // set the name
    listviewItem = { 0 };
    listviewItem.mask = LVIF_TEXT;
    listviewItem.pszText = modItem->mod_name;
    listviewItem.iItem = freeModSlot;
    listviewItem.iSubItem = MOD_LIST_COLUMN_NAME;

    ListView_SetItem(mm_mod_list, &listviewItem);

    // set the size
    listviewItem = { 0 };
    listviewItem.mask = LVIF_TEXT;

    char fileSize[128] = { 0 };
    sprintf(fileSize, "%0.2fMB", ((float)modItem->file_size / 1000000));
    listviewItem.pszText = fileSize;

    listviewItem.iItem = freeModSlot;
    listviewItem.iSubItem = MOD_LIST_COLUMN_FILE_SIZE;

    ListView_SetItem(mm_mod_list, &listviewItem);

    // update the free mod slot
    freeModSlot++;
}
开发者ID:Forceh91,项目名称:MadnightMM,代码行数:45,代码来源:mm_mod_list.cpp


示例16: ListView_InsertItem

int CListView::InsertItem(int Index,LPCTSTR pszText,LPARAM Param)
{
	if (m_hwnd==nullptr)
		return -1;

	if (Index<0)
		Index=GetItemCount();

	LVITEM lvi;

	lvi.mask=LVIF_TEXT | LVIF_PARAM;
	lvi.iItem=Index;
	lvi.iSubItem=0;
	lvi.pszText=const_cast<LPTSTR>(pszText);
	lvi.lParam=Param;

	return ListView_InsertItem(m_hwnd,&lvi);
}
开发者ID:nexus7ici,项目名称:TSTask,代码行数:18,代码来源:ListView.cpp


示例17: PopulateItem

static void PopulateItem(HWND hwnd, STRINGS *strings, int items)
{
    LV_ITEM item;
    static char id[256];
    id[0] = 0;
    FormatExp(id, strings->id);
    memset(&item, 0, sizeof(LV_ITEM));
    item.iItem = items;
    item.iSubItem = 0;
    item.mask = LVIF_PARAM | LVIF_TEXT;
    item.lParam = (LPARAM)strings;
    item.pszText = id;
    ListView_InsertItem(hwnd, &item);
    item.iSubItem = 1;
    item.mask = LVIF_PARAM;
    item.lParam = (LPARAM)strings;
    ListView_SetItem(hwnd, &item);
}
开发者ID:jossk,项目名称:OrangeC,代码行数:18,代码来源:drawstrings.c


示例18: ASSERT

// InsertItem ---------------------------------------------------------------
int CCodeListCtrl::InsertItem( int iIndex, LPCTSTR lpszItem, int iImage,
                        LPARAM lParam )
{
   ASSERT( ::IsWindow( m_hWnd ) );

   LVITEM lvi = {0};

   if( -1 == iIndex )
      iIndex = GetItemCount() + 1;

   lvi.iItem = iIndex;
   lvi.iImage = iImage;
   lvi.lParam = lParam;
   lvi.pszText = (LPTSTR)lpszItem;
   lvi.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT;

   return ListView_InsertItem( m_hWnd, &lvi );
}
开发者ID:DeegC,项目名称:ZeidonTools,代码行数:19,代码来源:codelistctrl.cpp


示例19: InitServerListData

bool ServerPingSettings::InitServerListData(HWND hwndServerList)
{
	LVITEM lvi;

    lvi.pszText   = LPSTR_TEXTCALLBACK;
    lvi.mask      = LVIF_TEXT | LVIF_STATE;
    lvi.stateMask = 0;
    lvi.iSubItem  = 0;
    lvi.state     = 0;
	
	for(UINT i = 0; i < pingers->Num(); i++) {
		lvi.iItem = i;
		if (ListView_InsertItem(hwndServerList, &lvi) == -1) {
			return false;
		}
	}
	return true;
}
开发者ID:highattack30,项目名称:ServerPingPlugin,代码行数:18,代码来源:ServerPingSettings.cpp


示例20: InsertAllDeviceMapList

static void InsertAllDeviceMapList(HWND hList)
{
    _TCHAR buffer[64];
    std::map<Range, class CDevice *>::iterator scope;
    LVITEM item;
    int index;
	int length = 0;

    ListView_DeleteAllItems(hList);
    item.iItem = -1;

    EnterCriticalSection(&_Module.cs);

    scope = _Module.DeviceMap.begin();
    while(scope != _Module.DeviceMap.end()) {
		_TCHAR * strbuf = (_TCHAR *)(BSTR)scope->second->DeviceName;

#ifndef _UNICODE
		length = WideCharToMultiByte(CP_ACP, 0, (BSTR)scope->second->DeviceName, -1, 0, 0, NULL, NULL);
		if(length != 0) {
			strbuf = new _TCHAR [length + 1];
			WideCharToMultiByte(CP_ACP, 0, (BSTR)scope->second->DeviceName, length, (char *)strbuf, length, NULL, NULL);
		}
		else
			strbuf = _T("<unknown>");
#endif

        item.mask = LVIF_TEXT;
        ++ item.iItem;
        item.iSubItem = 0;
        item.pszText = strbuf;
        index = ListView_InsertItem(hList, &item);

		if(length != 0)
			delete [] strbuf;

        wsprintf(buffer, _T("0x%08X -- 0x%08X"), scope->first.GetBase(), scope->first.GetBase() + scope->first.GetLength() - 1);
        ListView_SetItemText(hList, index, 1, buffer);

        ++ scope;
    }

    LeaveCriticalSection(&_Module.cs);
}
开发者ID:qreal,项目名称:nxt-tools,代码行数:44,代码来源:devicemanager.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ListView_SetCheckState函数代码示例发布时间:2022-05-30
下一篇:
C++ ListView_InsertColumn函数代码示例发布时间: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