groups coming sooner than expected... or later i guess, i was supposed to have this done 2 weeks ago
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
/* Variables */
|
/* Variables */
|
||||||
WNDCLASSEX wcGrp;
|
WNDCLASSEX wcGrp;
|
||||||
WCHAR szGrpClass[16];
|
WCHAR szGrpClass[16];
|
||||||
PGROUP pgArray[];
|
|
||||||
HWND hWndMDIClient = NULL;
|
HWND hWndMDIClient = NULL;
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
@@ -81,7 +80,7 @@ BOOL InitializeGroups()
|
|||||||
CreateGroupWindow -
|
CreateGroupWindow -
|
||||||
Create an MDI window from a group structure
|
Create an MDI window from a group structure
|
||||||
RETURNS -
|
RETURNS -
|
||||||
Pointer to the new group window
|
Handle to the new group window
|
||||||
or NULL on failure
|
or NULL on failure
|
||||||
\* * * */
|
\* * * */
|
||||||
HWND CreateGroupWindow(GROUP grp)
|
HWND CreateGroupWindow(GROUP grp)
|
||||||
@@ -92,11 +91,15 @@ 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;
|
||||||
|
|
||||||
// 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
|
||||||
// the group window in that little pointer thing :D
|
// the group window in that little pointer thing :D
|
||||||
|
// 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);
|
||||||
|
|
||||||
// Get group minimized/maximized flags
|
// Get group minimized/maximized flags
|
||||||
|
|
||||||
@@ -120,6 +123,9 @@ 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
|
||||||
|
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, hGroupHeap);
|
||||||
|
|
||||||
// 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))
|
||||||
{
|
{
|
||||||
@@ -143,6 +149,30 @@ HWND CreateGroupWindow(GROUP grp)
|
|||||||
return hWndGroup;
|
return hWndGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* * * *\
|
||||||
|
RemoveGroupWindow -
|
||||||
|
Removes and cleans up a group window
|
||||||
|
RETURNS -
|
||||||
|
TRUE if cleanup is successful,
|
||||||
|
FALSE otherwise.
|
||||||
|
\* * * */
|
||||||
|
BOOL RemoveGroupWindow(HWND hWndGroup)
|
||||||
|
{
|
||||||
|
HANDLE hGroupHeap = NULL;
|
||||||
|
|
||||||
|
// TODO: do I handle group deletion from registry in here as well?
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* * * *\
|
/* * * *\
|
||||||
SaveGroup -
|
SaveGroup -
|
||||||
Saves group from a group window
|
Saves group from a group window
|
||||||
|
|||||||
@@ -72,5 +72,6 @@ BOOL InitializeGroups();
|
|||||||
// Group Window
|
// Group Window
|
||||||
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
HWND CreateGroupWindow(GROUP grp);
|
HWND CreateGroupWindow(GROUP grp);
|
||||||
|
BOOL RemoveGroupWindow(HWND hWndGroup);
|
||||||
// Import/export functions
|
// Import/export functions
|
||||||
GROUP SaveGroup(PGROUP pg);
|
GROUP SaveGroup(PGROUP pg);
|
||||||
|
|||||||
Reference in New Issue
Block a user