Win32Menu 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Win32Menu --version 1.0.0
                    
NuGet\Install-Package Win32Menu -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Win32Menu" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Win32Menu" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Win32Menu" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Win32Menu --version 1.0.0
                    
#r "nuget: Win32Menu, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Win32Menu@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Win32Menu&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Win32Menu&version=1.0.0
                    
Install as a Cake Tool

Win32Menu

English | 简体中文

Introduction

Highly encapsulated Win32 native menu implementation

MIT LICENSE

Built with 『CsWin32』

Shared publicly - feel free to try it!

By AuthorZiXi ❤️

How to Use

  1. Reference the Win32Menu project or download via NuGet (will be uploaded soon)
  2. The core class NativeMenu is fully documented - check the comments
  3. For detailed examples:
    • Download the project or visit 『GitHub』
    • Review two demos demonstrating usage in WinForms and WPF
    • Prefer Win32MenuWinFormsDemo for more comprehensive menu styles

Limitations?

  • Initially designed without support for popup menu methods
  • Does not currently support menu icons
  • Not recommended to interfere with menu class through external methods

Rant

Honestly, Win32 API feels anti-human by modern standards, especially in OOP languages.

It's bizarre how modifying submenu items requires parent menu intervention.

Developing this revealed odd behaviors in GetMenuItemInfo/SetMenuItemInfo - even when returning success, data was incorrect.

Ultimately resorted to ModifyMenu for synchronization despite its limitations.

Motivation

The concept originated from:

  1. Observing menu implementations in some krkr games
  2. Dissatisfaction with default WinForms menu styling
  3. Partial implementations in abandoned project 『LeafFallEngine』
Product Compatible and additional computed target framework versions.
.NET net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 98 7/18/2025
1.0.0 134 7/14/2025