update group format variable names
This commit is contained in:
@@ -41,8 +41,8 @@ BOOL CALLBACK NewGroupDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM
|
||||
.ftLastWrite = 0,
|
||||
.szIconPath = L"",
|
||||
.iIconIndex = 0,
|
||||
.cItems = 0,
|
||||
.iItems = NULL
|
||||
.cItemArray = 0,
|
||||
.pItemArray = NULL
|
||||
};
|
||||
BOOL bOKEnabled = FALSE;
|
||||
WCHAR szBuffer[MAX_TITLE_LENGTH] = { L"\0" };
|
||||
@@ -64,8 +64,8 @@ BOOL CALLBACK NewGroupDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM
|
||||
grp.wVersion = GRP_VERSION;
|
||||
grp.wChecksum = 0;
|
||||
grp.dwFlags = 0;
|
||||
grp.cItems = 0;
|
||||
grp.iItems = NULL;
|
||||
grp.cItemArray = 0;
|
||||
grp.pItemArray = NULL;
|
||||
|
||||
// Set the window title
|
||||
LoadString(hAppInstance, IDS_DLT_GRP_NEW, szDlgTitle, ARRAYSIZE(szDlgTitle));
|
||||
|
||||
@@ -91,7 +91,7 @@ HWND CreateGroupWindow(GROUP grp)
|
||||
HICON hIconTemp = NULL;
|
||||
HWND hWndGroup = NULL;
|
||||
HWND hWndListView = NULL;
|
||||
HANDLE hGroupHeap = NULL;
|
||||
PGROUP pGroup = NULL;
|
||||
|
||||
// TODO: allocate memory for the group in the array
|
||||
// of group pointers in PGARRAY, then pass this to
|
||||
@@ -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.
|
||||
hGroupHeap = HeapCreate(HEAP_GENERATE_EXCEPTIONS, sizeof(grp), 0);
|
||||
pGroup = (PGROUP)malloc(sizeof(grp) + sizeof(ITEM) * grp.cItemArray);
|
||||
|
||||
// Get group minimized/maximized flags
|
||||
|
||||
@@ -123,8 +123,8 @@ HWND CreateGroupWindow(GROUP grp)
|
||||
if ((hWndGroup = (HWND)SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs)) == NULL)
|
||||
return NULL;
|
||||
|
||||
// Associate the group structure heap handle to the group window
|
||||
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, hGroupHeap);
|
||||
// Associate the group structure pointer to the group window
|
||||
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, pGroup);
|
||||
|
||||
// Load the group icon
|
||||
if (ExtractIconEx(grp.szIconPath, grp.iIconIndex, &hIconLarge, &hIconSmall, 1))
|
||||
@@ -194,8 +194,8 @@ GROUP SaveGroup(PGROUP pg)
|
||||
.szName = L"",
|
||||
.dwFlags = 0,
|
||||
.ftLastWrite = 0,
|
||||
.cItems = 0,
|
||||
.iItems = NULL
|
||||
.cItemArray = 0,
|
||||
.pItemArray = NULL
|
||||
};
|
||||
HWND hWndGrp = NULL;
|
||||
WCHAR szGroupName[MAX_TITLE_LENGTH];
|
||||
@@ -218,7 +218,7 @@ GROUP SaveGroup(PGROUP pg)
|
||||
GetSystemTimeAsFileTime(&grp.ftLastWrite);
|
||||
|
||||
// Save items...
|
||||
grp.cItems = 0;
|
||||
grp.cItemArray = 0;
|
||||
// TODO: iterate through listview to save items
|
||||
|
||||
return grp;
|
||||
|
||||
@@ -58,8 +58,8 @@ typedef struct _GROUP {
|
||||
WCHAR szIconPath[MAX_PATH + 1];
|
||||
INT iIconIndex;
|
||||
// Items
|
||||
WORD cItems; // Number of items
|
||||
PITEM iItems; // Array of items
|
||||
WORD cItemArray; // Number of items in pItemArray
|
||||
PITEM pItemArray; // Array of items
|
||||
} GROUP, * PGROUP;
|
||||
|
||||
/* Global Variables */
|
||||
|
||||
@@ -127,8 +127,9 @@ DWORD SaveGroupToRegistry(_In_ PGROUP pg)
|
||||
return RCE_FAILURE;
|
||||
|
||||
// Save group
|
||||
// TODO: save items properly
|
||||
if (!RegSetValueEx(hKeyProgramGroups, pg->szName, 0, REG_BINARY,
|
||||
(const BYTE*)pg, (sizeof(*pg) + sizeof(ITEM) * pg->cItems)) == ERROR_SUCCESS)
|
||||
(const BYTE*)pg, (sizeof(*pg) + sizeof(ITEM) * pg->cItemArray)) == ERROR_SUCCESS)
|
||||
dwConfigStatus = dwConfigStatus && RCE_GROUPS;
|
||||
|
||||
return dwConfigStatus;
|
||||
|
||||
Reference in New Issue
Block a user