Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
Based on TranslucentFlyouts
  • Loading branch information
krlvm committed Jul 30, 2022
1 parent dd1678f commit 94074d3
Show file tree
Hide file tree
Showing 42 changed files with 2,358 additions and 347 deletions.
Binary file removed .github/images/win10-1.png
Binary file not shown.
Binary file removed .github/images/win10-2.png
Binary file not shown.
Binary file removed .github/images/win10-3.png
Binary file not shown.
Binary file removed .github/images/win10-4.png
Binary file not shown.
Binary file removed .github/images/win11-1.png
Binary file not shown.
35 changes: 24 additions & 11 deletions AcrylicMenus.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31702.278
VisualStudioVersion = 16.0.32510.428
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AcrylicMenus", "AcrylicMenus\AcrylicMenus\AcrylicMenus.vcxproj", "{FD755B75-9F8C-4974-87A8-A649A7BCC39F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AcrylicMenus", "AcrylicMenus\AcrylicMenus.vcxproj", "{97391729-9A04-40B0-9C0F-98FA395127AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AcrylicMenusLoader", "AcrylicMenusLoader\AcrylicMenusLoader.vcxproj", "{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}"
ProjectSection(ProjectDependencies) = postProject
{97391729-9A04-40B0-9C0F-98FA395127AB} = {97391729-9A04-40B0-9C0F-98FA395127AB}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -13,19 +18,27 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Debug|x64.ActiveCfg = Debug|x64
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Debug|x64.Build.0 = Debug|x64
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Debug|x86.ActiveCfg = Debug|Win32
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Debug|x86.Build.0 = Debug|Win32
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Release|x64.ActiveCfg = Release|x64
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Release|x64.Build.0 = Release|x64
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Release|x86.ActiveCfg = Release|Win32
{FD755B75-9F8C-4974-87A8-A649A7BCC39F}.Release|x86.Build.0 = Release|Win32
{97391729-9A04-40B0-9C0F-98FA395127AB}.Debug|x64.ActiveCfg = Debug|x64
{97391729-9A04-40B0-9C0F-98FA395127AB}.Debug|x64.Build.0 = Debug|x64
{97391729-9A04-40B0-9C0F-98FA395127AB}.Debug|x86.ActiveCfg = Debug|Win32
{97391729-9A04-40B0-9C0F-98FA395127AB}.Debug|x86.Build.0 = Debug|Win32
{97391729-9A04-40B0-9C0F-98FA395127AB}.Release|x64.ActiveCfg = Release|x64
{97391729-9A04-40B0-9C0F-98FA395127AB}.Release|x64.Build.0 = Release|x64
{97391729-9A04-40B0-9C0F-98FA395127AB}.Release|x86.ActiveCfg = Release|Win32
{97391729-9A04-40B0-9C0F-98FA395127AB}.Release|x86.Build.0 = Release|Win32
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Debug|x64.ActiveCfg = Debug|x64
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Debug|x64.Build.0 = Debug|x64
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Debug|x86.ActiveCfg = Debug|Win32
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Debug|x86.Build.0 = Debug|Win32
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Release|x64.ActiveCfg = Release|x64
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Release|x64.Build.0 = Release|x64
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Release|x86.ActiveCfg = Release|Win32
{0179CDEA-F39C-453B-AE1D-01590BC9FE4A}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {068F0C57-F5C3-48B4-88DE-E8694B0CEFDA}
SolutionGuid = {0A638377-CC3C-46C4-964C-31238394D52B}
EndGlobalSection
EndGlobal
108 changes: 108 additions & 0 deletions AcrylicMenus/AcrylicHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#pragma once
#include "pch.h"
#include "SystemHelper.h"
#include "AppearanceConfiguration.h"

namespace AcrylicMenus
{
namespace AcrylicHelper
{
typedef enum _WINDOWCOMPOSITIONATTRIBUTE
{
WCA_UNDEFINED,
WCA_NCRENDERING_ENABLED,
WCA_NCRENDERING_POLICY,
WCA_TRANSITIONS_FORCEDISABLED,
WCA_ALLOW_NCPAINT,
WCA_CAPTION_BUTTON_BOUNDS,
WCA_NONCLIENT_RTL_LAYOUT,
WCA_FORCE_ICONIC_REPRESENTATION,
WCA_EXTENDED_FRAME_BOUNDS,
WCA_HAS_ICONIC_BITMAP,
WCA_THEME_ATTRIBUTES,
WCA_NCRENDERING_EXILED,
WCA_NCADORNMENTINFO,
WCA_EXCLUDED_FROM_LIVEPREVIEW,
WCA_VIDEO_OVERLAY_ACTIVE,
WCA_FORCE_ACTIVEWINDOW_APPEARANCE,
WCA_DISALLOW_PEEK,
WCA_CLOAK,
WCA_CLOAKED,
WCA_ACCENT_POLICY,
WCA_FREEZE_REPRESENTATION,
WCA_EVER_UNCLOAKED,
WCA_VISUAL_OWNER,
WCA_HOLOGRAPHIC,
WCA_EXCLUDED_FROM_DDA,
WCA_PASSIVEUPDATEMODE,
WCA_USEDARKMODECOLORS,
WCA_CORNER_STYLE,
WCA_PART_COLOR,
WCA_DISABLE_MOVESIZE_FEEDBACK,
WCA_LAST
} WINDOWCOMPOSITIONATTRIBUTE;

typedef struct _WINDOWCOMPOSITIONATTRIBUTEDATA
{
WINDOWCOMPOSITIONATTRIBUTE Attribute;
PVOID pvData;
SIZE_T cbData;
} WINDOWCOMPOSITIONATTRIBUTEDATA;

typedef enum _ACCENT_STATE
{
ACCENT_DISABLED,
ACCENT_ENABLE_GRADIENT,
ACCENT_ENABLE_TRANSPARENTGRADIENT,
ACCENT_ENABLE_BLURBEHIND,
ACCENT_ENABLE_ACRYLICBLURBEHIND,
ACCENT_ENABLE_HOSTBACKDROP,
ACCENT_INVALID_STATE
} ACCENT_STATE;

typedef enum _ACCENT_FLAG
{
ACCENT_NONE_BORDER,
ACCENT_LEFT_BORDER = 0x20,
ACCENT_TOP_BORDER = 0x40,
ACCENT_RIGHT_BORDER = 0x80,
ACCENT_BOTTOM_BORDER = 0x100,
ACCENT_ALL_BORDER = (ACCENT_LEFT_BORDER | ACCENT_TOP_BORDER | ACCENT_RIGHT_BORDER | ACCENT_BOTTOM_BORDER),
ACCENT_WINDOWS11_LUMINOSITY = 0x2
} ACCENT_FLAG;

typedef struct _ACCENT_POLICY
{
ACCENT_STATE AccentState;
ACCENT_FLAG AccentFlags;
DWORD dwGradientColor;
DWORD dwAnimationId;
} ACCENT_POLICY;

typedef BOOL(WINAPI* pfnSetWindowCompositionAttribute)(HWND, WINDOWCOMPOSITIONATTRIBUTEDATA*);
static pfnSetWindowCompositionAttribute SetWindowCompositionAttribute
= (pfnSetWindowCompositionAttribute)GetProcAddress(GetModuleHandle(L"User32"), "SetWindowCompositionAttribute");

static BOOL SetAcrylicEffect(HWND hWnd, DWORD dwTintColor)
{
ACCENT_POLICY policy = {
ACCENT_ENABLE_ACRYLICBLURBEHIND,
SystemHelper::g_bIsWindows11 ? ACCENT_WINDOWS11_LUMINOSITY : ACCENT_ALL_BORDER,
dwTintColor,
0
};
WINDOWCOMPOSITIONATTRIBUTEDATA data = {
WCA_ACCENT_POLICY,
&policy,
sizeof(ACCENT_POLICY)
};

return SetWindowCompositionAttribute(hWnd, &data);
}

static BOOL SetAcrylicEffect(HWND hWnd, DWORD dwTintColor, DWORD dwOpacity)
{
return SetAcrylicEffect(hWnd, (dwOpacity << 24) | (dwTintColor & 0xFFFFFF));
}
}
}
Empty file removed AcrylicMenus/AcrylicMenus.cpp
Empty file.
106 changes: 80 additions & 26 deletions AcrylicMenus/AcrylicMenus.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -19,34 +19,35 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{97391729-9A04-40B0-9C0F-98FA395127AB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{9f0c38b8-acb9-4fb6-aeb2-9f883131847c}</ProjectGuid>
<RootNamespace>AcrylicMenus</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<ProjectName>AcrylicMenus</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand All @@ -73,75 +74,128 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;TRANSLUCENTFLYOUTS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;TRANSLUCENTFLYOUTS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;TRANSLUCENTFLYOUTS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;TRANSLUCENTFLYOUTS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AcrylicMenus.cpp" />
<ClInclude Include="AcrylicHelper.h" />
<ClInclude Include="AppearanceConfiguration.h" />
<ClInclude Include="DetoursHelper.h" />
<ClInclude Include="MenuHooks.h" />
<ClInclude Include="MenuHandler.h" />
<ClInclude Include="WindowHelper.h" />
<ClInclude Include="MenuManager.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="amapi.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="ThemeHelper.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="MenuHooks.cpp" />
<ClCompile Include="MenuHandler.cpp" />
<ClCompile Include="amapi.cpp" />
<ClCompile Include="MenuManager.cpp" />
<ClCompile Include="SystemHelper.h" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Detours.4.0.1\build\native\Detours.targets" Condition="Exists('..\packages\Detours.4.0.1\build\native\Detours.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Detours.4.0.1\build\native\Detours.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Detours.4.0.1\build\native\Detours.targets'))" />
</Target>
</Project>
Loading

0 comments on commit 94074d3

Please sign in to comment.