























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























Review of Last Lecture
InitCommoncontrolsEx()
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize; DWORD dwICC;
} INITCOMMONCONTROLSEX;
Valid values for the dwICC parameter:
ICC_DATE_CLASSES : Date-Time picker control class
contd…
Figure –List View control
HIMAGELIST ImageList_Create( int cx, // width int cy, // height UINT flags, ILC_COLOR4 , ILC_MASK int cInitial, Number of images that the image list initially contains
int cGrow This parameter represents the number of new images that the resized image list can contain );
ImageList_ReplaceIcon( )
int ImageList_ReplaceIcon(
HIMAGELIST himl, int i, Index of the image to replace. If i is -1, the function appends the image to the end of the list. HICON hicon bitmap+mask );
We Created a window with WNDCLASS wc
#define ID_LISTVIEW 5 hWndListView = CreateWindow(WC_LISTVIEW, "Window Name", WS_TABSTOP | WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_AUTOARRANGE | LVS_REPORT, 10, 10, 350, 280, hWndMain, (HMENU)ID_LISTVIEW, hInstance, NULL);
if(!hWndListView) return 1;
hLarge = ImageList_Create(GetSystemMetrics(SM_CXICO N), GetSystemMetrics(SM_CYICON), ILC_MASK, 1, 1); hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMI CON), GetSystemMetrics(SM_CYSMICON), ILC_MASK, 1, 1); hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON_FOLDER)); ImageList_AddIcon(hLarge, hIcon); ImageList_AddIcon(hSmall, hIcon); hIcon = LoadIcon(…, MAKEINTRESOURCE(IDI_ICON_FILE))
ListView_SetImageList(hWndListVi ew, hLarge, LVSIL_NORMAL);
ListView_SetImageList(hWndListVi ew, hSmall, LVSIL_SMALL);
HIMAGELIST ListView_SetImageList( HWND hwnd, HIMAGELIST himl, int iImageList type of Image List: LVSIL_NORMAL | LVSIL_SMALL | LVSIL_STATE Docsity.com
Add coloumns to listview
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.cx = COL_WIDTH;
for(i=0; i<3; ++i) { lvc.iSubItem = i; lvc.fmt = alignments[i]; lvc.pszText = columnHeadings[i]; if(ListView_InsertColumn(hWndListView,i,&lvc)==-1) return 1; }