positions correctly on initialization now
This commit is contained in:
@@ -92,6 +92,7 @@ HWND CreateGroup(_In_ PGROUP pg)
|
|||||||
HICON hIconTemp = NULL;
|
HICON hIconTemp = NULL;
|
||||||
HWND hWndGroup = NULL;
|
HWND hWndGroup = NULL;
|
||||||
HWND hWndListView = NULL;
|
HWND hWndListView = NULL;
|
||||||
|
RECT rcGroupWindow = { 0 };
|
||||||
LVCOLUMN lvc = { 0 };
|
LVCOLUMN lvc = { 0 };
|
||||||
|
|
||||||
if (pg == NULL)
|
if (pg == NULL)
|
||||||
@@ -145,6 +146,9 @@ HWND CreateGroup(_In_ PGROUP pg)
|
|||||||
DestroyIcon(hIconTemp);
|
DestroyIcon(hIconTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the group window rect
|
||||||
|
GetClientRect(hWndGroup, &rcGroupWindow);
|
||||||
|
|
||||||
// Create the group window ListView control
|
// Create the group window ListView control
|
||||||
if ((hWndListView = 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
|
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
|
||||||
@@ -154,6 +158,12 @@ HWND CreateGroup(_In_ PGROUP pg)
|
|||||||
NULL)) == NULL)
|
NULL)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
// resize it to fit the window
|
||||||
|
SetWindowPos(hWndListView, NULL,
|
||||||
|
rcGroupWindow.left, rcGroupWindow.top,
|
||||||
|
rcGroupWindow.right - rcGroupWindow.left,
|
||||||
|
rcGroupWindow.bottom - rcGroupWindow.top, SWP_NOZORDER);
|
||||||
|
|
||||||
// create a ListView name column
|
// create a ListView name column
|
||||||
lvc.mask = LVCF_FMT | LVCF_WIDTH;
|
lvc.mask = LVCF_FMT | LVCF_WIDTH;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
@@ -402,7 +412,6 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// resize it to fit the window
|
// resize it to fit the window
|
||||||
if ((rcGroupWindow.left != rcGroupWindow.right) && (rcGroupWindow.top != rcGroupWindow.bottom))
|
|
||||||
SetWindowPos(hWndListView, NULL,
|
SetWindowPos(hWndListView, NULL,
|
||||||
rcGroupWindow.left, rcGroupWindow.top,
|
rcGroupWindow.left, rcGroupWindow.top,
|
||||||
rcGroupWindow.right - rcGroupWindow.left,
|
rcGroupWindow.right - rcGroupWindow.left,
|
||||||
|
|||||||
Reference in New Issue
Block a user