diff --git a/progmgr/group.c b/progmgr/group.c index f027eb4..326ed3d 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -99,7 +99,7 @@ HWND CreateGroupWindow(GROUP grp) // Unless... this just works a different way and I don't have to // keep track of all these stupid little pointers... since I can // just associate this with the appropriate window. - pGroup = (PGROUP)malloc(sizeof(grp) + sizeof(ITEM) * grp.cItemArray); + pGroup = (PGROUP)malloc(sizeof(grp) + sizeof(ITEM) * (grp.cItemArray + 1)); // Get group minimized/maximized flags @@ -124,7 +124,7 @@ HWND CreateGroupWindow(GROUP grp) return NULL; // Associate the group structure pointer to the group window - SetWindowLongPtr(hWndGroup, GWLP_USERDATA, pGroup); + SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup); // Load the group icon if (ExtractIconEx(grp.szIconPath, grp.iIconIndex, &hIconLarge, &hIconSmall, 1)) @@ -164,11 +164,6 @@ BOOL RemoveGroupWindow(HWND hWndGroup) // should group deletion be "abstracted" here or should i handle windows // and groups separately? - if ((hGroupHeap = GetWindowLongPtr(hWndGroup, GWLP_USERDATA)) != NULL) - { - if (HeapDestroy(hGroupHeap)) - return TRUE; - } return FALSE; } diff --git a/progmgr/group.h b/progmgr/group.h index f134754..4f97e26 100644 --- a/progmgr/group.h +++ b/progmgr/group.h @@ -13,10 +13,10 @@ /* Definitions */ #define MAX_GROUPS 512 #define MAX_ITEMS 512 -#define MAX_TITLE_LENGTH MAX_PATH +#define MAX_TITLE_LENGTH 255 // Same as the registry key name max length // Group Format Definitions #define GRP_SIGNATURE 0x47324D50L // PM2G -#define GRP_VERSION 1 // Increment for breaking changes +#define GRP_VERSION 2 // Increment for breaking changes, format version // Group Flag Values (DWORD) #define GRP_FLAG_COMMON 0x00000001 #define GRP_FLAG_READONLY 0x00000002 diff --git a/progmgr/resource.h b/progmgr/resource.h index 609b87d..4a357c5 100644 Binary files a/progmgr/resource.h and b/progmgr/resource.h differ