i wanna work on this on my desktop
This commit is contained in:
@@ -98,6 +98,15 @@ HWND CreateGroup(_In_ PGROUP pg)
|
|||||||
// allocate memory for a new group
|
// allocate memory for a new group
|
||||||
pGroup = (PGROUP)malloc(CalculateGroupMemory(pg, 0));
|
pGroup = (PGROUP)malloc(CalculateGroupMemory(pg, 0));
|
||||||
|
|
||||||
|
if (pGroup == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// clean up the memory if it's valid
|
||||||
|
ZeroMemory(pGroup, CalculateGroupMemory(pg, 0));
|
||||||
|
|
||||||
|
// copy over the group structure
|
||||||
|
*pGroup = *pg;
|
||||||
|
|
||||||
// TODO: get group minimized/maximized flags
|
// TODO: get group minimized/maximized flags
|
||||||
|
|
||||||
mcs.szClass = szGrpClass;
|
mcs.szClass = szGrpClass;
|
||||||
@@ -190,23 +199,29 @@ PITEM CreateItem(_In_ HWND hWndGroup, _In_ PITEM pi)
|
|||||||
LVITEM lvi = { 0 };
|
LVITEM lvi = { 0 };
|
||||||
PGROUP pGroup = NULL;
|
PGROUP pGroup = NULL;
|
||||||
PITEM pItem = NULL;
|
PITEM pItem = NULL;
|
||||||
|
UINT uiTest = 0;
|
||||||
|
|
||||||
// we actually just want the group pointer lol
|
// we actually just want the group pointer lol
|
||||||
pGroup = (PGROUP)GetWindowLongPtr(hWndGroup, GWLP_USERDATA);
|
pGroup = (PGROUP)GetWindowLongPtr(hWndGroup, GWLP_USERDATA);
|
||||||
|
|
||||||
|
uiTest = pGroup->cItemArray;
|
||||||
|
|
||||||
// return NULL if we can't get to the group or item
|
// return NULL if we can't get to the group or item
|
||||||
if (hWndGroup == NULL)
|
if (hWndGroup == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (pGroup == NULL)
|
if (pGroup == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (pi == NULL)
|
if (pi == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// compare group's existing memory to needed memory
|
// compare group's existing memory to needed memory
|
||||||
// if needed, reallocate the group's memory
|
// if needed, reallocate the group's memory
|
||||||
if (_msize(pGroup) != CalculateGroupMemory(pGroup, 1))
|
if (_msize(pGroup) != CalculateGroupMemory(pGroup, 1))
|
||||||
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)realloc(pGroup, CalculateGroupMemory(pGroup, 1)));
|
{
|
||||||
|
// if we reallocate memory then send the new pointer in
|
||||||
|
if (realloc(pGroup, CalculateGroupMemory(pGroup, 1)) != NULL)
|
||||||
|
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup);
|
||||||
|
}
|
||||||
|
|
||||||
// add the item
|
// add the item
|
||||||
pItem = pGroup->pItemArray + pGroup->cItemArray;
|
pItem = pGroup->pItemArray + pGroup->cItemArray;
|
||||||
|
|||||||
Reference in New Issue
Block a user