Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
456426f7bf | ||
|
|
c1f6cc41ac | ||
|
|
f6d8a032d3 | ||
|
|
c16ebce58c | ||
|
|
dbd33f1e5d | ||
|
|
e333bec949 | ||
|
|
4cf88a12af | ||
|
|
738cb64646 | ||
|
|
1206264a68 | ||
|
|
8ab85cecf0 | ||
|
|
c963301105 | ||
|
|
c62bc10490 | ||
|
|
9518a5e30b | ||
|
|
90d4fce8aa |
@@ -1,4 +1,4 @@
|
|||||||
[](/releases) [](/releases)
|
[](https://github.com/Vortesys/Program-Manager-II/releases) [](https://github.com/Vortesys/Program-Manager-II/releases)
|
||||||
# Program Manager *II* for Windows NT
|
# Program Manager *II* for Windows NT
|
||||||

|

|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ Program Manager was the shell that shipped with Microsoft Windows by default fro
|
|||||||
Program Manager should run on ~~every AMD64 version of Windows and every 32-bit version back to 2000. The ultimate goal is to run on NT 3.51 just as well as it can run on Windows 11~~ Windows Vista and above.
|
Program Manager should run on ~~every AMD64 version of Windows and every 32-bit version back to 2000. The ultimate goal is to run on NT 3.51 just as well as it can run on Windows 11~~ Windows Vista and above.
|
||||||
|
|
||||||
## Where do I get it?
|
## Where do I get it?
|
||||||
The [releases page](/releases) will contain the latest version of Program Manager.
|
The [releases page](https://github.com/Vortesys/Program-Manager-II/releases) will contain the latest version of Program Manager.
|
||||||
|
|
||||||
## How can I help?
|
## How can I help?
|
||||||
Submitting [issues](/issues) with bug reports, suggestions or comments always helps. If you're able to, contributing with a [pull request](/pulls) is much appreciated.
|
Submitting [issues](https://github.com/Vortesys/Program-Manager-II/issues) with bug reports, suggestions or comments always helps. If you're able to, contributing with a [pull request](https://github.com/Vortesys/Program-Manager-II/pulls) is much appreciated.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
7z a -r "%~dp0bin\bin.7z" "%~dp0bin\*.exe"
|
7z a -r "%~dp0bin\bin.7z" "%~dp0bin\*.exe"
|
||||||
WinRAR a -r "%~dp0bin\bin.rar" "%~dp0bin\*.exe"
|
WinRAR a -r "%~dp0bin\bin.rar" "%~dp0bin\*.exe"
|
||||||
|
del /s "%~dp0bin\*.exe"
|
||||||
pause
|
pause
|
||||||
@@ -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[20] = 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,11 +193,11 @@ 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 = (LPWSTR)&szTestItem;
|
||||||
lviTestItem.cchTextMax = MAXTITLELEN;
|
lviTestItem.cchTextMax = MAXTITLELEN;
|
||||||
// lviTestItem.iImage = 1;
|
// lviTestItem.iImage = 1;
|
||||||
|
|
||||||
ListView_InsertItem(hWndListView, &lviTestItem);
|
ListView_InsertItem(hWndListView, &lviTestItem);
|
||||||
|
|
||||||
return hWndListView;
|
return hWndListView;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
GROUP.C -
|
GROUP.C -
|
||||||
Copyright (c) 2023 freedom7341, Vortesys
|
Copyright (c) 2023 freedom7341, Vortesys
|
||||||
DESCRIPTION -
|
DESCRIPTION -
|
||||||
Group window and program item functions.
|
Group window and program group/item functions.
|
||||||
LICENSE INFORMATION -
|
LICENSE INFORMATION -
|
||||||
MIT License, see LICENSE.txt in the root folder
|
MIT License, see LICENSE.txt in the root folder
|
||||||
\* * * * * * * */
|
\* * * * * * * */
|
||||||
@@ -15,4 +15,62 @@
|
|||||||
// #define WIN32_LEAN_AND_MEAN
|
// #define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
/* Functions */
|
/* Variables */
|
||||||
|
WNDCLASSEX wcGrp;
|
||||||
|
|
||||||
|
/* Functions */
|
||||||
|
|
||||||
|
/* * * *\
|
||||||
|
GroupWndProc -
|
||||||
|
Group window procedure.
|
||||||
|
RETURNS -
|
||||||
|
Zero if nothing, otherwise returns the good stuff.
|
||||||
|
\* * * */
|
||||||
|
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_CREATE:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// GroupProcDefault:
|
||||||
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * *\
|
||||||
|
InitGroups -
|
||||||
|
Initialize variables for the betterment of groups forever
|
||||||
|
Make great glorious MDI Client
|
||||||
|
RETURNS -
|
||||||
|
Zero if nothing, otherwise returns the good stuff.
|
||||||
|
\* * * */
|
||||||
|
|
||||||
|
/* * * *\
|
||||||
|
TempCreateGroup -
|
||||||
|
th
|
||||||
|
RETURNS -
|
||||||
|
handle to window
|
||||||
|
\* * * */
|
||||||
|
HWND TempCreateGroup(HWND hMDIClient)
|
||||||
|
{
|
||||||
|
MDICREATESTRUCT mcs;
|
||||||
|
HWND hChild;
|
||||||
|
|
||||||
|
mcs.szClass = szGrpClass;
|
||||||
|
mcs.szTitle = L"";
|
||||||
|
mcs.hOwner = hAppInstance;
|
||||||
|
mcs.x = mcs.y = mcs.cx = mcs.cy = CW_USEDEFAULT;
|
||||||
|
mcs.style = WS_VISIBLE;
|
||||||
|
|
||||||
|
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs);
|
||||||
|
// if (!hChild)
|
||||||
|
// {
|
||||||
|
// MessageBox(hMDIClient, L"MDI Child creation failed.", L"Oh Oh...",
|
||||||
|
// MB_ICONEXCLAMATION | MB_OK);
|
||||||
|
// }
|
||||||
|
return hChild;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
GROUP.H -
|
GROUP.H -
|
||||||
Copyright (c) 2023 freedom7341, Vortesys
|
Copyright (c) 2023 freedom7341, Vortesys
|
||||||
DESCRIPTION -
|
DESCRIPTION -
|
||||||
Program group and item structures and... stuff.
|
Program group/item structures, functions and definitons
|
||||||
LICENSE INFORMATION -
|
LICENSE INFORMATION -
|
||||||
MIT License, see LICENSE.txt in the root folder
|
MIT License, see LICENSE.txt in the root folder
|
||||||
\* * * * * * * */
|
\* * * * * * * */
|
||||||
@@ -13,3 +13,58 @@
|
|||||||
/* Includes */
|
/* Includes */
|
||||||
#include <wtypes.h>
|
#include <wtypes.h>
|
||||||
|
|
||||||
|
/* Definitions */
|
||||||
|
#define MAX_GROUPS 512
|
||||||
|
#define MAX_ITEMS 512
|
||||||
|
#define MAX_TITLE_LENGTH MAX_PATH
|
||||||
|
// Group Format Definitions
|
||||||
|
#define GRP_SIGNATURE 0x47324D50L // PM2G
|
||||||
|
// Group Flag Values (DWORD)
|
||||||
|
#define GRP_FLAG_COMMON 0x00000001
|
||||||
|
#define GRP_FLAG_READONLY 0x00000002
|
||||||
|
#define GRP_FLAG_MINIMIZED 0x00000004
|
||||||
|
#define GRP_FLAG_MAXIMIZED 0x00000008
|
||||||
|
|
||||||
|
/* Structures */
|
||||||
|
// Item Structure
|
||||||
|
typedef struct _ITEM {
|
||||||
|
// Item executable and name
|
||||||
|
WCHAR szItemName[MAX_TITLE_LENGTH];
|
||||||
|
WCHAR szExecPath[MAX_PATH]; // Path of the item executable
|
||||||
|
WCHAR szWorkPath[MAX_PATH]; // Working directory
|
||||||
|
|
||||||
|
// Icon
|
||||||
|
WCHAR szIconPath[MAX_PATH]; // Path of the icon
|
||||||
|
UINT uiIconIndex; // Index of the icon
|
||||||
|
} ITEM, * PITEM;
|
||||||
|
|
||||||
|
// Group format, .GRP
|
||||||
|
typedef struct _GROUP {
|
||||||
|
// Group file header
|
||||||
|
DWORD dwSignature; // Set to GRP_SIGNATURE
|
||||||
|
WORD wVersion; // Group format version
|
||||||
|
WORD wChecksum;
|
||||||
|
|
||||||
|
// Group information
|
||||||
|
WCHAR szGroupName[MAX_TITLE_LENGTH];
|
||||||
|
DWORD dwFlags; // Use with GRP_FLAG_* values.
|
||||||
|
FILETIME ftLastWrite;
|
||||||
|
|
||||||
|
// Items
|
||||||
|
WORD cItems; // Number of items
|
||||||
|
PITEM iItems; // Array of items
|
||||||
|
} GROUP, * PGROUP;
|
||||||
|
|
||||||
|
// Group window information
|
||||||
|
typedef struct _GROUPWND {
|
||||||
|
// Window information
|
||||||
|
HWND hWndGroup;
|
||||||
|
RECT rcGroup; // Window rectangle
|
||||||
|
|
||||||
|
// Group information
|
||||||
|
HANDLE hGroup; // Handle to GROUP object
|
||||||
|
} GROUPINFO, * PGROUPINFO;
|
||||||
|
|
||||||
|
/* Function Prototypes */
|
||||||
|
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
HWND TempCreateGroup(HWND hMDIClient);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
Binary file not shown.
@@ -9,27 +9,28 @@
|
|||||||
|
|
||||||
/* Headers */
|
/* Headers */
|
||||||
#include "progmgr.h"
|
#include "progmgr.h"
|
||||||
|
#include "group.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "registry.h"
|
#include "registry.h"
|
||||||
// #define WIN32_LEAN_AND_MEAN
|
// #define WIN32_LEAN_AND_MEAN
|
||||||
#define SECURITY_WIN32
|
#define SECURITY_WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <strsafe.h>
|
|
||||||
#include <Lmcons.h>
|
|
||||||
#include <security.h>
|
|
||||||
|
|
||||||
/* Variables */
|
/* Variables */
|
||||||
// Global
|
// Global
|
||||||
BOOL bIsDefaultShell = FALSE;
|
BOOL bIsDefaultShell = FALSE;
|
||||||
|
// Window Related
|
||||||
|
HICON hProgMgrIcon = NULL;
|
||||||
|
HICON hGroupIcon = NULL;
|
||||||
|
HINSTANCE hAppInstance;
|
||||||
|
HWND hWndProgMgr = NULL;
|
||||||
|
HWND hWndMDIClient = NULL;
|
||||||
// Global Strings
|
// Global Strings
|
||||||
WCHAR szAppTitle[32];
|
WCHAR szAppTitle[32];
|
||||||
WCHAR szProgMgr[] = L"progmgr";
|
WCHAR szProgMgr[] = L"progmgr";
|
||||||
WCHAR szWebsite[64];
|
WCHAR szWebsite[64];
|
||||||
// Window Related
|
WCHAR szClass[16];
|
||||||
HICON hProgMgrIcon = NULL;
|
WCHAR szGrpClass[16];
|
||||||
HINSTANCE hAppInstance;
|
|
||||||
HWND hWndProgMgr = NULL;
|
|
||||||
HWND hWndMDIClient = NULL;
|
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
@@ -37,18 +38,15 @@ HWND hWndMDIClient = NULL;
|
|||||||
wWinMain -
|
wWinMain -
|
||||||
Program Manager's entry point.
|
Program Manager's entry point.
|
||||||
\* * * */
|
\* * * */
|
||||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
|
||||||
{
|
{
|
||||||
MSG msg = { 0 };
|
MSG msg = { 0 };
|
||||||
HANDLE hAccel;
|
HANDLE hAccel;
|
||||||
HMENU hMenu;
|
HMENU hMenu;
|
||||||
HMENU hSystemMenu;
|
HMENU hSystemMenu;
|
||||||
WNDCLASS wc = { 0 };
|
WNDCLASS wc = { 0 };
|
||||||
|
WNDCLASSEX wce = { 0 };
|
||||||
WCHAR szBuffer[MAX_PATH];
|
WCHAR szBuffer[MAX_PATH];
|
||||||
WCHAR szClass[16];
|
|
||||||
WCHAR szUsername[UNLEN + 1] = L"";
|
|
||||||
DWORD dwUsernameLen = UNLEN;
|
|
||||||
WCHAR szWindowTitle[UNLEN + ARRAYSIZE(szAppTitle) + 4] = L"";
|
|
||||||
RECT rcRoot;
|
RECT rcRoot;
|
||||||
POINT ptOffset;
|
POINT ptOffset;
|
||||||
|
|
||||||
@@ -56,25 +54,41 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
|
|
||||||
// Create Strings
|
// Create Strings
|
||||||
LoadString(hAppInstance, IDS_PMCLASS, szClass, ARRAYSIZE(szClass));
|
LoadString(hAppInstance, IDS_PMCLASS, szClass, ARRAYSIZE(szClass));
|
||||||
|
LoadString(hAppInstance, IDS_GRPCLASS, szGrpClass, ARRAYSIZE(szGrpClass));
|
||||||
LoadString(hAppInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle));
|
LoadString(hAppInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle));
|
||||||
LoadString(hAppInstance, IDS_WEBSITE, szWebsite, ARRAYSIZE(szWebsite));
|
LoadString(hAppInstance, IDS_WEBSITE, szWebsite, ARRAYSIZE(szWebsite));
|
||||||
GetUserNameEx(NameSamCompatible, szUsername, &dwUsernameLen);
|
|
||||||
|
|
||||||
// Get Desktop background color
|
// Get Desktop background color
|
||||||
//CreateSolidBrush(GetBackgroundColor
|
//CreateSolidBrush(GetBackgroundColor
|
||||||
|
|
||||||
// Register the Frame Window
|
// Register the Frame Window Class
|
||||||
wc.lpfnWndProc = WndProc;
|
wc.lpfnWndProc = WndProc;
|
||||||
wc.hInstance = hAppInstance;
|
wc.hInstance = hAppInstance;
|
||||||
wc.hIcon = hProgMgrIcon = LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_PROGMGR), IMAGE_ICON,
|
wc.hIcon = hProgMgrIcon = LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_PROGMGR), IMAGE_ICON,
|
||||||
0, 0, LR_DEFAULTSIZE | LR_SHARED);
|
0, 0, LR_DEFAULTSIZE | LR_SHARED);
|
||||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
|
// wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
|
||||||
|
wc.hbrBackground = NULL;
|
||||||
wc.lpszMenuName = MAKEINTRESOURCE(IDM_MAIN);
|
wc.lpszMenuName = MAKEINTRESOURCE(IDM_MAIN);
|
||||||
wc.lpszClassName = szClass;
|
wc.lpszClassName = szClass;
|
||||||
if (!RegisterClass(&wc))
|
if (!RegisterClass(&wc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
// Register the Group Window Class
|
||||||
|
wce.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
wce.lpfnWndProc = GroupWndProc;
|
||||||
|
wce.cbClsExtra = 0;
|
||||||
|
wce.cbWndExtra = 0;
|
||||||
|
wce.hInstance = hAppInstance;
|
||||||
|
wce.hIcon = hGroupIcon = LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_PROGGRP), IMAGE_ICON,
|
||||||
|
0, 0, LR_DEFAULTSIZE | LR_SHARED);
|
||||||
|
wce.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
|
wce.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||||
|
wce.lpszMenuName = NULL;
|
||||||
|
wce.lpszClassName = szGrpClass;
|
||||||
|
if (!RegisterClassEx(&wce))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
// Load the Accelerator table
|
// Load the Accelerator table
|
||||||
hAccel = LoadAccelerators(hAppInstance, MAKEINTRESOURCE(IDA_ACCELS));
|
hAccel = LoadAccelerators(hAppInstance, MAKEINTRESOURCE(IDA_ACCELS));
|
||||||
if (!hAccel)
|
if (!hAccel)
|
||||||
@@ -91,15 +105,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add username to window title if settings permit
|
|
||||||
StringCchCopy(szWindowTitle, ARRAYSIZE(szAppTitle), szAppTitle);
|
|
||||||
|
|
||||||
if (bShowUsername)
|
|
||||||
{
|
|
||||||
StringCchCat(szWindowTitle, ARRAYSIZE(szWindowTitle), L" - ");
|
|
||||||
StringCchCat(szWindowTitle, ARRAYSIZE(szWindowTitle), szUsername);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get size of the root HWND
|
// Get size of the root HWND
|
||||||
GetWindowRect(GetDesktopWindow(), &rcRoot);
|
GetWindowRect(GetDesktopWindow(), &rcRoot);
|
||||||
|
|
||||||
@@ -109,7 +114,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
|
|
||||||
// Create main window with a default size
|
// Create main window with a default size
|
||||||
// NOTE: i pulled 320x240 out of my ass, make this dynamic later
|
// NOTE: i pulled 320x240 out of my ass, make this dynamic later
|
||||||
if (!CreateWindow(wc.lpszClassName, szWindowTitle, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
if (!CreateWindow(wc.lpszClassName, szAppTitle, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||||
rcRoot.left + ptOffset.x, rcRoot.top + ptOffset.y,
|
rcRoot.left + ptOffset.x, rcRoot.top + ptOffset.y,
|
||||||
rcRoot.left + ptOffset.x + 320, rcRoot.top + ptOffset.y + 240,
|
rcRoot.left + ptOffset.x + 320, rcRoot.top + ptOffset.y + 240,
|
||||||
0, 0, hAppInstance, NULL))
|
0, 0, hAppInstance, NULL))
|
||||||
@@ -126,13 +131,15 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
hMenu = GetMenu(hWndProgMgr);
|
hMenu = GetMenu(hWndProgMgr);
|
||||||
hSystemMenu = GetSystemMenu(hWndProgMgr, FALSE);
|
hSystemMenu = GetSystemMenu(hWndProgMgr, FALSE);
|
||||||
|
|
||||||
// Update our menu checkmarks
|
// Update relevant parts of the window
|
||||||
UpdateChecks(bAutoArrange, IDM_OPTIONS, IDM_OPTIONS_AUTOARRANGE);
|
UpdateChecks(bAutoArrange, IDM_OPTIONS, IDM_OPTIONS_AUTOARRANGE);
|
||||||
UpdateChecks(bMinOnRun, IDM_OPTIONS, IDM_OPTIONS_MINONRUN);
|
UpdateChecks(bMinOnRun, IDM_OPTIONS, IDM_OPTIONS_MINONRUN);
|
||||||
UpdateChecks(bTopMost, IDM_OPTIONS, IDM_OPTIONS_TOPMOST);
|
UpdateChecks(bTopMost, IDM_OPTIONS, IDM_OPTIONS_TOPMOST);
|
||||||
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
||||||
UpdateChecks(bSaveSettings, IDM_OPTIONS, IDM_OPTIONS_SAVESETTINGS);
|
UpdateChecks(bSaveSettings, IDM_OPTIONS, IDM_OPTIONS_SAVESETTINGS);
|
||||||
|
|
||||||
|
UpdateWindowTitle();
|
||||||
|
|
||||||
// Update settings based on their values
|
// Update settings based on their values
|
||||||
if (bTopMost)
|
if (bTopMost)
|
||||||
SetWindowPos(hWndProgMgr, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
SetWindowPos(hWndProgMgr, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
|||||||
@@ -32,12 +32,15 @@
|
|||||||
// PROGMGR.C
|
// PROGMGR.C
|
||||||
extern BOOL bIsDefaultShell;
|
extern BOOL bIsDefaultShell;
|
||||||
extern HICON hProgMgrIcon;
|
extern HICON hProgMgrIcon;
|
||||||
|
extern HICON hGroupIcon;
|
||||||
extern HINSTANCE hAppInstance;
|
extern HINSTANCE hAppInstance;
|
||||||
extern HWND hWndProgMgr;
|
extern HWND hWndProgMgr;
|
||||||
extern HWND hWndMDIClient;
|
extern HWND hWndMDIClient;
|
||||||
extern WCHAR szAppTitle[32];
|
extern WCHAR szAppTitle[32];
|
||||||
extern WCHAR szProgMgr[];
|
extern WCHAR szProgMgr[];
|
||||||
extern WCHAR szWebsite[64];
|
extern WCHAR szWebsite[64];
|
||||||
|
extern WCHAR szClass[16];
|
||||||
|
extern WCHAR szGrpClass[16];
|
||||||
|
|
||||||
/* Function Prototypes */
|
/* Function Prototypes */
|
||||||
// DESKTOP.C
|
// DESKTOP.C
|
||||||
@@ -49,4 +52,5 @@ BOOL SetShellWindow(HWND hWndShell);
|
|||||||
// WNDPROC.C
|
// WNDPROC.C
|
||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||||
VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID);
|
VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID);
|
||||||
|
VOID UpdateWindowTitle();
|
||||||
|
|||||||
@@ -187,4 +187,4 @@ BOOL LoadConfig()
|
|||||||
bConfigStatus = FALSE;
|
bConfigStatus = FALSE;
|
||||||
|
|
||||||
return bConfigStatus;
|
return bConfigStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -9,10 +9,15 @@
|
|||||||
|
|
||||||
/* Headers */
|
/* Headers */
|
||||||
#include "progmgr.h"
|
#include "progmgr.h"
|
||||||
|
#include "group.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "registry.h"
|
#include "registry.h"
|
||||||
// #define WIN32_LEAN_AND_MEAN
|
// #define WIN32_LEAN_AND_MEAN
|
||||||
|
#define SECURITY_WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <strsafe.h>
|
||||||
|
#include <Lmcons.h>
|
||||||
|
#include <security.h>
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
@@ -26,78 +31,74 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
|
case WM_CREATE:
|
||||||
case WM_CREATE:
|
|
||||||
{
|
|
||||||
RECT rc;
|
|
||||||
CLIENTCREATESTRUCT ccs;
|
|
||||||
|
|
||||||
// Frame Window
|
|
||||||
hWndProgMgr = hWnd;
|
|
||||||
|
|
||||||
// MDI Client Window
|
|
||||||
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), IDM_WINDOW);
|
|
||||||
ccs.idFirstChild = IDM_WINDOW_CHILDSTART;
|
|
||||||
|
|
||||||
GetClientRect(hWndProgMgr, &rc);
|
|
||||||
|
|
||||||
hWndMDIClient = CreateWindow(L"MDIClient", NULL,
|
|
||||||
WS_CLIPCHILDREN | WS_CHILD | WS_VSCROLL | WS_HSCROLL,
|
|
||||||
// rc.left - 1, rc.top - 1, rc.right + 2, rc.bottom + 2,
|
|
||||||
0, 0, 0, 0,
|
|
||||||
hWnd, (HMENU)1, hAppInstance, (LPWSTR)&ccs);
|
|
||||||
|
|
||||||
if (!hWndMDIClient) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_SYSCOMMAND:
|
|
||||||
{
|
|
||||||
if (wParam == IDM_TASKMGR)
|
|
||||||
{
|
{
|
||||||
ShellExecute(hWndProgMgr, L"open", L"TASKMGR.EXE", NULL, NULL, SW_NORMAL);
|
CLIENTCREATESTRUCT ccs;
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
// Frame Window
|
||||||
|
hWndProgMgr = hWnd;
|
||||||
|
|
||||||
|
// Create the MDI Client Window
|
||||||
|
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), IDM_WINDOW);
|
||||||
|
ccs.idFirstChild = IDM_WINDOW_CHILDSTART;
|
||||||
|
|
||||||
|
GetClientRect(hWndProgMgr, &rc);
|
||||||
|
|
||||||
|
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,
|
||||||
|
hWnd, (HMENU)1, hAppInstance, (LPWSTR)&ccs)))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TempCreateGroup(hWndMDIClient);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == IDM_SHUTDOWN)
|
case WM_SYSCOMMAND:
|
||||||
if (wParam == IDM_FILE_EXIT)
|
|
||||||
if (wParam == IDM_FILE_RUN)
|
|
||||||
{
|
{
|
||||||
CmdProc(hWnd, wParam, lParam);
|
if ((wParam >= IDM_MAIN) || (wParam <= IDM_TASKMGR))
|
||||||
break;
|
{
|
||||||
|
if (wParam == IDM_TASKMGR)
|
||||||
|
{
|
||||||
|
ShellExecute(hWndProgMgr, L"open", L"TASKMGR.EXE", NULL, NULL, SW_NORMAL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CmdProc(hWnd, wParam, lParam))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
goto WndProcDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
goto WndProcDefault;
|
case WM_COMMAND:
|
||||||
//return DefFrameProc(hWnd, hwndMDIClient, uiMsg, wParam, lParam);
|
if (CmdProc(hWnd, wParam, lParam))
|
||||||
}
|
return 0;
|
||||||
|
|
||||||
case WM_COMMAND:
|
goto WndProcDefault;
|
||||||
if (CmdProc(hWnd, wParam, lParam))
|
|
||||||
{
|
case WM_CLOSE:
|
||||||
|
if (bSaveSettings)
|
||||||
|
SaveConfig(TRUE, TRUE, TRUE);
|
||||||
|
|
||||||
|
if (bIsDefaultShell && (GetShellWindow() != NULL))
|
||||||
|
SetShellWindow(0);
|
||||||
|
|
||||||
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
goto WndProcDefault;
|
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_ENDSESSION:
|
||||||
if (bSaveSettings)
|
PostQuitMessage(0);
|
||||||
SaveConfig(TRUE, TRUE, TRUE);
|
break;
|
||||||
|
|
||||||
if (bIsDefaultShell && (GetShellWindow() != NULL))
|
default:
|
||||||
SetShellWindow(0);
|
|
||||||
|
|
||||||
PostQuitMessage(0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WM_ENDSESSION:
|
|
||||||
PostQuitMessage(0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
WndProcDefault:
|
WndProcDefault:
|
||||||
return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam);
|
return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -137,12 +138,13 @@ LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case IDM_OPTIONS_TOPMOST:
|
case IDM_OPTIONS_TOPMOST:
|
||||||
bTopMost = !bTopMost;
|
bTopMost = !bTopMost;
|
||||||
SetWindowPos(hWndProgMgr, bTopMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
|
SetWindowPos(hWndProgMgr, bTopMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||||
UpdateChecks(bTopMost, IDM_OPTIONS, IDM_OPTIONS_TOPMOST);
|
UpdateChecks(bTopMost, IDM_OPTIONS, IDM_OPTIONS_TOPMOST);
|
||||||
goto SaveConfig;
|
goto SaveConfig;
|
||||||
|
|
||||||
case IDM_OPTIONS_SHOWUSERNAME:
|
case IDM_OPTIONS_SHOWUSERNAME:
|
||||||
bShowUsername = !bShowUsername;
|
bShowUsername = !bShowUsername;
|
||||||
|
UpdateWindowTitle();
|
||||||
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
||||||
goto SaveConfig;
|
goto SaveConfig;
|
||||||
|
|
||||||
@@ -192,6 +194,36 @@ VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* * * *\
|
||||||
|
UpdateWindowTitle -
|
||||||
|
Updates Window title based on settings... and
|
||||||
|
current foreground group window if applicable?
|
||||||
|
RETURNS -
|
||||||
|
Nothing!
|
||||||
|
\* * * */
|
||||||
|
VOID UpdateWindowTitle()
|
||||||
|
{
|
||||||
|
WCHAR szUsername[UNLEN + 1] = L"";
|
||||||
|
DWORD dwUsernameLen = UNLEN;
|
||||||
|
WCHAR szWindowTitle[UNLEN + ARRAYSIZE(szAppTitle) + 4] = L"";
|
||||||
|
|
||||||
|
// Get user and domain name
|
||||||
|
GetUserNameEx(NameSamCompatible, szUsername, &dwUsernameLen);
|
||||||
|
|
||||||
|
// Add username to window title if settings permit
|
||||||
|
StringCchCopy(szWindowTitle, ARRAYSIZE(szAppTitle), szAppTitle);
|
||||||
|
|
||||||
|
if (bShowUsername)
|
||||||
|
{
|
||||||
|
StringCchCat(szWindowTitle, ARRAYSIZE(szWindowTitle), L" - ");
|
||||||
|
StringCchCat(szWindowTitle, ARRAYSIZE(szWindowTitle), szUsername);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetWindowText(hWndProgMgr, (LPCWSTR)&szWindowTitle);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* * * *\
|
/* * * *\
|
||||||
ChildWndProc -
|
ChildWndProc -
|
||||||
Program Manager's window procedure.
|
Program Manager's window procedure.
|
||||||
@@ -201,4 +233,4 @@ VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID)
|
|||||||
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user