added manifest, renamed the run dialog function

This commit is contained in:
freedom
2023-07-21 01:37:36 -06:00
parent 292b58be46
commit 8a2a2c6d21
8 changed files with 95 additions and 9 deletions

View File

@@ -43,11 +43,12 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
HMENU hMenu;
HMENU hSystemMenu;
WNDCLASS wc = { 0 };
WCHAR szBuffer[256];
WCHAR szBuffer[MAX_PATH];
WCHAR szClass[16];
WCHAR szUsername[UNLEN + 1] = L"";
DWORD dwUsernameLen = UNLEN;
WCHAR szWindowTitle[UNLEN + ARRAYSIZE(szAppTitle) + 4] = L"";
RECT rWorkArea;
hAppInstance = hInstance;
@@ -99,7 +100,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
hSystemMenu = GetSystemMenu(hWndProgMgr, FALSE);
if (bIsDefaultShell) {
// Do all the fun stuff since we're the default shell
// Modify the context menus since we're the default shell
DeleteMenu(hSystemMenu, SC_CLOSE, MF_BYCOMMAND);
LoadString(hAppInstance, IDS_SHUTDOWN, szBuffer, ARRAYSIZE(szBuffer));
@@ -111,6 +112,14 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
LoadString(hAppInstance, IDS_TASKMGR, szBuffer, ARRAYSIZE(szBuffer));
InsertMenu(hSystemMenu, 6, MF_BYPOSITION | MF_STRING, IDM_TASKMGR, szBuffer);
// 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.
SystemParametersInfo(SPI_SETWORKAREA, 0, (PVOID)&rWorkArea, SPIF_SENDCHANGE);
}
while (GetMessage(&msg, NULL, 0, 0) > 0)

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
type="win32"
name="FreedomDesktop.ProgramManagerII.ProgMgr"
version="1.2.3.4"
processorArchitecture="*"
/>
<description>Program Manager II</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<!--
UAC settings:
- app should run at same integrity level as calling process
- app does not need to manipulate windows belonging to
higher-integrity-level processes
-->
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -9,9 +9,6 @@
/* Pragmas */
#pragma once
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#pragma comment(lib, "Shlwapi.lib")
#pragma comment(lib, "Secur32.lib")
@@ -44,7 +41,7 @@ extern WCHAR szWebsite[64];
/* Function Prototypes */
// SHELLINT.C
BOOL RunFile(HWND hWndOwner, HICON hIcon, LPWSTR lpszDir, LPWSTR lpszTitle, LPWSTR lpszDesc, DWORD dwFlags);
BOOL RunFileDlg(HWND hWndOwner, HICON hIcon, LPWSTR lpszDir, LPWSTR lpszTitle, LPWSTR lpszDesc, DWORD dwFlags);
BOOL ExitWindowsDialog(HWND hWndOwner);
// WNDPROC.C
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

View File

@@ -73,18 +73,22 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(OutDir)</IntDir>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(OutDir)</IntDir>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(OutDir)</IntDir>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(OutDir)</IntDir>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -98,6 +102,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<ManifestFile>$(IntDir)$(TargetName)$(TargetExt).manifest</ManifestFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -116,6 +121,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<ManifestFile>$(IntDir)$(TargetName)$(TargetExt).manifest</ManifestFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -130,6 +136,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<ManifestFile>$(IntDir)$(TargetName)$(TargetExt).manifest</ManifestFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -148,6 +155,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<ManifestFile>$(IntDir)$(TargetName)$(TargetExt).manifest</ManifestFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -170,6 +178,9 @@
<ItemGroup>
<None Include="version.inc" />
</ItemGroup>
<ItemGroup>
<Manifest Include="progmgr.exe.manifest" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -35,6 +35,15 @@
<ClCompile Include="registry.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="desktop.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="shellint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wndproc.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
@@ -52,4 +61,9 @@
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Manifest Include="progmgr.exe.manifest">
<Filter>Resource Files</Filter>
</Manifest>
</ItemGroup>
</Project>

View File

@@ -25,6 +25,9 @@ IDI_PROGITM ICON icons\pmitem.ico
/* Secondary Icon Library */
/* Manifest */
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "progmgr.exe.manifest"
/* Version Information */
#define APSTUDIO_HIDDEN_SYMBOLS
#include "version.inc"

View File

@@ -14,12 +14,12 @@
/* Functions */
/* * * *\
RunFile -
RunFileDlg -
Produces a Run dialog window.
RETURNS -
True if successful, false if unsuccessful.
\* * * */
BOOL RunFile(HWND hWndOwner,
BOOL RunFileDlg(HWND hWndOwner,
HICON hIcon,
LPWSTR lpszDir,
LPWSTR lpszTitle,

View File

@@ -106,7 +106,7 @@ LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
break;
case IDM_FILE_RUN:
RunFile(hWnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
RunFileDlg(hWnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
break;
case IDM_FILE_EXIT: