本文整理汇总了C++中ListView_SetImageList函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_SetImageList函数的具体用法?C++ ListView_SetImageList怎么用?C++ ListView_SetImageList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_SetImageList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ListView_SetImageList
void CTDCTaskListCtrl::SetTasksImageList(HIMAGELIST hil, BOOL bState, BOOL bOn)
{
if (bOn)
ListView_SetImageList(m_lcTasks, hil, (bState ? LVSIL_STATE : LVSIL_SMALL));
else
ListView_SetImageList(m_lcTasks, NULL, (bState ? LVSIL_STATE : LVSIL_SMALL));
}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:7,代码来源:TDCTaskListCtrl.cpp
示例2: initListViewImageLists
BOOL initListViewImageLists()
{
HIMAGELIST hILSmall; // handle cua image list small
HIMAGELIST hILLarge; // handle cua image list large
// Tao lap cac Image list.
hILSmall = ImageList_Create(CX_ICON_SMALL, CY_ICON_SMALL, ILC_COLOR32 | ILC_MASK, NUM_ICONS, 1000);
hILLarge = ImageList_Create(CX_ICON_LARGE, CY_ICON_LARGE, ILC_COLOR32 | ILC_MASK, NUM_ICONS, 1000);
// Add cac incon vao Image List
// for(int idx = IDI_ICON1; idx < IDI_ICON1 + NUM_ICONS; idx++)
// {
// HICON hIcon = LoadIcon(HInstance, MAKEINTRESOURCE(idx));
//
// ImageList_AddIcon(hILSmall, hIcon);
// ImageList_AddIcon(hILLarge, hIcon);
// }
// Kiem tra so icon co trong Image list
// if(ImageList_GetImageCount(hILSmall) < NUM_ICONS || ImageList_GetImageCount(hILLarge) < NUM_ICONS)
// return FALSE;
// Gan Image lists cho List View
ListView_SetImageList(hwndListView, hILSmall, LVSIL_SMALL);
ListView_SetImageList(hwndListView, hILLarge, LVSIL_NORMAL);
return TRUE;
}
开发者ID:anhvinhitus,项目名称:myprojects2005-2009,代码行数:28,代码来源:stdafx.cpp
示例3: InitCommonControls
BOOL ZipDlg::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam)
{
InitCommonControls();
// 変数初期化
hInstance = (HINSTANCE)GetWindowLong( hDlg, GWL_HINSTANCE) ;
// アイコン設定
HICON hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON));
SendMessage( hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
SendMessage( hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
DestroyIcon( hIcon) ;
// ウインドウハンドル取得
hwndList = GetDlgItem( hDlg, IDC_LIST) ;
hwndOk = GetDlgItem( hDlg, IDOK) ;
hwndDel = GetDlgItem( hDlg, IDC_DEL) ;
// リスト設定
SetWindowLong( hwndList, GWL_STYLE, GetWindowLong( hwndList, GWL_STYLE) | LVS_SHAREIMAGELISTS) ;
DragAcceptFiles( hwndList, TRUE) ;
ListView_DeleteAllItems( hwndList) ;
LVCOLUMN lvclm ;
lvclm.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM ;
lvclm.fmt = LVCFMT_LEFT ;
lvclm.pszText = "ファイル名" ;
lvclm.cx = 150 ;
lvclm.iSubItem = 0 ;
ListView_InsertColumn( hwndList, 0, &lvclm);
lvclm.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM ;
lvclm.fmt = LVCFMT_LEFT ;
lvclm.pszText = "パス" ;
lvclm.cx = 250 ;
lvclm.iSubItem = 0 ;
ListView_InsertColumn( hwndList, 1, &lvclm);
SHFILEINFO shfi ;
HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo( "", 0, &shfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON) ;
ListView_SetImageList( hwndList, hImageList, LVSIL_SMALL) ;
hImageList = (HIMAGELIST)SHGetFileInfo( "", 0, &shfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_LARGEICON) ;
ListView_SetImageList( hwndList, hImageList, LVSIL_NORMAL) ;
// 初期化
EnableWindow( hwndDel, FALSE) ;
EnableWindow( hwndOk, FALSE) ;
if( Profile::blnOnlyMp3)CheckDlgButton( hDlg, IDC_ONLYMP3, BST_CHECKED) ;
RECT rc ;
GetWindowRect( hDlg, &rc) ;
MoveWindow( hDlg, Profile::intX, Profile::intY, rc.right, rc.bottom, FALSE) ;
wpcList = (WNDPROC)GetWindowLong( hwndList, GWL_WNDPROC) ;
if( wpcList)
{
SetWindowLong( hwndList, GWL_WNDPROC , (LONG)ListProc) ;
SetWindowLong( hwndList, GWL_USERDATA, (LONG)this) ;
}
return TRUE ;
}
开发者ID:nitoyon,项目名称:mp3album,代码行数:59,代码来源:ZipDlg.cpp
示例4: insert_image_lists
//----------------------------------------------------------------------------------------------------------------------
// INSERT IMAGE LISTS
//----------------------------------------------------------------------------------------------------------------------
void cListViewComputers :: insert_image_lists ( HWND hwnd )
{
HANDLE hStateBlue = 0;
HANDLE hStateGold = 0;
HANDLE hStateGray = 0;
//-----------------------------------
// INSERT IMAGES IN ORDER
// 0 == GRAY == NO CONNECTIONS
// 1 == GOLD == ONE-WAY CONNECTION
// 2 == BLUE == TWO-WAY CONNECTION
//-----------------------------------
HANDLE hDeskStraightGray = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_COMPUTER_GRAY ),
IMAGE_ICON, 85, 73, LR_CREATEDIBSECTION );
HANDLE hDeskStraightGold = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_COMPUTER_GOLD), // returns 0 on fail
IMAGE_ICON, 85, 73, LR_CREATEDIBSECTION | LR_LOADTRANSPARENT );
HANDLE hDeskStraightBlue = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_COMPUTER_BLUE ),
IMAGE_ICON, 85, 73, LR_CREATEDIBSECTION );
hStateGray = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_CONNECTION_STATE_GRAY ),
IMAGE_ICON, 16,24, LR_CREATEDIBSECTION );
hStateGold = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_CONNECTION_STATE_GOLD ),
IMAGE_ICON, 16,24, LR_CREATEDIBSECTION );
hStateBlue = LoadImage ( g_hInstance, MAKEINTRESOURCE ( IDI_CONNECTION_STATE_BLUE ),
IMAGE_ICON, 16,24, LR_CREATEDIBSECTION );
hImageListLarge = ImageList_Create ( 85, 73, ILC_MASK | ILC_COLORDDB | ILC_COLOR32, 3, 0 );
HRESULT iResult = ImageList_AddIcon ( hImageListLarge, (HICON)hDeskStraightGray );
iResult = ImageList_AddIcon ( hImageListLarge, (HICON)hDeskStraightGold );
iResult = ImageList_AddIcon ( hImageListLarge, (HICON)hDeskStraightBlue );
hImageListState = ImageList_Create ( 16, 24, ILC_MASK | ILC_COLORDDB | ILC_COLOR32, 3, 0 );
iResult = ImageList_AddIcon ( hImageListState, (HICON)hStateGray);
iResult = ImageList_AddIcon ( hImageListState, (HICON)hStateGold );
iResult = ImageList_AddIcon ( hImageListState, (HICON)hStateBlue );
HIMAGELIST hResult = ListView_SetImageList ( hwnd, hImageListLarge, LVSIL_NORMAL );
ListView_SetExtendedListViewStyle ( hwnd, LVS_EX_BORDERSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP );
hResult = ListView_SetImageList ( hwnd, hImageListState, LVSIL_STATE );
HWND hHeader = ListView_GetHeader ( hwnd );
RECT rect;
GetWindowRect ( hHeader, & rect );
MoveWindow ( hHeader, rect.left, rect.top, 200, 100, TRUE );
ShowWindow ( hHeader, SW_NORMAL );
}
开发者ID:XueSlick,项目名称:mojoware,代码行数:54,代码来源:cListViewComputers.cpp
示例5: DirList_Init
//=============================================================================
//
// DirList_Init()
//
// Initializes the DLDATA structure and sets up the listview control
//
BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader)
{
HIMAGELIST hil;
SHFILEINFO shfi;
LV_COLUMN lvc;
// Allocate DirListData Property
LPDLDATA lpdl = (LPVOID)GlobalAlloc(GPTR,sizeof(DLDATA));
SetProp(hwnd,pDirListProp,(HANDLE)lpdl);
// Setup dl
lpdl->hwnd = hwnd;
lpdl->cbidl = 0;
lpdl->pidl = NULL;
lpdl->lpsf = NULL;
lstrcpy(lpdl->szPath,L"");
// Add Imagelists
hil = (HIMAGELIST)SHGetFileInfo(L"C:\\",0,&shfi,sizeof(SHFILEINFO),
SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
ListView_SetImageList(hwnd,hil,LVSIL_SMALL);
hil = (HIMAGELIST)SHGetFileInfo(L"C:\\",0,&shfi,sizeof(SHFILEINFO),
SHGFI_LARGEICON | SHGFI_SYSICONINDEX);
ListView_SetImageList(hwnd,hil,LVSIL_NORMAL);
// Initialize default icons - done in DirList_Fill()
//SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_DIRECTORY,&shfi,sizeof(SHFILEINFO),
// SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
//lpdl->iDefIconFolder = shfi.iIcon;
//SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(SHFILEINFO),
// SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
//lpdl->iDefIconFile = shfi.iIcon;
lpdl->iDefIconFolder = 0;
lpdl->iDefIconFile = 0;
// Icon thread control
lpdl->hExitThread = CreateEvent(NULL,TRUE,FALSE,NULL);
lpdl->hTerminatedThread = CreateEvent(NULL,TRUE,TRUE,NULL);
lvc;
pszHeader;
return TRUE;
}
开发者ID:2thetop,项目名称:notepad2-mod,代码行数:57,代码来源:Dlapi.c
示例6: InitListViewImageLists
BOOL InitListViewImageLists(HWND hWndListView)
{
HICON hiconItem; // Icon for list-view items.
HIMAGELIST hLarge; // Image list for icon view.
HIMAGELIST hSmall; // Image list for other views.
// Create the full-sized icon image lists.
hLarge = ImageList_Create(25,
25,
ILC_COLORDDB | ILC_MASK, 2, 1);
hSmall = ImageList_Create(25,
25,
ILC_COLORDDB | ILC_MASK, 2, 1);
// Add an icon to each image list.
//hiconItem = LoadIcon(g_hInstance, TEXT("haha1"));
ImageList_AddIcon(hLarge, hiconItem);
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
//hiconItem = LoadIcon(g_hInstance, TEXT("haha2"));
ImageList_AddIcon(hLarge, hiconItem);
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
// When you are dealing with multiple icons, you can use the previous four lines of
// code inside a loop. The following code shows such a loop. The
// icons are defined in the application's header file as resources, which
// are numbered consecutively starting with IDS_FIRSTICON. The number of
// icons is defined in the header file as C_ICONS.
/*
for(index = 0; index < C_ICONS; index++)
{
hIconItem = LoadIcon (g_hinst, MAKEINTRESOURCE(IDS_FIRSTICON + index));
ImageList_AddIcon(hSmall, hIconItem);
ImageList_AddIcon(hLarge, hIconItem);
Destroy(hIconItem);
}
*/
// Assign the image lists to the list-view control.
ListView_SetImageList(hWndListView, hLarge, LVSIL_NORMAL);
ListView_SetImageList(hWndListView, hSmall, LVSIL_SMALL);
return TRUE;
}
开发者ID:yedan2010,项目名称:xb-ether-tester,代码行数:50,代码来源:right_window.c
示例7: InitListViewColumns
void InitListViewColumns( HWND hListView, const LISTVIEW_COLUMN * Cols, int numColumns, long style )
{
HKEY hKey;
DWORD valLength;
TCHAR colName[32];
RECT rc;
// Get window sizes
rc.left = -1;
rc.top = -1;
RegCreateKey(HKEY_CURRENT_USER, _T("Software\\Sysinternals\\ShareEnum"), &hKey );
valLength = sizeof(DWORD);
RegQueryValueEx( hKey, _T("x"), NULL, NULL, (LPBYTE) &rc.left,
&valLength );
RegQueryValueEx( hKey, _T("y"), NULL, NULL, (LPBYTE) &rc.top,
&valLength );
RegQueryValueEx( hKey, _T("w"), NULL, NULL, (LPBYTE) &rc.right,
&valLength );
RegQueryValueEx( hKey, _T("h"), NULL, NULL, (LPBYTE) &rc.bottom,
&valLength );
if( rc.left != -1 && rc.top != -1 )
MoveWindow( GetParent( hListView), rc.left, rc.top, rc.right, rc.bottom, TRUE );
// Set listview styles
ListView_SetExtendedListViewStyleEx( hListView, style, style );
// Create columns
for ( int i = 0; i < numColumns; ++i ) {
LVCOLUMN col = { 0 };
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.pszText = (TCHAR *)Cols[i].Title;
col.cx = Cols[i].Width;
_stprintf( colName, _T("Column%d"), i );
DWORD val = -1;
valLength = sizeof(DWORD);
RegQueryValueEx( hKey,colName, NULL, NULL, (LPBYTE) &val, &valLength );
if ( val < 600 )
col.cx = val;
ListView_InsertColumn( hListView, i, &col );
}
RegCloseKey( hKey );
HINSTANCE hInstance = GetModuleHandle(NULL);
// Create image list (order corresponds to LISTVIEW_IMG_* enumeration)
HIMAGELIST hImageList = ImageList_Create( GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLORDDB, 10, 30 );
UINT loadFlags = LR_DEFAULTCOLOR | LR_LOADTRANSPARENT | LR_SHARED;
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_WINDOW) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILE), IMAGE_ICON, 16, 16, loadFlags));
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_BTNFACE) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_DOWNARROW), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_UPARROW), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_WINDOW) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILEGOOD), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILEBAD), IMAGE_ICON, 16, 16, loadFlags ) );
ListView_SetImageList( hListView, hImageList, LVSIL_SMALL );
}
开发者ID:caidongyun,项目名称:libs,代码行数:60,代码来源:ListView.cpp
示例8: CreateResultsColumns
void CreateResultsColumns(HWND hwndResults, struct FindAddDlgData *dat, char *szProto)
{
SaveColumnSizes(hwndResults);
while (ListView_DeleteColumn(hwndResults, 0));
ListView_SetImageList(hwndResults, dat->himlComboIcons, LVSIL_SMALL);
LoadColumnSizes(hwndResults, szProto);
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:7,代码来源:searchresults.cpp
示例9: ListView_SetImageList
void CLogView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
m_pLogList = &GetListCtrl();
I_LogList.Create(16, 16, ILC_COLOR32|ILC_MASK,10, 0);
HICON hIcon = NULL;//以下为加入3个图标资源
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_EVENT_INFO), IMAGE_ICON, 16, 16, 0);
I_LogList.Add(hIcon);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_EVENT_ERROR), IMAGE_ICON, 16, 16, 0);
I_LogList.Add(hIcon);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_BE_CAREFUL), IMAGE_ICON, 16, 16, 0);
I_LogList.Add(hIcon);
ListView_SetImageList(m_pLogList->m_hWnd, I_LogList, LVSIL_SMALL);
m_pLogList->SetExtendedStyle(/*LVIF_PARAM |*/ LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP|/*LVS_EX_FLATSB|*/
LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT |LVS_EX_SUBITEMIMAGES |LVS_EX_GRIDLINES);
for (int i = 0; i < g_Log_Count; i++)
{
m_pLogList->InsertColumn(i, g_Log_Data[i].title);
m_pLogList->SetColumnWidth(i, g_Log_Data[i].nWidth);
g_Log_Width += g_Log_Data[i].nWidth; // 总宽度
}
HWND hWndHeader = m_pLogList->GetDlgItem(0)->GetSafeHwnd();
m_heades.SubclassWindow(hWndHeader);
m_heades.SetTheme(new CXTHeaderCtrlThemeOffice2003());
// ((CGh0stApp *)AfxGetApp())->m_IniFile.SetString("Other", "Out","1");
}
开发者ID:8ackl0,项目名称:remotectrl,代码行数:33,代码来源:LogView.cpp
示例10: InitListViewContorol
void InitListViewContorol(HWND hWnd)
{
HWND hWndLV = GetDlgItem(hWnd, IDC_LIST_MAILBOX);
LV_COLUMN lc;
LV_ITEM li;
HIMAGELIST hImgList;
RECT rect;
GetClientRect(hWndLV, &rect);
// イメージリストの作成
hImgList = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 1 , 1);
ImageList_AddIcon(hImgList, LoadIcon(g_hInstance, "IDI_MAILBOX"));
ListView_SetImageList(hWndLV, hImgList, LVSIL_SMALL);
ListView_SetExtendedListViewStyle(hWndLV, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
// ヘッダを追加 (表示しない)
lc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lc.fmt = LVCFMT_LEFT;
lc.pszText = "メールボックス";
lc.cx = rect.right;
lc.iSubItem = 0;
lc.cchTextMax = strlen(lc.pszText);
ListView_InsertColumn(hWndLV, 0, &lc);
lc.pszText = "フォルダ名";
lc.cx = 0;
lc.iSubItem = 1;
lc.cchTextMax = strlen(lc.pszText);
ListView_InsertColumn(hWndLV, 1, &lc);
// メールボックスを列挙
THash MailBoxes;
EnumMailBox(MailBoxes);
// メールボックスを追加
int i = 0;
for (THash::iterator itr = MailBoxes.begin(); itr != MailBoxes.end(); ++itr) {
li.mask = LVIF_TEXT | LVIF_IMAGE;
li.iItem = i;
li.iImage = 0;
// 表示名
li.pszText = (char *)((*itr).second).c_str();
li.iSubItem = 0;
ListView_InsertItem(hWndLV, &li);
// メールボックスのディレクトリ名
li.pszText = (char *)((*itr).first).c_str();
li.iSubItem = 1;
ListView_SetItem(hWndLV, &li);
// 設定されているメールボックスにチェックをつける
if (g_temporary_mailbox.count((*itr).first) == 1) {
ListView_SetCheckState(hWndLV, i, 1);
}
i++;
}
}
开发者ID:sunaoka,项目名称:bkwhitelist,代码行数:60,代码来源:SetupDlg.cpp
示例11: InitListViewImageLists
static BOOL InitListViewImageLists(HWND hwndLV)
{
HIMAGELIST himl; /* handle to image list */
HICON hico; /* handle to icon */
/* Create the image list. */
if ((himl = ImageList_Create(CX_ICON, CY_ICON,
ILC_MASK, 0, NUM_ICONS)) == NULL)
{
return FALSE;
}
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_BIN));
Image_Bin = ImageList_AddIcon(himl, hico);
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_STRING));
Image_String = ImageList_AddIcon(himl, hico);
/* Fail if not all of the images were added. */
if (ImageList_GetImageCount(himl) < NUM_ICONS)
{
return FALSE;
}
/* Associate the image list with the tree view control. */
(void)ListView_SetImageList(hwndLV, himl, LVSIL_SMALL);
return TRUE;
}
开发者ID:RareHare,项目名称:reactos,代码行数:29,代码来源:listview.c
示例12: ListView_SetImageList
void InsertObjectDialog::OnDestroy()
{
first_run.Detach();
ListView_SetImageList(objects.m_hWnd, NULL, LVSIL_SMALL);
ListView_SetImageList(objects.m_hWnd, NULL, LVSIL_NORMAL);
if (list_objects.GetCheck() == BST_CHECKED)
g_MainFrame->m_INI.WriteInt("InsertObject", "List", 1);
else
g_MainFrame->m_INI.WriteInt("InsertObject", "List", 0);
CDialog::OnDestroy();
dlgMan.Save();
}
开发者ID:aolko,项目名称:construct,代码行数:16,代码来源:Insert+Object+Dlg.cpp
示例13: ListView_SetImageList
BOOL CTDLTaskIconDlg::OnInitDialog()
{
CDialog::OnInitDialog();
ListView_SetImageList(m_lcIcons, m_ilIcons, LVSIL_SMALL);
CPreferences prefs;
for (int nImage = 0; nImage < m_ilIcons.GetImageCount(); nImage++)
{
CString sImage, sKey;
sKey.Format(_T("Icon%d"), nImage + 1);
sImage = prefs.GetProfileString(_T("TaskIcons"), sKey);
if (sImage.IsEmpty())
{
sImage.Format(_T("%d"), nImage + 1);
}
m_lcIcons.InsertItem(nImage, sImage, nImage);
}
if (m_nIconIndex >= 0)
{
m_lcIcons.SetItemState(m_nIconIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
}
// disable OK button if nothing selected
GetDlgItem(IDOK)->EnableWindow(m_nIconIndex >= 0);
m_lcIcons.SetFocus();
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:noindom99,项目名称:repositorium,代码行数:34,代码来源:TDLTaskIconDlg.cpp
示例14: initTable
/**
* 初始化列表控件
*/
void initTable(HWND hDlg)
{
HWND table = GetDlgItem(hDlg, IDC_TABLE);
hCourseList = table;
ListView_SetBkColor(table, 0xECF0F1);
ListView_SetExtendedListViewStyle(table, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
HIMAGELIST hImageList = ImageList_Create(1, 100, ILC_COLOR16 | ILC_MASK, 1, 1);
ListView_SetImageList(table, hImageList, LVSIL_STATE);
// 绘制表头
LV_COLUMN column = {LVCF_TEXT | LVCF_WIDTH | LVCF_FMT, LVCFMT_CENTER, 160};
column.pszText = L"时间";
ListView_InsertColumn(table, 1, &column);
CSTR headers = L"一二三四五六天";
Char headerBuffer[] = L"星期*";
for (int i = 0; i < DAY_LENGTH;)
{
headerBuffer[2] = headers[i];
column.pszText = headerBuffer;
ListView_InsertColumn(table, ++i, &column);
}
// 插入行头
LVITEM item = {LVIF_IMAGE | LVIF_TEXT, 0, 0};
while (item.iItem < Course_LENGTH)
{
ListView_InsertItem(table, &item);
item.pszText = (STR)TIME[item.iItem];
ListView_SetItem(table, &item);
++item.iItem;
}
}
开发者ID:mCodebreaker,项目名称:win32_timetable,代码行数:38,代码来源:main.cpp
示例15: ShellInitDialog
void CPlayListDlg::OnInitDialog(HWND hwndDlg)
{
m_hWnd = hwndDlg;
ShellInitDialog(m_hWnd);
HWND hwndLV = GetDlgItem(m_hWnd, IDC_PLAY_LIST);
RECT rc;
GetClientRect(hwndLV, &rc);
ListView_SetExtendedListViewStyle(hwndLV,
ListView_GetExtendedListViewStyle(hwndLV) | LVS_EX_FULLROWSELECT);
// カラムの挿入
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = RECT_WIDTH(&rc) - GetSystemMetrics(SM_CXVSCROLL) - 2;
lvc.pszText = _T("Name");
lvc.iSubItem = 0;
ListView_InsertColumn(hwndLV, 0, &lvc);
// イメージリストを設定
ListView_SetImageList(hwndLV, m_hImageList, LVSIL_SMALL);
// リストを更新
UpdatePlayList();
}
开发者ID:v-zaburdaev,项目名称:Gsplayer2,代码行数:27,代码来源:PlayListDlg.cpp
示例16: sizeof
CSListView::CSListView(HWND hwnd, CSWindow* parent)
{
m_handle = hwnd;
m_parent = parent;
LVGROUP lg = { 0 };
lg.cbSize = sizeof(LVGROUP);
lg.mask = LVGF_HEADER | LVGF_GROUPID;
lg.pszHeader = TranslateT("Favorites");
lg.iGroupId = 0;
ListView_InsertGroup(m_handle, -1, &lg);
lg.pszHeader = TranslateT("Regular statuses");
lg.iGroupId = 1;
ListView_InsertGroup(m_handle, -1, &lg);
ListView_EnableGroupView(m_handle, TRUE);
LVCOLUMN lvc = { 0 };
lvc.mask = LVCF_TEXT | LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = 0x00;
lvc.pszText = TEXT("");
lvc.cx = 0x16;
SendMessage(m_handle, LVM_INSERTCOLUMN, 0, (LPARAM)&lvc);
lvc.pszText = TranslateT("Title");
lvc.cx = 0x64;
SendMessage(m_handle, LVM_INSERTCOLUMN, 1, (LPARAM)&lvc);
lvc.pszText = TranslateT("Message");
lvc.cx = 0xa8;
SendMessage(m_handle, LVM_INSERTCOLUMN, 2, (LPARAM)&lvc);
ListView_SetExtendedListViewStyleEx(m_handle, 0, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP | LVS_EX_INFOTIP);
ListView_SetImageList(m_handle, m_parent->m_icons, LVSIL_SMALL);
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:35,代码来源:cslist.cpp
示例17: ShellInitDialog
void CPlayListDlg::OnInitDialog(HWND hwndDlg)
{
m_hWnd = hwndDlg;
ShellInitDialog(m_hWnd);
// ツールバーの準備
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = m_hWnd;
mbi.nToolBarId = IDR_PLAYLIST;
mbi.hInstRes = GetInst();
SHCreateMenuBar(&mbi);
m_hwndMB = mbi.hwndMB;
// リストの準備
HWND hwndLV = GetDlgItem(m_hWnd, IDC_PLAY_LIST);
ListView_SetExtendedListViewStyle(hwndLV,
ListView_GetExtendedListViewStyle(hwndLV) | LVS_EX_FULLROWSELECT);
// カラムの挿入
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = 0;
lvc.pszText = _T("Name");
lvc.iSubItem = 0;
ListView_InsertColumn(hwndLV, 0, &lvc);
// イメージリストを設定
ListView_SetImageList(hwndLV, m_hImageList, LVSIL_SMALL);
// リストを更新
UpdatePlayList();
}
开发者ID:afriza,项目名称:GSPlayer,代码行数:35,代码来源:PlayListDlgPPC.cpp
示例18: MakeControlListView
int MakeControlListView ( int iControlID, int iStyle, int iExtendedStyle, int iX, int iY, int iWidth, int iHeight )
{
// Assign the style
DWORD dwExtendedStyle = GetExtendedStyle ( iExtendedStyle );
DWORD dwSelectStyle = LVS_LIST;
DWORD dwIconType = LVSIL_SMALL;
DWORD dwIconSize = 16;
switch ( iStyle )
{
case 1 : dwSelectStyle = LVS_ICON | LVS_ALIGNTOP; dwIconSize=16; dwIconType=LVSIL_NORMAL; break;
case 2 : dwSelectStyle = LVS_ICON | LVS_ALIGNTOP; dwIconSize=32; dwIconType=LVSIL_NORMAL; break;
case 3 : dwSelectStyle = LVS_ICON | LVS_ALIGNTOP; dwIconSize=48; dwIconType=LVSIL_NORMAL; break;
}
// Create control
MaintainGlobalHWND();
if ( !CreateControl ( iControlID, g_pGlob->hWnd, WC_LISTVIEW, dwExtendedStyle, dwSelectStyle, "", iX, iY, iWidth, iHeight ) )
return 0;
// Create image list
g_pControls [ iControlID ].himlImageList = ImageList_Create(dwIconSize, dwIconSize, ILC_COLOR24, 0, 65535);
// Assign the image lists to the list view control.
HWND hwndLV = g_pControls [ iControlID ].hWnd;
ListView_SetImageList(hwndLV, g_pControls [ iControlID ].himlImageList, dwIconType);
// Subclass to get access to all control messages directly
g_pControls [ iControlID ].lOriginalWinProc = SetWindowLong ( g_pControls [ iControlID ].hWnd, GWL_WNDPROC, (LONG)SubClassControlWinProc );
// Update safe rects after new addition
UpdateSafeRectsArray();
// Success
return 1;
}
开发者ID:Fliper12,项目名称:darkbasicpro,代码行数:35,代码来源:WinGUI.cpp
示例19: OnInitDialog
static VOID
OnInitDialog(HWND hwndDlg)
{
HWND hwndListView;
HIMAGELIST hImgList;
HICON hIcon;
/* Create the image list */
hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5);
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgList, hIcon);
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgList, hIcon);
DestroyIcon(hIcon);
hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST);
(VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
(void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);
SetUsersListColumns(hwndListView);
UpdateUsersList(hwndListView);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,代码来源:users.c
示例20: switch
void KListView::AddIcon(int iImageList, HINSTANCE hInst, int iIcon)
{
HIMAGELIST * phImage;
switch (iImageList)
{
case LVSIL_NORMAL:
phImage = & hImage_Normal;
break;
case LVSIL_SMALL:
phImage = & hImage_Small;
break;
case LVSIL_STATE:
phImage = & hImage_State;
break;
default:
assert(FALSE);
return;
}
if (*phImage==NULL)
{
int size = (iImageList==LVSIL_SMALL) ? 16 : 32;
*phImage = ImageList_Create(size, size, ILC_COLOR4 | ILC_MASK, 1, 1);
ListView_SetImageList(m_hWnd, *phImage, iImageList);
}
ImageList_AddIcon(*phImage, LoadIcon(hInst, MAKEINTRESOURCE(iIcon)));
}
开发者ID:b2kguga,项目名称:CodesAndNotes,代码行数:33,代码来源:listview.cpp
注:本文中的ListView_SetImageList函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论