I want to use NotifyIcon.Icon provided by Microsoft, but the language is C++ programming language, how to use NotifyIcon.Icon with C++?

杨 谭 20 Reputation points
2024-01-26T02:13:20.34+00:00

Check the Microsoft website NotifyIcon.Icon, the example code is written #using <System.dll> #using <System.Windows.Forms.dll> #using <System.Drawing.dll>, I have not seen or written this way to load the library, it seems not written in C++ programming language, How to use NotifyIcon on QT Creater and Visual Studio software? ?hope to get your reply.1

Developer technologies | C++
Developer technologies | .NET | Other
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Minxin Yu 13,506 Reputation points Microsoft External Staff
    2024-01-26T02:23:29.3233333+00:00

    Hi,
    NotifyIcon Class is .NET class.
    You need to use it in C++CLR project.
    Install C++CLI in Visual Studio Installer.
    User's image

    The screenshot you provided is the usage of NotifyIcon in C++ Winform.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. David Lowndes 2,640 Reputation points MVP
    2024-01-26T09:42:37.29+00:00

    If you want to create a notification icon from native C++ code, have a look for examples using the Shell_NotifyIcon API such as this.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.