Skip to content

feat : add new feature doubleClick LMB, context menu RMB update : Demo project update, add pseudo animation#5

Open
anomal3 wants to merge 1 commit intoBip901:mainfrom
anomal3:feature
Open

feat : add new feature doubleClick LMB, context menu RMB update : Demo project update, add pseudo animation#5
anomal3 wants to merge 1 commit intoBip901:mainfrom
anomal3:feature

Conversation

@anomal3
Copy link
Copy Markdown

@anomal3 anomal3 commented Mar 31, 2026

No description provided.

update : Demo project update, add pseudo animation
Copy link
Copy Markdown
Owner

@Bip901 Bip901 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed that the double click event works. However:

  1. The tooltip does not appear for me when hovering over the icon. I'm testing on Windows 11.
  2. Note to self: need to recompile for Linux, since the tray struct has changed.

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0.0)

cmake_minimum_required(VERSION 3.5.0)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason to raise the minimum?

return HeapAlloc<Tray>.Copy(tray);
}
}
} No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

Icon = icon;
}
}
} No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

string iconPath,
IReadOnlyList<MenuItem> menuItems,
string? tooltip = null,
Action<NotifyIcon>? onDoubleClick = null)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the Create method should accept a delegate. Users can simply subscribe to the DoubleClick event themselves using the returned NotifyIcon instance.

nid.hIcon = icon;
nid.uFlags |= NIF_TIP;
if (tray->tooltip != NULL) {
wcscpy_s(nid.szTip, sizeof(nid.szTip) / sizeof(WCHAR), (LPCWSTR)tray->tooltip);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use _TRUNCATE to prevent crashes if the tooltip is too long, and _countof instead of calculating manually

Suggested change
wcscpy_s(nid.szTip, sizeof(nid.szTip) / sizeof(WCHAR), (LPCWSTR)tray->tooltip);
wcsncpy_s(nid.szTip, _countof(nid.szTip), (LPCWSTR)tray->tooltip, _TRUNCATE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants