1

I'd like to change tray notify icon with user customized icon. I have already searched on the internet, but I can't find where a solution is. If my problem is duplicated, please send me a reference link.

Steps:

I have tried this using NOTIFYICONDATAW .hIcon & .hBalloonIcon. A part of implementation below.

Implementation:

NOTIFYICONDATAW nt = {0};
nt.cbSize = sizeof(NOTIFYICONDATAW);
nt.hWnd = GetSafeHwnd();
nt.uID = IDR_MAINFRAME;

nt.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP | NIF_INFO;
nt.dwInfoFlags = NIIF_INFO;
nt.uCallbackMessage = WM_TRAY_NOTIFY;
nt.hIcon = theApp.LoadIconW(IDR_MAINFRAME);
nt.hBalloonIcon = theApp.LoadIconW(IDR_MAINFRAME);

...

Shell_NotifyIcon(NIM_ADD, &nt);

But unfortunately, still I got same (information) icon on the balloon notification.

Environment:

MFC Dialog Based, Win 10 x64.

Is it possible to change balloon icon?

enter image description here

AleXelton
  • 767
  • 5
  • 27
  • Have you tried to run your program as administrator ? – nakE Dec 17 '19 at 09:51
  • @nakE, I tried to run application as administrator, but it is the same. – AleXelton Dec 17 '19 at 12:19
  • It's definitely possible, I did it very recently. You just need to set the appropriate flags. It is also adequately documented by Microsoft. Basically caused by the `NIIF_INFO` flag (causing an info icon to be displayed). Try 0 (none) or `NIIF_USER`, possibly in combination with `NIIF_LARGE_ICON`. You may also need to perform a 2nd call to `Shell_NotifyIcon()`, to set the version to `NOTIFYICON_VERSION_4`. – Constantine Georgiou Dec 17 '19 at 14:33
  • @ConstantineGeorgiou, Thank you very much! I solved it. If you post your answer, I will vote up your post. I used `nt.dwInfoFlags = NIIF_USER | NIIF_LARGE_ICON` – AleXelton Dec 17 '19 at 23:57

0 Answers0