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
|
||||

|
||||
|
||||
@@ -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.
|
||||
|
||||
## 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?
|
||||
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"
|
||||
WinRAR a -r "%~dp0bin\bin.rar" "%~dp0bin\*.exe"
|
||||
del /s "%~dp0bin\*.exe"
|
||||
pause
|
||||
@@ -111,7 +111,7 @@ LRESULT CALLBACK DeskWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
hWndDesktop = hWnd;
|
||||
|
||||
// Set the window position to shell
|
||||
SetShellWindow(hWndDesktop);
|
||||
// SetShellWindow(hWndDesktop);
|
||||
ShowWindow(hWndDesktop, SW_MAXIMIZE);
|
||||
|
||||
// Strip the border from the desktop window
|
||||
@@ -173,11 +173,12 @@ HWND CreateListView(HWND hWndParent, RECT rc)
|
||||
{
|
||||
HWND hWndListView;
|
||||
LVITEM lviTestItem;
|
||||
//WCHAR szTestItem[20] = L"Test Item\0";
|
||||
WCHAR szTestItem[] = L"Test Item";
|
||||
|
||||
// Create the ListView
|
||||
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,
|
||||
hWndParent, (HMENU)ID_LISTVIEW, hAppInstance,
|
||||
NULL);
|
||||
@@ -192,11 +193,11 @@ HWND CreateListView(HWND hWndParent, RECT rc)
|
||||
lviTestItem.iSubItem = 0;
|
||||
lviTestItem.state = 0;
|
||||
lviTestItem.stateMask = 0;
|
||||
//lviTestItem.pszText = &szTestItem;
|
||||
lviTestItem.pszText = (LPWSTR)&szTestItem;
|
||||
lviTestItem.cchTextMax = MAXTITLELEN;
|
||||
// lviTestItem.iImage = 1;
|
||||
|
||||
ListView_InsertItem(hWndListView, &lviTestItem);
|
||||
|
||||
return hWndListView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
GROUP.C -
|
||||
Copyright (c) 2023 freedom7341, Vortesys
|
||||
DESCRIPTION -
|
||||
Group window and program item functions.
|
||||
Group window and program group/item functions.
|
||||
LICENSE INFORMATION -
|
||||
MIT License, see LICENSE.txt in the root folder
|
||||
\* * * * * * * */
|
||||
@@ -15,4 +15,62 @@
|
||||
// #define WIN32_LEAN_AND_MEAN
|
||||
#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 -
|
||||
Copyright (c) 2023 freedom7341, Vortesys
|
||||
DESCRIPTION -
|
||||
Program group and item structures and... stuff.
|
||||
Program group/item structures, functions and definitons
|
||||
LICENSE INFORMATION -
|
||||
MIT License, see LICENSE.txt in the root folder
|
||||
\* * * * * * * */
|
||||
@@ -13,3 +13,58 @@
|
||||
/* Includes */
|
||||
#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 */
|
||||
#include "progmgr.h"
|
||||
#include "group.h"
|
||||
#include "resource.h"
|
||||
#include "registry.h"
|
||||
// #define WIN32_LEAN_AND_MEAN
|
||||
#define SECURITY_WIN32
|
||||
#include <Windows.h>
|
||||
#include <strsafe.h>
|
||||
#include <Lmcons.h>
|
||||
#include <security.h>
|
||||
|
||||
/* Variables */
|
||||
// Global
|
||||
BOOL bIsDefaultShell = FALSE;
|
||||
// Window Related
|
||||
HICON hProgMgrIcon = NULL;
|
||||
HICON hGroupIcon = NULL;
|
||||
HINSTANCE hAppInstance;
|
||||
HWND hWndProgMgr = NULL;
|
||||
HWND hWndMDIClient = NULL;
|
||||
// Global Strings
|
||||
WCHAR szAppTitle[32];
|
||||
WCHAR szProgMgr[] = L"progmgr";
|
||||
WCHAR szWebsite[64];
|
||||
// Window Related
|
||||
HICON hProgMgrIcon = NULL;
|
||||
HINSTANCE hAppInstance;
|
||||
HWND hWndProgMgr = NULL;
|
||||
HWND hWndMDIClient = NULL;
|
||||
WCHAR szClass[16];
|
||||
WCHAR szGrpClass[16];
|
||||
|
||||
/* Functions */
|
||||
|
||||
@@ -37,18 +38,15 @@ HWND hWndMDIClient = NULL;
|
||||
wWinMain -
|
||||
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 };
|
||||
HANDLE hAccel;
|
||||
HMENU hMenu;
|
||||
HMENU hSystemMenu;
|
||||
WNDCLASS wc = { 0 };
|
||||
WNDCLASSEX wce = { 0 };
|
||||
WCHAR szBuffer[MAX_PATH];
|
||||
WCHAR szClass[16];
|
||||
WCHAR szUsername[UNLEN + 1] = L"";
|
||||
DWORD dwUsernameLen = UNLEN;
|
||||
WCHAR szWindowTitle[UNLEN + ARRAYSIZE(szAppTitle) + 4] = L"";
|
||||
RECT rcRoot;
|
||||
POINT ptOffset;
|
||||
|
||||
@@ -56,25 +54,41 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||
|
||||
// Create Strings
|
||||
LoadString(hAppInstance, IDS_PMCLASS, szClass, ARRAYSIZE(szClass));
|
||||
LoadString(hAppInstance, IDS_GRPCLASS, szGrpClass, ARRAYSIZE(szGrpClass));
|
||||
LoadString(hAppInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle));
|
||||
LoadString(hAppInstance, IDS_WEBSITE, szWebsite, ARRAYSIZE(szWebsite));
|
||||
GetUserNameEx(NameSamCompatible, szUsername, &dwUsernameLen);
|
||||
|
||||
// Get Desktop background color
|
||||
//CreateSolidBrush(GetBackgroundColor
|
||||
|
||||
// Register the Frame Window
|
||||
// Register the Frame Window Class
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.hInstance = hAppInstance;
|
||||
wc.hIcon = hProgMgrIcon = LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_PROGMGR), IMAGE_ICON,
|
||||
0, 0, LR_DEFAULTSIZE | LR_SHARED);
|
||||
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.lpszClassName = szClass;
|
||||
if (!RegisterClass(&wc))
|
||||
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
|
||||
hAccel = LoadAccelerators(hAppInstance, MAKEINTRESOURCE(IDA_ACCELS));
|
||||
if (!hAccel)
|
||||
@@ -91,15 +105,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||
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
|
||||
GetWindowRect(GetDesktopWindow(), &rcRoot);
|
||||
|
||||
@@ -109,7 +114,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||
|
||||
// Create main window with a default size
|
||||
// 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 + 320, rcRoot.top + ptOffset.y + 240,
|
||||
0, 0, hAppInstance, NULL))
|
||||
@@ -126,13 +131,15 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||
hMenu = GetMenu(hWndProgMgr);
|
||||
hSystemMenu = GetSystemMenu(hWndProgMgr, FALSE);
|
||||
|
||||
// Update our menu checkmarks
|
||||
// Update relevant parts of the window
|
||||
UpdateChecks(bAutoArrange, IDM_OPTIONS, IDM_OPTIONS_AUTOARRANGE);
|
||||
UpdateChecks(bMinOnRun, IDM_OPTIONS, IDM_OPTIONS_MINONRUN);
|
||||
UpdateChecks(bTopMost, IDM_OPTIONS, IDM_OPTIONS_TOPMOST);
|
||||
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
||||
UpdateChecks(bSaveSettings, IDM_OPTIONS, IDM_OPTIONS_SAVESETTINGS);
|
||||
|
||||
UpdateWindowTitle();
|
||||
|
||||
// Update settings based on their values
|
||||
if (bTopMost)
|
||||
SetWindowPos(hWndProgMgr, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
|
||||
@@ -32,12 +32,15 @@
|
||||
// PROGMGR.C
|
||||
extern BOOL bIsDefaultShell;
|
||||
extern HICON hProgMgrIcon;
|
||||
extern HICON hGroupIcon;
|
||||
extern HINSTANCE hAppInstance;
|
||||
extern HWND hWndProgMgr;
|
||||
extern HWND hWndMDIClient;
|
||||
extern WCHAR szAppTitle[32];
|
||||
extern WCHAR szProgMgr[];
|
||||
extern WCHAR szWebsite[64];
|
||||
extern WCHAR szClass[16];
|
||||
extern WCHAR szGrpClass[16];
|
||||
|
||||
/* Function Prototypes */
|
||||
// DESKTOP.C
|
||||
@@ -49,4 +52,5 @@ BOOL SetShellWindow(HWND hWndShell);
|
||||
// WNDPROC.C
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, 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;
|
||||
|
||||
return bConfigStatus;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -9,10 +9,15 @@
|
||||
|
||||
/* Headers */
|
||||
#include "progmgr.h"
|
||||
#include "group.h"
|
||||
#include "resource.h"
|
||||
#include "registry.h"
|
||||
// #define WIN32_LEAN_AND_MEAN
|
||||
#define SECURITY_WIN32
|
||||
#include <Windows.h>
|
||||
#include <strsafe.h>
|
||||
#include <Lmcons.h>
|
||||
#include <security.h>
|
||||
|
||||
/* Functions */
|
||||
|
||||
@@ -26,78 +31,74 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
|
||||
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)
|
||||
case WM_CREATE:
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
if (wParam == IDM_SHUTDOWN)
|
||||
if (wParam == IDM_FILE_EXIT)
|
||||
if (wParam == IDM_FILE_RUN)
|
||||
case WM_SYSCOMMAND:
|
||||
{
|
||||
CmdProc(hWnd, wParam, lParam);
|
||||
break;
|
||||
if ((wParam >= IDM_MAIN) || (wParam <= IDM_TASKMGR))
|
||||
{
|
||||
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;
|
||||
//return DefFrameProc(hWnd, hwndMDIClient, uiMsg, wParam, lParam);
|
||||
}
|
||||
case WM_COMMAND:
|
||||
if (CmdProc(hWnd, wParam, lParam))
|
||||
return 0;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (CmdProc(hWnd, wParam, lParam))
|
||||
{
|
||||
goto WndProcDefault;
|
||||
|
||||
case WM_CLOSE:
|
||||
if (bSaveSettings)
|
||||
SaveConfig(TRUE, TRUE, TRUE);
|
||||
|
||||
if (bIsDefaultShell && (GetShellWindow() != NULL))
|
||||
SetShellWindow(0);
|
||||
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
goto WndProcDefault;
|
||||
|
||||
case WM_CLOSE:
|
||||
if (bSaveSettings)
|
||||
SaveConfig(TRUE, TRUE, TRUE);
|
||||
case WM_ENDSESSION:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
if (bIsDefaultShell && (GetShellWindow() != NULL))
|
||||
SetShellWindow(0);
|
||||
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_ENDSESSION:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
WndProcDefault:
|
||||
return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam);
|
||||
}
|
||||
return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -137,12 +138,13 @@ LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_OPTIONS_TOPMOST:
|
||||
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);
|
||||
goto SaveConfig;
|
||||
|
||||
case IDM_OPTIONS_SHOWUSERNAME:
|
||||
bShowUsername = !bShowUsername;
|
||||
UpdateWindowTitle();
|
||||
UpdateChecks(bShowUsername, IDM_OPTIONS, IDM_OPTIONS_SHOWUSERNAME);
|
||||
goto SaveConfig;
|
||||
|
||||
@@ -192,6 +194,36 @@ VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID)
|
||||
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 -
|
||||
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)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user