Skip to content

Commit

Permalink
working on #17, program mdi window is now created and sized properly,…
Browse files Browse the repository at this point in the history
… close to completing the group part once i finish... registry functions and a group dialog
  • Loading branch information
freedom7341 committed Aug 10, 2023
1 parent ba27611 commit fbdb45b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions progmgr/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ BOOL InitializeGroups()
{
CLIENTCREATESTRUCT ccs = { 0 };
WNDCLASSEX wce = { 0 };
RECT rcFrame;

// Create the MDI Client Window
ccs.hWindowMenu = GetSubMenu(GetMenu(hWndProgMgr), IDM_WINDOW);
ccs.idFirstChild = IDM_WINDOW_CHILDSTART;

GetClientRect(hWndProgMgr, &rcFrame);

if (!(hWndMDIClient = CreateWindowEx(WS_EX_COMPOSITED, L"MDIClient",
NULL, WS_CLIPCHILDREN | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
rcFrame.left, rcFrame.top, rcFrame.right, rcFrame.bottom,
hWndProgMgr, (HMENU)1, hAppInstance, (LPWSTR)&ccs)))
{
return FALSE;
Expand All @@ -70,7 +73,7 @@ BOOL InitializeGroups()

// TempCreateGroup();

// CreateGroupWindow(NULL);
CreateGroupWindow(NULL);

return TRUE;
}
Expand All @@ -89,12 +92,12 @@ VOID TempCreateGroup()

/* * * *\
CreateGroupWindow -
Create an MDI window from a group
Create an MDI window from a group structure
RETURNS -
Group Window structure
or NULL GROUPWND on failure
Pointer to a group window structure
or NULL on failure
\* * * */
GROUPWND CreateGroupWindow(PGROUP pgGroup)
PGROUPWND CreateGroupWindow(PGROUP pgGroup)
{
GROUPWND gw = { NULL };
MDICREATESTRUCT mcs = { NULL };
Expand All @@ -113,11 +116,10 @@ GROUPWND CreateGroupWindow(PGROUP pgGroup)
mcs.style = WS_VISIBLE;
mcs.lParam = (LPARAM)pgGroup;

hGroup = (HWND)SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs);
if (!hGroup)
return gw;
if (!(hGroup = (HWND)SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs)))
return NULL;

return gw;
return NULL;
}

/* * * *\
Expand Down
2 changes: 1 addition & 1 deletion progmgr/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BOOL InitializeGroups();
VOID TempCreateGroup();
// Group Window
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
GROUPWND CreateGroupWindow(PGROUP pgGroup);
PGROUPWND CreateGroupWindow(PGROUP pgGroup);
// Group information
DWORD GetGroupFlags(PGROUPWND pgw);
// Import/export functions
Expand Down

0 comments on commit fbdb45b

Please sign in to comment.