void CPluginPropertyPage::InitListItem(const CString& strDirectory) { MtlForEachObject_OldShell(strDirectory, [this](const CString& strPath, bool bDir) { if (bDir == false && Misc::GetFileExt(strPath).CompareNoCase(_T("dll")) == 0) { PLUGININFO *pstPluginInfo = new PLUGININFO; memset( pstPluginInfo, 0, sizeof (PLUGININFO) ); HINSTANCE hLib = ::LoadLibrary( strPath ); if (!hLib) { DWORD errNum = ::GetLastError(); } void (WINAPI * __GetPluginInfo)(PLUGININFO * pstPlugin); //+++ = NULL; __GetPluginInfo = ( void (WINAPI *)(PLUGININFO *) )GetProcAddress(hLib, "GetPluginInfo"); if (__GetPluginInfo) { __GetPluginInfo( pstPluginInfo ); CString strPluginDir = Misc::GetExeDirectory() + CPluginManager::PluginDir(); CString strName = strPath.Mid(strPluginDir.GetLength()); m_mapPlaginInfo.Add( strName, pstPluginInfo ); // List Add int nIndex = m_listview.InsertItem( m_listview.GetItemCount(), strName ); m_listview.SetItemData( nIndex, pstPluginInfo->type ); } else { delete pstPluginInfo; } ::FreeLibrary( hLib ); } else if (bDir && Misc::GetDirName(strPath).CompareNoCase(_T("_ignore")) != 0) { InitListItem(strPath); } }); }
ModelManager::ModelManager(QWidget *parent) : QListWidget(parent) { this->setViewMode(QListWidget::IconMode ); this->setFlow(QListView::LeftToRight); this->setUniformItemSizes(true); this->setResizeMode(QListWidget::Adjust);//Fixed this->setMovement(QListWidget::Snap);//Snap //this->setTextElideMode(Qt::ElideRight); this->setSortingEnabled(true); //this->setGridSize( QSize(ICON_W, ICON_H) ); this->setIconSize(QSize(ICON_W, ICON_H)); this->setSpacing(10); this->setWordWrap(true); //this->setWrapping(true); this->setAcceptDrops(true); this->setDragEnabled(true); this->setDragDropMode(QAbstractItemView::DragDrop); this->setEditTriggers(QAbstractItemView::SelectedClicked); m_iconHight = 32; m_iconWidth = 32; //initalized list InitListItem(); }
void CPluginPropertyPage::_SetData() { TCHAR titles[] = _T("ファイル名"); LVCOLUMN col; col.mask = LVCF_TEXT | LVCF_WIDTH; col.pszText = titles; col.cx = 150; m_listview.InsertColumn(0, &col); // List Item InitListItem(Misc::GetExeDirectory() + CPluginManager::PluginDir()); DoCheckListItem(); ::EnableWindow( GetDlgItem( IDC_BTN_SETTING ), FALSE ); }