In order to operate an icon in the notification area (a. k. a. the system tray), you need a message pump and a window (visible or invisible).
Since console windows don't have windows or message pumps, you probably won't find any examples of a system tray icon in console.
So start a new project, this time make it a Windows GUI project, create a new window (invisible or visible), and use that HWND to set up the icon in the notification area.
Once it is set up, you can receive the clicks and double-clicks in the window procedure of the (visible or invisible) window.
Note that you should be using a user-defined message in uCallbackMessage (one defined as WM_USER + <some arbitrary positive number>).
So not possible as a console app? I have tried to switch from project options to gui app but then it won;t work anymore, the program is executed in background with 100% cpu load.
Don't change the project type. Best to just create a new project using the Visual Studio wizard and making sure you select the appropriate type of project.