Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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.
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ 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\0";
|
||||||
|
|
||||||
// Create the ListView
|
// Create the ListView
|
||||||
hWndListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, L"",
|
hWndListView = CreateWindowEx(WS_EX_LEFT, WC_LISTVIEW, L"",
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
// #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
|
||||||
@@ -37,7 +34,7 @@ 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;
|
||||||
@@ -46,9 +43,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
WNDCLASS wc = { 0 };
|
WNDCLASS wc = { 0 };
|
||||||
WCHAR szBuffer[MAX_PATH];
|
WCHAR szBuffer[MAX_PATH];
|
||||||
WCHAR szClass[16];
|
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;
|
||||||
|
|
||||||
@@ -58,7 +52,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||||||
LoadString(hAppInstance, IDS_PMCLASS, szClass, ARRAYSIZE(szClass));
|
LoadString(hAppInstance, IDS_PMCLASS, szClass, ARRAYSIZE(szClass));
|
||||||
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
|
||||||
@@ -91,15 +84,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 +93,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 +110,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);
|
||||||
|
|||||||
@@ -50,3 +50,4 @@ BOOL SetShellWindow(HWND hWndShell);
|
|||||||
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();
|
||||||
@@ -12,7 +12,11 @@
|
|||||||
#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 */
|
||||||
|
|
||||||
@@ -137,12 +141,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 +197,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.
|
||||||
|
|||||||
Reference in New Issue
Block a user