コード例 #1
0
ファイル: main.c プロジェクト: phplugins/plugins-extra
static VOID LoadAtomTable(VOID)
{
    PATOM_TABLE_INFORMATION atomTable = NULL;

    ListView_DeleteAllItems(ListViewWndHandle);

    if (!NT_SUCCESS(PhEnumAtomTable(&atomTable)))
        return;

    for (ULONG i = 0; i < atomTable->NumberOfAtoms; i++)
    {
        PATOM_BASIC_INFORMATION atomInfo = NULL;

        if (!NT_SUCCESS(PhQueryAtomTableEntry(atomTable->Atoms[i], &atomInfo)))
        {
            PhAddListViewItem(ListViewWndHandle, MAXINT, PhaFormatString(L"(Error) #%lu", i)->Buffer, NULL);
            continue;
        }

        if ((atomInfo->Flags & RTL_ATOM_PINNED) == RTL_ATOM_PINNED)
        {
            INT index = PhAddListViewItem(
                ListViewWndHandle,
                MAXINT,
                PhaFormatString(L"%s (Pinned)", atomInfo->Name)->Buffer,
                NULL
                );
            PhSetListViewSubItem(
                ListViewWndHandle,
                index,
                1,
                PhaFormatString(L"%u", atomInfo->UsageCount)->Buffer
                );
        }
        else
        {
            INT index = PhAddListViewItem(
                ListViewWndHandle,
                MAXINT,
                atomInfo->Name,
                NULL
                );
            PhSetListViewSubItem(
                ListViewWndHandle,
                index,
                1,
                PhaFormatString(L"%u", atomInfo->UsageCount)->Buffer
                );
        }

        PhFree(atomInfo);
    }

    PhFree(atomTable);
}
コード例 #2
0
void COutputDialog::UpdateFilterGrid()
{

	CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
	CWnd* pFilterOpt = GetDlgItem(IDC_EDIT_FILTER_OPTION_STRING);
	CWnd* pFilterStatic = GetDlgItem(IDC_STATIC_FILTER_1);
	if(NULL == pList || NULL == pFilterOpt || NULL == pFilterStatic) return;

	// 등록 리스트 가져와서
	ATPLUGIN_ARGUMENT_ARRAY aPluginArgs;
	(MAINAPP)->m_cMultiPlugin.GetPluginArgs(aPluginArgs);

	// 리스트뷰 전체 삭제
	ListView_DeleteAllItems(pList->m_hWnd);

	// 재등록
	TCHAR szBuffer[1024];
	LVITEM lvItem;
	ZeroMemory(&lvItem, sizeof(lvItem));
	lvItem.mask=LVIF_TEXT;
	lvItem.pszText=szBuffer;
	CString strFilterOpt = _T("");
	for(size_t i=0; i< aPluginArgs.size(); i++)
	{
		lvItem.iItem=i;
		lvItem.iSubItem=0;
		lstrcpyn(szBuffer, aPluginArgs[i].strPluginName.c_str(), 1024);
		ListView_InsertItem(pList->m_hWnd, &lvItem);

		lstrcpyn(szBuffer, aPluginArgs[i].strOption.c_str(), 4096);
		ListView_SetItemText(pList->m_hWnd, i, 1, szBuffer);

		if(strFilterOpt.IsEmpty())
		{
			strFilterOpt = CString(_T("/f:")) + aPluginArgs[i].strPluginName.c_str()
						 + _T("{") + aPluginArgs[i].strOption.c_str() + _T("}");
		}
		else
		{
			strFilterOpt += CString(_T(",")) + aPluginArgs[i].strPluginName.c_str()
				+ _T("{") + aPluginArgs[i].strOption.c_str() + _T("}");
		}
	}

	::EnableWindow(pList->m_hWnd, TRUE);

	pFilterOpt->SetWindowText(strFilterOpt);
	BOOL bEnable = strFilterOpt.IsEmpty() ? FALSE : TRUE;
	::EnableWindow(pFilterOpt->m_hWnd, bEnable);
	::EnableWindow(pFilterStatic->m_hWnd, bEnable);		

	OnNMClickListFilter(NULL, NULL);

	return;
}
コード例 #3
0
ファイル: jabber_treelist.cpp プロジェクト: martok/miranda-ng
void TreeList_ResetItem(HWND hwnd, HTREELISTITEM hParent)
{
	TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);

	for (int i = hParent->subItems.getCount(); i--;)
		delete hParent->subItems[i];
	hParent->subItems.destroy();

	data->hItemSelected = hParent;
	ListView_DeleteAllItems(hwnd);
}
コード例 #4
0
void ListView::resetValues(int codepage)
{
	if (codepage == -1)
		codepage = 0;

	if (_codepage == codepage)
		return;

	ListView_DeleteAllItems(_hSelf);
	setValues(codepage);
}
コード例 #5
0
	// This method deletes all items from the listview
	void DeleteAllItems()
	{
		CItemData *pid;
		
		for (int i = 0; i < _numRows; i++) {
			pid = ItemData(i);
			if (pid)
				delete pid;
		}
		ListView_DeleteAllItems(_hList);
		_numRows = 0;
	}
コード例 #6
0
/*
================
rvOpenFileDialog::UpdateFileList

Updates the file list with the files that match the filter in the current
look in directory
================
*/
void rvOpenFileDialog::UpdateFileList ( void )
{
	const char *basepath = mLookin;
	idFileList *files;
	HWND		list = GetDlgItem ( mWnd, IDC_TOOLS_FILELIST );
	int			i;
	int			filter;
		
	ListView_DeleteAllItems ( list );
	
	// Add all the folders first
	files = fileSystem->ListFiles ( basepath, "/", true );
	for ( i = 0; i < files->GetNumFiles(); i ++ )
	{
		if ( files->GetFile( i )[0] == '.' )
		{
			continue;
		}
	
		LVITEM item;
		memset(&item,0,sizeof(item));
		item.mask = LVIF_TEXT;
		item.iItem = ListView_GetItemCount ( list );
		item.pszText = (LPSTR)files->GetFile( i );
		item.iSubItem = 0;
		ListView_InsertItem ( list, &item );
	}
	fileSystem->FreeFileList( files );
	
	// Add all the files in the current lookin directory that match the
	// current filters.
	for ( filter = 0; filter < mFilters.Num(); filter ++ )
	{	
		files = fileSystem->ListFiles( basepath, mFilters[filter], true );
		for ( i = 0; i < files->GetNumFiles(); i ++ )
		{
			if ( files->GetFile( i )[0] == '.' )
			{
				continue;
			}
	
			LVITEM item;
			memset(&item,0,sizeof(item));
			item.mask = LVIF_TEXT|LVIF_IMAGE;
			item.iImage = 2;
			item.iItem = ListView_GetItemCount( list );
			item.pszText = (LPSTR)files->GetFile( i );
			item.iSubItem = 0;
			ListView_InsertItem ( list, &item );
		}
		fileSystem->FreeFileList( files );
	}
}
コード例 #7
0
void AudioGroupFilePresenter::populateGroupColumn(VSTEditor& editor, int collectionIdx, int fileIdx) {
  LVITEM item = {};
  item.mask = LVIF_TEXT;

  ListView_DeleteAllItems(editor.m_groupListView);
  ListView_DeleteAllItems(editor.m_pageListView);
  if (collectionIdx < m_iteratorVec.size()) {
    CollectionIterator& it = m_iteratorVec[collectionIdx];
    if (fileIdx < it->second->m_iteratorVec.size()) {
      size_t idx = 0;
      AudioGroupCollection::GroupIterator& git = it->second->m_iteratorVec[fileIdx];
      for (AudioGroupDataCollection::GroupToken& gtok : git->second->m_groupTokens) {
        wchar_t name[256];
        wnsprintf(name, 256, L"%d (%s)", gtok.m_groupId, gtok.m_song ? L"Song" : L"SFX");
        item.pszText = name;
        item.iItem = idx++;
        ListView_InsertItem(editor.m_groupListView, &item);
      }
    }
  }
}
コード例 #8
0
//------------------------------------------------------------------------------
void InitDlgRegfile()
{
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_NTUSER),"");
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SAM),"");
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SECURITY),"");
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SOFTWARE),"");
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_SYSTEM),"");
  SetWindowText(GetDlgItem(h_reg_file,DLG_REG_ED_OTHER),"");

  TreeView_DeleteAllItems(GetDlgItem(h_reg,TV_VIEW));
  ListView_DeleteAllItems(GetDlgItem(h_reg,LV_VIEW));
}
コード例 #9
0
ファイル: StopWatch.c プロジェクト: heicks/T-Clock
void StopWatch_Start(HWND hDlg){
	if(m_start.QuadPart){
		KillTimer(hDlg, 1);
	}
	ListView_DeleteAllItems(GetDlgItem(hDlg,IDC_SW_LAPS));
	QueryPerformanceCounter(&m_start);
	m_lap = m_start;
	m_paused = 0;
	SetTimer(hDlg, 1, 7, NULL);
	SetDlgItemText(hDlg, IDC_SW_START, L"Stop (s)");
	EnableDlgItem(hDlg, IDC_SW_RESET, 1);
}
コード例 #10
0
ファイル: StopWatch.c プロジェクト: heicks/T-Clock
void StopWatch_Reset(HWND hDlg){
	if(!m_start.QuadPart)
		return;
	SetDlgItemText(hDlg, IDC_SW_ELAPSED, TIMETEXT_DEFAULT);
	ListView_DeleteAllItems(GetDlgItem(hDlg,IDC_SW_LAPS));
	if(m_paused){ // paused
		m_start.QuadPart=0;
		EnableDlgItemSafeFocus(hDlg,IDC_SW_RESET,0,IDC_SW_START);
	}else{ // running
		QueryPerformanceCounter(&m_start);
		m_lap=m_start;
	}
}
コード例 #11
0
/*
================
rvGENavigator::Update

Updates the contents of the navigator window from the current workspace
================
*/
void rvGENavigator::Update( void ) {
	// Clear the list first
	ListView_DeleteAllItems( mTree );
	// Add starting with the desktop window
	if( mWorkspace ) {
		AddWindow( mWorkspace->GetInterface( )->GetDesktop( ) );
	}
	// For some reason the horizontal scrollbar wants to show up initially after an update
	// so this forces it not to
	RECT rClient;
	GetClientRect( mTree, &rClient );
	ListView_SetColumnWidth( mTree, 0, rClient.right - rClient.left - 1 );
}
コード例 #12
0
ファイル: LangBuilderGUI.cpp プロジェクト: rauls/iReporter
void InitLangList()
{
	char colTitles[LANG_LINE_SIZE];
	char *catStr;
	char lineStr[LANG_LINE_SIZE];
	short i;
	short category = -1;
	changedSomeStrings = 0;
	alreadySaving = 0;

	// If we have already displayed (created) the list,
	// then week need to delete the column headings... this seems to do it...
	if ( hWndLangBuilderListView )
	{
		ListView_DeleteColumn( hWndLangBuilderListView, EDIT_LANGUAGE_LISTVIEW_POS );
		ListView_DeleteColumn( hWndLangBuilderListView, DEFAULT_ENGLISH_LISTVIEW_POS );
		ListView_DeleteColumn( hWndLangBuilderListView, CATEGORY_NAME_LISTVIEW_POS );
	}
	
	// Initialise the Language list, means creating the column titles and adding them,
	// then making sure there is no data in the list
	mystrncpyNull( colTitles, ReturnString( IDS_LANGBUILDER_LISTTITLES ), LANG_LINE_SIZE );
	mystrncatNull( colTitles, MyPrefStruct.language, LANG_LINE_SIZE );
	hWndLangBuilderListView = InitGenericListView( hDlg, IDC_LANGTOKEN_LIST, 0, 0, colTitles );
	ListView_DeleteAllItems( hWndLangBuilderListView );		

	ListView_SetColumnWidth( hWndLangBuilderListView, CATEGORY_NAME_LISTVIEW_POS, 100 );
	ListView_SetColumnWidth( hWndLangBuilderListView, DEFAULT_ENGLISH_LISTVIEW_POS, 200 );
	ListView_SetColumnWidth( hWndLangBuilderListView, EDIT_LANGUAGE_LISTVIEW_POS, 200 );

	// Add the Language strings to the list
	for ( i = SUMM_BEGIN; i < END_OF_STRINGS; i++ )
	{
		catStr = GetLangSectionName(i);
		if ( !catStr )
			continue;
		mystrncpyNull( lineStr, catStr, LANG_LINE_SIZE ); 
		mystrncatNull( lineStr, LANG_LIST_SEP, LANG_LINE_SIZE ); 
		mystrncatNull( lineStr, DefaultEnglishStr(i), LANG_LINE_SIZE ); 
		mystrncatNull( lineStr, LANG_LIST_SEP, LANG_LINE_SIZE ); 
		mystrncatNull( lineStr, TranslateID(i), LANG_LINE_SIZE ); 
		AddItemToListView( hWndLangBuilderListView, ListView_GetItemCount(hWndLangBuilderListView), 3, lineStr, LANG_LIST_SEP );
	}
	ListView_GetItemText( hWndLangBuilderListView, 0, EDIT_LANGUAGE_LISTVIEW_POS, lineStr, LANG_LINE_SIZE );
	SetWindowText( GetDlgItem( hDlg, IDC_LANGTOKEN_TEXT), lineStr );
	SetFocus( GetDlgItem( hDlg, IDC_LANGTOKEN_LIST ) );
	int state = LVIS_SELECTED|LVIS_FOCUSED;
	if ( hWndLangBuilderListView )
		ListView_SetItemState( hWndLangBuilderListView, 0, state, state );
}
コード例 #13
0
ファイル: SongList.cpp プロジェクト: hihua/hihuacode
void SongListClear()
{
	PLAYERINFO* next = first;
	while (next != NULL)
	{
		PLAYERINFO* current = next;
		next = next->next;
		PlayInfoRelease(current, TRUE);
	}
		
	ListView_DeleteAllItems(songlist.hWnd);
	first = NULL;
	last = NULL;
}
コード例 #14
0
bool NGMainWnd::onnet_disconnect(void) {
	EnableMenuItem(GetSubMenu(this->hmenu, 0), IDM_CONNECT, MF_BYCOMMAND | MF_ENABLED);
	EnableMenuItem(GetSubMenu(this->hmenu, 0), IDM_DISCONNECT, MF_BYCOMMAND | MF_GRAYED);
	EnableMenuItem(this->hmenu, 1, MF_BYPOSITION | MF_GRAYED);
	EnableMenuItem(this->hmenu, 2, MF_BYPOSITION | MF_GRAYED);
	DrawMenuBar(this->hwnd);

	ListView_DeleteAllItems(this->hplwnd);
	ListView_DeleteAllItems(this->hfilewnd);
	TreeView_DeleteAllItems(this->hbrowsewnd);

	this->playlist.clear();
	this->playlist_pos = -1;
	this->playlist_size = 0;
	this->browsenodes.clear();
	this->browseindex = -1;
	if (this->dragndrop != NULL) {
		delete this->dragndrop;
		this->dragndrop = NULL;
	}
	this->toolbox_select(TOOLBOX_CONNECT);
	return true;
}
コード例 #15
0
ファイル: gui_bootpd.c プロジェクト: julchar/tftpd-64
// -------------------------------------
// ListView management
// --------------------------------------
void DhcpRefresh_ListView ( int nbLeases, struct S_Lease tLeases[] )
{
struct tm ltime;
int Ark;
char szDate[64];
LVITEM LvItem;
int itemPos;
HWND hListV;
HWND hWnd = hDbgMainWnd;

    memset (&LvItem, 0, sizeof LvItem);

   while (GetParent (hWnd)!=NULL)  hWnd=GetParent(hWnd);
   hListV = GetDlgItem (hWnd, IDC_LV_DHCP);
   
   ListView_DeleteAllItems (hListV);
   for (Ark = 0 ;   Ark < nbLeases  ;  Ark++ )
   {
  	  LvItem.mask = LVIF_PARAM | LVIF_STATE;
      LvItem.state = 0;
      LvItem.stateMask = 0;
      LvItem.iItem = Ark;      // numéro de l'item
      LvItem.iSubItem = 0;     // index dans la ligne
      LvItem.lParam = inet_addr (tLeases[Ark].szIP);  // keep track of assignation
	  itemPos = ListView_InsertItem(hListV,(LPARAM)&LvItem);

#ifdef _MSC_VER
            localtime_s (&ltime, & tLeases[Ark].tAllocated);
#else
            memcpy (& ltime, localtime (& tLeases[Ark].tAllocated), sizeof ltime);
#endif
	wsprintf (szDate, "%02d/%02d %02d:%02d:%02d", 
					  ltime.tm_mon+1, ltime.tm_mday,ltime.tm_hour, ltime.tm_min, ltime.tm_sec);	
	ListView_SetItemText (hListV, itemPos, 0, szDate);
	ListView_SetItemText (hListV, itemPos, 1, tLeases[Ark].szIP);
	ListView_SetItemText (hListV, itemPos, 2, tLeases[Ark].szMAC);
	
	if (tLeases[Ark].tRenewed != 0)
	{
#ifdef _MSC_VER
            localtime_s (&ltime, & tLeases[Ark].tRenewed);
#else
            memcpy (& ltime, localtime (& tLeases[Ark].tRenewed), sizeof ltime);
#endif
	     wsprintf (szDate, "%02d/%02d %02d:%02d:%02d", 
					  ltime.tm_mon+1, ltime.tm_mday,ltime.tm_hour, ltime.tm_min, ltime.tm_sec);	
	     ListView_SetItemText (hListV, itemPos, 3, szDate);
	 }	// renew ! =0	   
   } // parse all alocations
} // DhcpRefresh_ListView 
コード例 #16
0
ファイル: al_browse.cpp プロジェクト: maxendpoint/openafs_cvs
BOOL DlgProc_Browse_StartSearch (BROWSEDIALOGPARAMS *pbdp, BOOL fCloseDlgIfFail)
{
   DWORD dwThreadID;

   // Can't start a new search until the old search terminates.
   //
   DlgProc_Browse_StopSearch (pbdp);

   // Then make sure that we have a valid cell to query--if not, it may
   // be grounds to terminate the entire browse dialog.
   //
   lstrcpy (pbdp->szThreadCell, pbdp->szCell);

   if (!pbdp->szCell[0])
   {
      AfsAppLib_GetLocalCell (pbdp->szCell);

      lstrcpy (pbdp->szThreadCell, pbdp->szCell);

      DlgProc_Browse_UpdateCellText (pbdp, pbdp->szThreadCell);
   }

   if (!pbdp->szCell[0])
   {
      if (fCloseDlgIfFail)
         EndDialog (pbdp->hDlg, IDCANCEL);

      MessageBeep (MB_ICONHAND);
      Message (MB_ICONHAND, IDS_BROWSE_BADCELL_TITLE, IDS_BROWSE_BADCELL_DESC);

      if (!fCloseDlgIfFail)
         PostMessage (pbdp->hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (pbdp->hDlg, IDC_BROWSE_CELL), (LPARAM)TRUE);
      return FALSE;
   }

   // Great--we can do the search.  Start a thread to do so.
   //
   pbdp->fCanStopThreadEasily = FALSE;
   pbdp->fShouldStopThread = FALSE;
   pbdp->fThreadActive = FALSE;

   ListView_DeleteAllItems (GetDlgItem (pbdp->hDlg, IDC_BROWSE_LIST));

   pbdp->hThread = CreateThread (NULL, 0,
                                 (LPTHREAD_START_ROUTINE)DlgProc_Browse_ThreadProc,
                                 pbdp, 0, &dwThreadID);

   return (pbdp->hThread == 0) ? FALSE : TRUE;
}
コード例 #17
0
ファイル: DialogAbout.cpp プロジェクト: testaccountx/testrepo
/*
** 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);
		}
	}
}
コード例 #18
0
ファイル: Routines.cpp プロジェクト: DarthTon/SecureEraseWin
DWORD MainDlg::RefreshDiskList()
{
    std::vector<PhysicalDisk*> disks;
    PhysicalDisk::EnumDisks( disks );

    HWND hList = GetDlgItem( _hMainDlg, IDC_LIST_DISKS );

    ListView_DeleteAllItems( hList );

    for (auto& disk : disks)
    {
        auto& id_data = disk->id_data();
        LVITEMW lvi = { 0 };
        int idx = 0;
        
        lvi.mask = LVIF_TEXT | LVIF_PARAM;

        lvi.pszText = (LPWSTR)disk->path().c_str();
        lvi.cchTextMax = (int)disk->path().length() + 1;
        lvi.lParam = reinterpret_cast<LPARAM>(disk);

        int pos = ListView_InsertItem( hList, &lvi );

        LVITEMA lva = { 0 };
        for (idx = sizeof(id_data.ModelNumber) - 3; idx >= 0; idx--)
            if (id_data.ModelNumber[idx] != ' ')
                break;

        std::string tmpstr( (LPSTR)id_data.ModelNumber, (LPSTR)id_data.ModelNumber + idx );

        lva.iSubItem = 1;
        lva.pszText = disk->identified() ? (LPSTR)tmpstr.c_str() : "Unknown";

        SendMessage( hList, LVM_SETITEMTEXTA, pos, (LPARAM)&lva );

        for (idx = 0; idx < sizeof(id_data.SerialNumber); idx++)
            if (id_data.SerialNumber[idx] != ' ')
                break;

        tmpstr = std::string( (LPSTR)(id_data.SerialNumber + idx), (LPSTR)(id_data.SerialNumber + sizeof(id_data.SerialNumber)) );

        lva.iSubItem = 2;
        lva.pszText = disk->identified() ? (LPSTR)tmpstr.c_str() : "Unknown";

        SendMessage( hList, LVM_SETITEMTEXTA, pos, (LPARAM)&lva );
    }

    return ERROR_SUCCESS;
}
コード例 #19
0
ファイル: zipk.cpp プロジェクト: wangch/zipk
static int add_items() {
   ListView_DeleteAllItems(g_lv.lv);

   int style = ::SendMessage(g_lv.lv, LVM_GETVIEW, 0, 0);
   if (style == LV_VIEW_TILE) {
      unsigned int n;
      g_lv.dok = false;
      ::_beginthreadex(0, 0, display_tm, 0, 0, &n);
      return 0;
   }

   SHFILEINFO si;
   HIMAGELIST il = (HIMAGELIST)::SHGetFileInfo(L"", 0, &si, sizeof(si), SHGFI_SYSICONINDEX);
   ListView_SetImageList(g_lv.lv, il, LVSIL_NORMAL);

   LVITEM lvi;
   lvi.pszText   = L"";
   lvi.mask      = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
   lvi.stateMask = 0;
   lvi.iSubItem  = 0;
   lvi.state     = 0;
   node* n = g_lv.n;
   NIT it = n->childs.begin();
   for (int i = 0; it != n->childs.end(); ++it, ++i) {
      node* c = *it;
      lvi.iItem = i;
      c->i = i;
      //SHFILEINFO si;
      if (c->type == 0) {
         SHGetFileInfo(L"folder", FILE_ATTRIBUTE_DIRECTORY, &si, sizeof(si),
            SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
      } else {
         int pos = c->name.find(L'.');
         if (pos != std::wstring::npos) {
            std::wstring sf = c->name.substr(pos);
            SHGetFileInfo(sf.c_str(), FILE_ATTRIBUTE_NORMAL, &si, sizeof(si),
               SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
         } else {
            SHGetFileInfo(L"file", FILE_ATTRIBUTE_NORMAL, &si, sizeof(si),
               SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
         }
      }
      lvi.iImage = si.iIcon;
      lvi.lParam = (LPARAM)c;
      ListView_InsertItem(g_lv.lv, &lvi);
      add_subtxt(i, c);
   }
   return 0;
}
コード例 #20
0
ファイル: DialogAbout.cpp プロジェクト: AlonTzarafi/rainmeter
/*
** 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);
		}
	}
}
コード例 #21
0
ファイル: wzcui.cpp プロジェクト: NemProjects/WLAN
static void DeleteAllItems(PWLAN_INFO psInfo)
{
    // Clear the list view
    ListView_DeleteAllItems(psInfo->hwndNetList);
    psInfo->fAPAir = FALSE;

    // Clear the network list
    if (NULL != psInfo->hdsaNetworks)
    {
        // The alternative here is to call DSA_DeleteAllItems, but this saves
        // our poor little heap, since most likely we'll have approximately the
        // same number of networks in our next query
        psInfo->hdsaNetworks->cItem = 0;
    }
}
コード例 #22
0
ファイル: MainWindow.cpp プロジェクト: Luminoth/ttable
/// Deletes the list view columns
void MainWindow::delete_columns()
{
    ListView_DeleteAllItems(m_hWndTable);

    // column 0 can't be deleted, so we gotta fake around it
    const int count = Header_GetItemCount(ListView_GetHeader(m_hWndTable));

    LVCOLUMN lvc;
    lvc.mask = LVCF_WIDTH;
    lvc.cx = 0;
    ListView_InsertColumn(m_hWndTable, 0, &lvc);

    for(int i=0; i<count; ++i)
        ListView_DeleteColumn(m_hWndTable, 1);
}
コード例 #23
0
int re_populate_items()
{
    int i, cnt=0;
lv_in_op=1;
    ListView_DeleteAllItems(hwnd_lv);
    for(i=0;i<nr_cur_stream;i++)
    {
        InsertItemFromStream(hwnd_lv, g_apt_streams[i]);
        cnt++;

    }
    update_statusbar();
lv_in_op=0;
    return cnt;

}
コード例 #24
0
ファイル: PpcMainWnd.cpp プロジェクト: jiangzhengwenjz/rtoss
void CPpcMainWnd::DeleteAllFile()
{
	Stop();
	Close();

	m_nCurrent = OPEN_NONE;
	for (int i = 0; i < m_pListFile->GetCount(); i++) {
		FILEINFO* pInfo = (FILEINFO*)m_pListFile->GetAt(i);
		delete pInfo;
	}
	m_pListFile->RemoveAll();
	ListView_DeleteAllItems(m_hwndLV);

	InvalidateRect(m_hWnd, NULL, TRUE);
	UpdateWindow(m_hWnd);
}
コード例 #25
0
/*
================
rvDebuggerQuickWatchDlg::SetVariable

Sets the current variable being inspected
================
*/
void rvDebuggerQuickWatchDlg::SetVariable ( const char* varname, bool force )
{
	// See if the variable has changed
	if ( !force && !mVariable.Icmp ( varname ) )
	{
		return;
	}

	// Throw up a wait cursor	
	SetCursor ( LoadCursor ( NULL, IDC_WAIT ) );

	// Clear the current value list control
	ListView_DeleteAllItems ( GetDlgItem ( mWnd, IDC_DBG_CURVALUE ) );

	// Get the value of the new variable
	gDebuggerApp.GetClient().InspectVariable ( varname, mCallstackDepth );

	// Wait for the variable value to be sent over from the debugger server		
	if ( !gDebuggerApp.GetClient().WaitFor ( DBMSG_INSPECTVARIABLE, 2500 ) )
	{
		return;
	}
	
	// Make sure we got the value of the variable
	if ( !gDebuggerApp.GetClient().GetVariableValue(varname, mCallstackDepth)[0] )
	{
		return;
	}

	// Enable the windows that display the current value
	mVariable = varname;
	EnableWindow ( GetDlgItem ( mWnd, IDC_DBG_CURVALUE ), true );
	EnableWindow ( GetDlgItem ( mWnd, IDC_DBG_CURVALUE_STATIC ), true );
			
	// Add the variablae value to the list control			
	LVITEM item;
	item.mask = LVIF_TEXT;
	item.pszText = (LPSTR)varname;
	item.iItem = 0;
	item.iSubItem = 0;
	ListView_InsertItem ( GetDlgItem ( mWnd, IDC_DBG_CURVALUE ), &item );				
	ListView_SetItemText ( GetDlgItem ( mWnd, IDC_DBG_CURVALUE ), 0, 1, (LPSTR)gDebuggerApp.GetClient().GetVariableValue(varname,mCallstackDepth) );

	// Give focus back to the variable edit control and set the cursor back to an arrow
	SetFocus ( GetDlgItem ( mWnd, IDC_DBG_VARIABLE ) );
	SetCursor ( LoadCursor ( NULL, IDC_ARROW ) );
}
コード例 #26
0
ファイル: PlayListDlg.cpp プロジェクト: v-zaburdaev/Gsplayer2
void CPlayListDlg::UpdatePlayList()
{
	if (!m_hWnd)
		return;

	HWND hwndLV = GetDlgItem(m_hWnd, IDC_PLAY_LIST);

	ListView_DeleteAllItems(hwndLV);
	int nCount = m_pParent->GetFileCount();
	for (int i = 0; i < nCount; i++)
		AddList(hwndLV, i);

	int nCurrent = m_pParent->GetCurrentFile();
	ListView_EnsureVisible(hwndLV, nCurrent, FALSE);
	ListView_SetItemState(hwndLV, nCurrent, 
		LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
}
コード例 #27
0
ファイル: DialogAbout.cpp プロジェクト: AlonTzarafi/rainmeter
INT_PTR DialogAbout::TabLog::OnCommand(WPARAM wParam, LPARAM lParam)
{
	switch (LOWORD(wParam))
	{
	case Id_ErrorCheckBox:
		if (HIWORD(wParam) == BN_CLICKED)
		{
			m_Error = !m_Error;
		}
		break;

	case Id_WarningCheckBox:
		if (HIWORD(wParam) == BN_CLICKED)
		{
			m_Warning = !m_Warning;
		}
		break;

	case Id_NoticeCheckBox:
		if (HIWORD(wParam) == BN_CLICKED)
		{
			m_Notice = !m_Notice;
		}
		break;

	case Id_DebugCheckBox:
		if (HIWORD(wParam) == BN_CLICKED)
		{
			m_Debug = !m_Debug;
		}
		break;

	case Id_ClearButton:
		if (HIWORD(wParam) == BN_CLICKED)
		{
			HWND item = GetControl(Id_ItemsListView);
			ListView_DeleteAllItems(item);
		}
		break;

	default:
		return 1;
	}

	return 0;
}
コード例 #28
0
ファイル: settings.c プロジェクト: HBelusca/NasuTek-Odyssey
VOID
UpdateLayoutsList(VOID)
{
    HIMAGELIST hImgList;

    /* Clear the list */
    (VOID) ListView_DeleteAllItems(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST));

    /* Crate new list */
    hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 0, 1);
    InitLangList(MainDlgWnd, hImgList);
    hImgList = ListView_SetImageList(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST), hImgList, LVSIL_SMALL);

    /* Destroy old image list */
    if(hImgList)
        (VOID) ImageList_Destroy(hImgList);
}
コード例 #29
0
ファイル: lab4.cpp プロジェクト: ItramariN/lab
void ShowDB(HWND hWnd)
{
    PHONE_DB_RECORD recTemplate;

    if (g_DatabasePtr == NULL) {
        MessageBox(hWnd, TEXT("Ошибка: база не загружена!"), NULL, MB_OK);
        return;
    }
    int foundItems=0;

    PHONE_DB_RECORD foundRec;
    ListView_DeleteAllItems(hListView);
    searchInDatabaseRoutine(NULL, NULL, 0);
    while (searchInDatabaseRoutine(&foundRec, &recTemplate, 0))
    {
        if (foundRec.phone[0]==0)
            continue;
        if (AddItemToListViewA(hListView, foundRec.phone, 0, 0)
                || AddItemToListViewA(hListView, foundRec.lastname, 0, 1)
                || AddItemToListViewA(hListView, foundRec.name, 0, 2)
                || AddItemToListViewA(hListView, foundRec.patronym, 0, 3)
                || AddItemToListViewA(hListView, foundRec.street, 0, 4)
                || AddItemToListViewA(hListView, foundRec.house, 0, 5)
                || AddItemToListViewA(hListView, foundRec.housing, 0, 6)
                || AddItemToListViewA(hListView, foundRec.apartment, 0, 7))
        {
            DWORD systemLocale = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
            HLOCAL hlocal = NULL;

            FormatMessage(
                FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
                FORMAT_MESSAGE_ALLOCATE_BUFFER,
                NULL, GetLastError(), systemLocale,
                (PTSTR) &hlocal, 0, NULL);
            MessageBox(hWnd,
                       TEXT("Ошибка вывода! Возможно база повреждена! Поиск остановлен"),
                       NULL,
                       MB_OK);

            MessageBox(0, (TCHAR*)hlocal, NULL, MB_OK);
            LocalFree(hlocal);
            break;
        }
        foundItems++;
    }
}
コード例 #30
0
//----------------------------------------------------------------------------------------------------------------------
// POPULATE
//----------------------------------------------------------------------------------------------------------------------
void cListViewComputers::populate ( cMachlist * pMachlist )
{
	assert ( 0 < iQtyColumns );
	assert ( pMachlist );

	if ( ListView_GetItemCount ( hwnd ) )
		ListView_DeleteAllItems ( hwnd );

	LVITEM lvI;
	ZeroMemory ( &lvI, sizeof(lvI) );
	lvI.mask = LVIF_TEXT |  LVIF_PARAM ; 
	lvI.state = 0; 
	lvI.stateMask = 0; 

	int i = 0;
	for ( mojo::cMach * p = pMachlist->pHead; p; p = p->pNext, i++ )
	{
		// if ( p->bExclude )
		//	continue;

		SetLastError(0);
		lvI.iItem = i;
		lvI.iImage = 0;
		lvI.iSubItem = 0;
		lvI.lParam = (LPARAM) ( p->dwSerialNumber );
		lvI.pszText = const_cast<LPWSTR>( p->sName.cstr() );
		lvI.mask = LVIF_TEXT |  LVIF_PARAM | LVIF_STATE ; 
		lvI.state = 1<<12;
		SendMessage ( hwnd, LVM_INSERTITEM, 0, (LPARAM) &lvI );
		lvI.iSubItem = 1;

		if ( 2 <= iQtyColumns )
			ListView_SetItemText ( hwnd, i, 1, L"This is an IP" );

		if ( 3 <= iQtyColumns )
			ListView_SetItemText ( hwnd, i, 2, L"This is a status" );

		if ( 4 <= iQtyColumns )
			ListView_SetItemText ( hwnd, i, 2, L"Screen size" );

		set_item ( i, p );
	}

	InvalidateRect ( hwnd, NULL, true );
	UpdateWindow ( hwnd );
}