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,
|
.ftLastWrite = 0,
|
||||||
.szIconPath = L"",
|
.szIconPath = L"",
|
||||||
.iIconIndex = 0,
|
.iIconIndex = 0,
|
||||||
.cItems = 0,
|
.cItemArray = 0,
|
||||||
.iItems = NULL
|
.pItemArray = NULL
|
||||||
};
|
};
|
||||||
BOOL bOKEnabled = FALSE;
|
BOOL bOKEnabled = FALSE;
|
||||||
WCHAR szBuffer[MAX_TITLE_LENGTH] = { L"\0" };
|
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.wVersion = GRP_VERSION;
|
||||||
grp.wChecksum = 0;
|
grp.wChecksum = 0;
|
||||||
grp.dwFlags = 0;
|
grp.dwFlags = 0;
|
||||||
grp.cItems = 0;
|
grp.cItemArray = 0;
|
||||||
grp.iItems = NULL;
|
grp.pItemArray = NULL;
|
||||||
|
|
||||||
// Set the window title
|
// Set the window title
|
||||||
LoadString(hAppInstance, IDS_DLT_GRP_NEW, szDlgTitle, ARRAYSIZE(szDlgTitle));
|
LoadString(hAppInstance, IDS_DLT_GRP_NEW, szDlgTitle, ARRAYSIZE(szDlgTitle));
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ HWND CreateGroupWindow(GROUP grp)
|
|||||||
HICON hIconTemp = NULL;
|
HICON hIconTemp = NULL;
|
||||||
HWND hWndGroup = NULL;
|
HWND hWndGroup = NULL;
|
||||||
HWND hWndListView = NULL;
|
HWND hWndListView = NULL;
|
||||||
HANDLE hGroupHeap = NULL;
|
PGROUP pGroup = NULL;
|
||||||
|
|
||||||
// TODO: allocate memory for the group in the array
|
// TODO: allocate memory for the group in the array
|
||||||
// of group pointers in PGARRAY, then pass this to
|
// 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
|
// Unless... this just works a different way and I don't have to
|
||||||
// keep track of all these stupid little pointers... since I can
|
// keep track of all these stupid little pointers... since I can
|
||||||
// just associate this with the appropriate window.
|
// 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
|
// 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)
|
if ((hWndGroup = (HWND)SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Associate the group structure heap handle to the group window
|
// Associate the group structure pointer to the group window
|
||||||
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, hGroupHeap);
|
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, pGroup);
|
||||||
|
|
||||||
// Load the group icon
|
// Load the group icon
|
||||||
if (ExtractIconEx(grp.szIconPath, grp.iIconIndex, &hIconLarge, &hIconSmall, 1))
|
if (ExtractIconEx(grp.szIconPath, grp.iIconIndex, &hIconLarge, &hIconSmall, 1))
|
||||||
@@ -194,8 +194,8 @@ GROUP SaveGroup(PGROUP pg)
|
|||||||
.szName = L"",
|
.szName = L"",
|
||||||
.dwFlags = 0,
|
.dwFlags = 0,
|
||||||
.ftLastWrite = 0,
|
.ftLastWrite = 0,
|
||||||
.cItems = 0,
|
.cItemArray = 0,
|
||||||
.iItems = NULL
|
.pItemArray = NULL
|
||||||
};
|
};
|
||||||
HWND hWndGrp = NULL;
|
HWND hWndGrp = NULL;
|
||||||
WCHAR szGroupName[MAX_TITLE_LENGTH];
|
WCHAR szGroupName[MAX_TITLE_LENGTH];
|
||||||
@@ -218,7 +218,7 @@ GROUP SaveGroup(PGROUP pg)
|
|||||||
GetSystemTimeAsFileTime(&grp.ftLastWrite);
|
GetSystemTimeAsFileTime(&grp.ftLastWrite);
|
||||||
|
|
||||||
// Save items...
|
// Save items...
|
||||||
grp.cItems = 0;
|
grp.cItemArray = 0;
|
||||||
// TODO: iterate through listview to save items
|
// TODO: iterate through listview to save items
|
||||||
|
|
||||||
return grp;
|
return grp;
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ typedef struct _GROUP {
|
|||||||
WCHAR szIconPath[MAX_PATH + 1];
|
WCHAR szIconPath[MAX_PATH + 1];
|
||||||
INT iIconIndex;
|
INT iIconIndex;
|
||||||
// Items
|
// Items
|
||||||
WORD cItems; // Number of items
|
WORD cItemArray; // Number of items in pItemArray
|
||||||
PITEM iItems; // Array of items
|
PITEM pItemArray; // Array of items
|
||||||
} GROUP, * PGROUP;
|
} GROUP, * PGROUP;
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
|||||||
@@ -127,8 +127,9 @@ DWORD SaveGroupToRegistry(_In_ PGROUP pg)
|
|||||||
return RCE_FAILURE;
|
return RCE_FAILURE;
|
||||||
|
|
||||||
// Save group
|
// Save group
|
||||||
|
// TODO: save items properly
|
||||||
if (!RegSetValueEx(hKeyProgramGroups, pg->szName, 0, REG_BINARY,
|
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;
|
dwConfigStatus = dwConfigStatus && RCE_GROUPS;
|
||||||
|
|
||||||
return dwConfigStatus;
|
return dwConfigStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user