Skip to content

Commit

Permalink
feat: Added MessageWindow.InitMenuPopup event for #105.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 7, 2023
1 parent a557185 commit 18a1eba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libs/H.NotifyIcon/Core/MessageWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ namespace H.NotifyIcon.Core;
Description = "Fired if the taskbar was created or restarted. Requires the taskbar icon to be reset")]
[Event("DpiChanged",
Description = "Fired if dpi change window message received.")]
[Event("InitMenuPopup",
Description = "Sent when a drop-down menu or submenu is about to become active. " +
"This allows an application to modify the menu before it is displayed, " +
"without changing the entire menu.")]
[SupportedOSPlatform("windows5.0")]
public partial class MessageWindow : IDisposable
{
Expand Down Expand Up @@ -178,6 +182,10 @@ private void ProcessWindowMessage(uint msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case PInvoke.WM_INITMENUPOPUP:
_ = OnInitMenuPopup();
break;

case PInvoke.WM_DPICHANGED:
_ = OnDpiChanged();
break;
Expand Down
1 change: 1 addition & 0 deletions src/libs/H.NotifyIcon/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ WM_MBUTTONDOWN
WM_MBUTTONUP
WM_MBUTTONDBLCLK
WM_DPICHANGED
WM_INITMENUPOPUP
WM_USER
NIN_SELECT
NINF_KEY
Expand Down

0 comments on commit 18a1eba

Please sign in to comment.