From b07bcbfa6dfc08d1d348754a95fd471514263885 Mon Sep 17 00:00:00 2001 From: freedom Date: Wed, 11 Oct 2023 11:11:59 -0600 Subject: [PATCH] pain --- progmgr/group.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/progmgr/group.c b/progmgr/group.c index fda6d9b..bd4f738 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -86,11 +86,13 @@ BOOL InitializeGroups(VOID) HWND CreateGroup(_In_ PGROUP pg) { MDICREATESTRUCT mcs = { NULL }; + PGROUP pGroup = NULL; HICON hIconLarge = NULL; HICON hIconSmall = NULL; HICON hIconTemp = NULL; HWND hWndGroup = NULL; - PGROUP pGroup = NULL; + HWND hWndListView = NULL; + LVCOLUMN lvc = { 0 }; if (pg == NULL) return NULL; @@ -144,14 +146,20 @@ HWND CreateGroup(_In_ PGROUP pg) } // Create the group window ListView control - if (CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, TEXT("ListView"), + if ((hWndListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, TEXT("ListView"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_ICON | ((LVS_AUTOARRANGE & bAutoArrange) * LVS_AUTOARRANGE) | LVS_NOSORTHEADER, mcs.x, mcs.y, mcs.cx, mcs.cy, hWndGroup, NULL, hAppInstance, - NULL) == NULL) + NULL)) == NULL) return NULL; + // create a ListView name column + lvc.mask = LVCF_FMT | LVCF_WIDTH; + lvc.fmt = LVCFMT_LEFT; + lvc.cx = 100; + ListView_InsertColumn(hWndListView, 0, &lvc); + // TODO: make sure the groups delete their icons upon destruction! return hWndGroup;