diff --git a/Program-Manager-II.sln b/Program-Manager-II.sln index 75ae527..e2c7e4a 100644 --- a/Program-Manager-II.sln +++ b/Program-Manager-II.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.6.33723.286 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "progmgr", "progmgr\progmgr.vcxproj", "{B76B940D-B61A-456E-8569-72F64CF91AFB}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProgMgr", "ProgMgr\ProgMgr.vcxproj", "{B76B940D-B61A-456E-8569-72F64CF91AFB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/progmgr/desktop.c b/progmgr/desktop.c deleted file mode 100644 index f3dce4b..0000000 --- a/progmgr/desktop.c +++ /dev/null @@ -1,202 +0,0 @@ -/* * * * * * * *\ - DESKTOP.C - - Copyright (c) 2024 Vortesys, Brady McDermott - DESCRIPTION - - Program Manager's desktop window. - Only visible as the default shell. - LICENSE INFORMATION - - MIT License, see LICENSE.txt in the root folder -\* * * * * * * */ - -/* Headers */ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include "progmgr.h" -#include "resource.h" - -/* Structures */ -typedef struct _mrp -{ - HWND hWndMRP; - DWORD dwFlags; -} MRP, * PMRP; - -/* Defines */ -// MRP Flags -#define MRP_ICONIFIED 0x000000001 -#define MRP_FLASHING 0x000000002 -// Miscellaneous -#define MAXTITLELEN 256 -#define ID_LISTVIEW 1000 - -/* Variables */ -HWND hWndDesktop; -HWND hWndDesktopListView; -RECT rcRoot; - -/* Functions */ -LRESULT CALLBACK DeskWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -HWND CreateListView(HWND hWndParent, RECT rc); - -/* * * *\ - CreateDesktopWindow - - Creates the invisible desktop window. - RETURNS - - True if successful, false if unsuccessful. -\* * * */ -BOOL CreateDesktopWindow(VOID) -{ - MSG msg = { 0 }; - WNDCLASSEX wc = { 0 }; - WCHAR szBuffer[MAX_PATH]; - WCHAR szClass[16]; - - // If we fail, we shouldn't be here anyways. - //if (GetShellWindow()) - // return FALSE; - - // Get size of the root HWND - GetWindowRect(GetDesktopWindow(), &rcRoot); - - // Load the window class string - LoadString(hAppInstance, IDS_DTCLASS, szClass, ARRAYSIZE(szClass)); - - // Refresh the wallpaper... - SystemParametersInfo(SPI_GETDESKWALLPAPER, MAX_PATH, szBuffer, 0); - SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, szBuffer, SPIF_SENDCHANGE); - - // Reset the work area (removes dead-space after switching from another shell) - // May have unintended consequences. Doesn't work with multiple monitors. - SystemParametersInfo(SPI_SETWORKAREA, 0, &rcRoot, SPIF_SENDCHANGE); - - // Register the desktop window - wc.cbSize = sizeof(WNDCLASSEX); - wc.lpfnWndProc = DeskWndProc; - wc.hInstance = hAppInstance; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)GetStockObject(COLOR_WINDOW); - wc.style = CS_NOCLOSE; - wc.lpszClassName = szClass; - if (!RegisterClassEx(&wc)) - return FALSE; - - if (CreateWindowEx(WS_EX_TOOLWINDOW, wc.lpszClassName, - NULL, WS_VISIBLE, rcRoot.left, rcRoot.top, - rcRoot.right - rcRoot.left, rcRoot.bottom - rcRoot.top, - NULL, NULL, hAppInstance, NULL) == NULL); - return 2; - - while (GetMessage(&msg, NULL, 0, 0) > 0) - { - DispatchMessage(&msg); - } - - return TRUE; -} - -/* * * *\ - DeskWndProc - - Program Manager's desktop window procedure. - RETURNS - - Zero if nothing, otherwise returns the good stuff. -\* * * */ -LRESULT CALLBACK DeskWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - - case WM_CREATE: - // Populate hWndDesktop - hWndDesktop = hWnd; - - // Set the window position to shell - // SetShellWindow(hWndDesktop); - ShowWindow(hWndDesktop, SW_MAXIMIZE); - - // Strip the border from the desktop window - SetWindowLongPtr(hWndDesktop, GWL_STYLE, WS_POPUP); - - // Size the window to take up the primary monitor's desktop - SetWindowPos(hWndDesktop, HWND_BOTTOM, - rcRoot.left, rcRoot.top, rcRoot.right - rcRoot.left, rcRoot.bottom - rcRoot.top, - SWP_FRAMECHANGED | SWP_NOACTIVATE); - - // Finally, bring Program Manager to the foreground. - SetWindowPos(hWndProgMgr, HWND_TOP, - 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - - // Finally, Create the ListView control - //hWndListView = CreateListView(hWndDesktop, rcRoot); - - break; - - case WM_ACTIVATE: - case WM_DISPLAYCHANGE: - case WM_DEVICECHANGE: - // Get size of the root HWND - GetWindowRect(GetDesktopWindow(), &rcRoot); - SetWindowPos(hWndDesktop, HWND_BOTTOM, - rcRoot.left, rcRoot.top, rcRoot.right - rcRoot.left, rcRoot.bottom - rcRoot.top, - SWP_NOACTIVATE); - //if (hWndListView) - // SetWindowPos(hWndListView, hWndDesktop, - // rcRoot.left, rcRoot.top, rcRoot.right - rcRoot.left, rcRoot.bottom - rcRoot.top, - // SWP_NOZORDER | SWP_NOACTIVATE); - break; - - case WM_WINDOWPOSCHANGING: - case WM_SYSCOMMAND: - case WM_COMMAND: - break; - - case WM_DESTROY: - case WM_CLOSE: - break; - - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - return 0; - -} - -/* * * *\ - CreateListView - - Creates the Desktop's ListView. - RETURNS - - HWND to the listview if successfull, - NULL otherwise. -\* * * */ -HWND CreateListView(HWND hWndParent, RECT rc) -{ - HWND hWndDesktopListView; - LVITEM lviTestItem; - WCHAR szTestItem[] = TEXT("Test Item"); - - // Create the ListView - hWndDesktopListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, TEXT(""), - WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | - LVS_ICON | LVS_SINGLESEL, - rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, - hWndParent, (HMENU)ID_LISTVIEW, hAppInstance, - NULL); - - if(hWndDesktopListView == NULL) - return NULL; - - ListView_SetBkColor(hWndDesktopListView, CLR_NONE); - - lviTestItem.mask = LVIF_STATE | LVIF_TEXT; - lviTestItem.iItem = 0; - lviTestItem.iSubItem = 0; - lviTestItem.state = 0; - lviTestItem.stateMask = 0; - lviTestItem.pszText = (LPWSTR)&szTestItem; - lviTestItem.cchTextMax = MAXTITLELEN; - // lviTestItem.iImage = 1; - - ListView_InsertItem(hWndDesktopListView, &lviTestItem); - - return hWndDesktopListView; -} diff --git a/progmgr/desktop2.c b/progmgr/desktop2.c deleted file mode 100644 index 4095cc3..0000000 --- a/progmgr/desktop2.c +++ /dev/null @@ -1,44 +0,0 @@ -/* * * * * * * *\ - DESKTOP2.C - - Copyright (c) 2024 Vortesys, Brady McDermott - DESCRIPTION - - Program Manager's desktop window. - Displays running programs. - LICENSE INFORMATION - - MIT License, see LICENSE.txt in the root folder -\* * * * * * * */ - -/* Headers */ -#include -#include "progmgr.h" - -/* Structures */ -typedef struct _DPI -{ - HWND hWnd; - HICON hIcon; - DWORD dwFlags; -} DPI, * PDPI; - -/* * * *\ - CreateDesktopWindow2 - - Creates the desktop window. - RETURNS - - TRUE if created successfully, - FALSE if otherwise. -\* * * */ -BOOL CreateDesktopWindow2(VOID) -{ - // TODO: - // Create window, resize it to the size of the screen - // possibly create child windows for other monitors - // color the window invisible, get list of running - // programs and then draw them all and capture their - // system menus as context menus for each icon. - - // FUNCTIONS TODO: - // QueryRunningPrograms() - // DrawProgramIcon(DWORD dwFlags) - // - return TRUE; -} \ No newline at end of file diff --git a/progmgr/progmgr.h b/progmgr/progmgr.h index 16c6265..0d6ecc3 100644 --- a/progmgr/progmgr.h +++ b/progmgr/progmgr.h @@ -50,8 +50,6 @@ extern BOOL bPermPower; // Has power option permissions /* Function Prototypes */ BOOL UpdatePermissions(VOID); -// DESKTOP.C -BOOL CreateDesktopWindow(VOID); // SYSINT.C BOOL RunFileDlg(HWND hWndOwner, HICON hIcon, LPWSTR lpszDir, LPWSTR lpszTitle, LPWSTR lpszDesc, DWORD dwFlags); BOOL ExitWindowsDialog(HWND hWndOwner); diff --git a/progmgr/progmgr.vcxproj b/progmgr/progmgr.vcxproj index 51e1ece..8e195dd 100644 --- a/progmgr/progmgr.vcxproj +++ b/progmgr/progmgr.vcxproj @@ -177,8 +177,6 @@ - - diff --git a/progmgr/progmgr.vcxproj.filters b/progmgr/progmgr.vcxproj.filters index 2a26198..0b86c3d 100644 --- a/progmgr/progmgr.vcxproj.filters +++ b/progmgr/progmgr.vcxproj.filters @@ -16,6 +16,9 @@ {71dbbd6d-c82a-4fac-a0ff-74be88190f82} + + {2a11d118-5a5c-4681-86dc-31de4f0251ff} + @@ -44,9 +47,6 @@ Source Files - - Source Files - Source Files @@ -59,19 +59,16 @@ Source Files - - Source Files - Resource Files - - Language Resources - - Language Resources + Resource Files\en-US + + + Resource Files\en-US