something something desktop window blah blah blah WE HAVE MDI!!!!
This commit is contained in:
@@ -111,7 +111,7 @@ LRESULT CALLBACK DeskWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
|||||||
hWndDesktop = hWnd;
|
hWndDesktop = hWnd;
|
||||||
|
|
||||||
// Set the window position to shell
|
// Set the window position to shell
|
||||||
SetShellWindow(hWndDesktop);
|
// SetShellWindow(hWndDesktop);
|
||||||
ShowWindow(hWndDesktop, SW_MAXIMIZE);
|
ShowWindow(hWndDesktop, SW_MAXIMIZE);
|
||||||
|
|
||||||
// Strip the border from the desktop window
|
// Strip the border from the desktop window
|
||||||
@@ -173,11 +173,12 @@ HWND CreateListView(HWND hWndParent, RECT rc)
|
|||||||
{
|
{
|
||||||
HWND hWndListView;
|
HWND hWndListView;
|
||||||
LVITEM lviTestItem;
|
LVITEM lviTestItem;
|
||||||
//WCHAR szTestItem[] = L"Test Item\0";
|
WCHAR szTestItem[] = L"Test Item";
|
||||||
|
|
||||||
// Create the ListView
|
// Create the ListView
|
||||||
hWndListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, L"",
|
hWndListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, L"",
|
||||||
WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_ICON | LVS_SINGLESEL,
|
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
|
||||||
|
LVS_ICON | LVS_SINGLESEL,
|
||||||
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
|
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
|
||||||
hWndParent, (HMENU)ID_LISTVIEW, hAppInstance,
|
hWndParent, (HMENU)ID_LISTVIEW, hAppInstance,
|
||||||
NULL);
|
NULL);
|
||||||
@@ -192,7 +193,7 @@ HWND CreateListView(HWND hWndParent, RECT rc)
|
|||||||
lviTestItem.iSubItem = 0;
|
lviTestItem.iSubItem = 0;
|
||||||
lviTestItem.state = 0;
|
lviTestItem.state = 0;
|
||||||
lviTestItem.stateMask = 0;
|
lviTestItem.stateMask = 0;
|
||||||
//lviTestItem.pszText = &szTestItem;
|
lviTestItem.pszText = &szTestItem;
|
||||||
lviTestItem.cchTextMax = MAXTITLELEN;
|
lviTestItem.cchTextMax = MAXTITLELEN;
|
||||||
// lviTestItem.iImage = 1;
|
// lviTestItem.iImage = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
GrpProcDefault:
|
// GrpProcDefault:
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -49,18 +49,17 @@ HWND TempCreateGroup(HWND hMDIClient)
|
|||||||
MDICREATESTRUCT mcs;
|
MDICREATESTRUCT mcs;
|
||||||
HWND hChild;
|
HWND hChild;
|
||||||
|
|
||||||
mcs.szTitle = L"[Untitled]";
|
|
||||||
mcs.szClass = szGrpClass;
|
mcs.szClass = szGrpClass;
|
||||||
mcs.hOwner = GetModuleHandle(NULL);
|
mcs.szTitle = L"";
|
||||||
mcs.x = mcs.cx = CW_USEDEFAULT;
|
mcs.hOwner = hAppInstance;
|
||||||
mcs.y = mcs.cy = CW_USEDEFAULT;
|
mcs.x = mcs.y = mcs.cx = mcs.cy = CW_USEDEFAULT;
|
||||||
mcs.style = MDIS_ALLCHILDSTYLES;
|
mcs.style = WS_VSCROLL | WS_HSCROLL;
|
||||||
|
|
||||||
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)&mcs);
|
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs);
|
||||||
if (!hChild)
|
// if (!hChild)
|
||||||
{
|
// {
|
||||||
MessageBox(hMDIClient, L"MDI Child creation failed.", L"Oh Oh...",
|
// MessageBox(hMDIClient, L"MDI Child creation failed.", L"Oh Oh...",
|
||||||
MB_ICONEXCLAMATION | MB_OK);
|
// MB_ICONEXCLAMATION | MB_OK);
|
||||||
}
|
// }
|
||||||
return hChild;
|
return hChild;
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -39,7 +39,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
// Frame Window
|
// Frame Window
|
||||||
hWndProgMgr = hWnd;
|
hWndProgMgr = hWnd;
|
||||||
|
|
||||||
// MDI Client Window
|
// Create the MDI Client Window
|
||||||
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), IDM_WINDOW);
|
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), IDM_WINDOW);
|
||||||
ccs.idFirstChild = IDM_WINDOW_CHILDSTART;
|
ccs.idFirstChild = IDM_WINDOW_CHILDSTART;
|
||||||
|
|
||||||
@@ -47,7 +47,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
if (!(hWndMDIClient = CreateWindowEx(WS_EX_COMPOSITED, L"MDIClient",
|
if (!(hWndMDIClient = CreateWindowEx(WS_EX_COMPOSITED, L"MDIClient",
|
||||||
NULL, WS_CLIPCHILDREN | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
|
NULL, WS_CLIPCHILDREN | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
|
||||||
// rc.left - 1, rc.top - 1, rc.right + 2, rc.bottom + 2,
|
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
hWnd, (HMENU)1, hAppInstance, (LPWSTR)&ccs)))
|
hWnd, (HMENU)1, hAppInstance, (LPWSTR)&ccs)))
|
||||||
{
|
{
|
||||||
@@ -66,7 +65,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (wParam == IDM_TASKMGR)
|
if (wParam == IDM_TASKMGR)
|
||||||
{
|
{
|
||||||
ShellExecute(hWndProgMgr, L"open", L"TASKMGR.EXE", NULL, NULL, SW_NORMAL);
|
ShellExecute(hWndProgMgr, L"open", L"TASKMGR.EXE", NULL, NULL, SW_NORMAL);
|
||||||
break;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CmdProc(hWnd, wParam, lParam))
|
if (CmdProc(hWnd, wParam, lParam))
|
||||||
@@ -78,7 +77,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (CmdProc(hWnd, wParam, lParam))
|
if (CmdProc(hWnd, wParam, lParam))
|
||||||
break;
|
return 0;
|
||||||
|
|
||||||
goto WndProcDefault;
|
goto WndProcDefault;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user