Download the source code
The source code for this project is hosted on Github. It is written in C++ and built with Visual C++ 2013 or later.
You can get the source code in different ways:
There are two ways that I know of that will let you display a yellow pop-up ballon. Whether you should use one or the other depends on the application you are using. Notifu is written in C++ but I always keep reuse in mind. The code is small and porting to your language should not be difficult.
IUserNotification or Shell_NotifyIcon ?
That’s the first question I wanted to answer when I started this project. The answer is simple. If you have a message loop, you are probably better off with
Shell_NotifyIcon. If your application is command line or somehow doesn’t mind blocking its thread, the
IUserNotification interface should be used.
I will not talk about
Shell_NotifyIcon, there are plenty of examples available for every language, and then some. Suffice to say that
IUserNotification gives you more control on the pop-up. Pretty much all of the features of
IUserNotification are available in Notifu’s command line.
One thing that
IUserNotification provides is a clean way for an application to close the popup ballon without any user intervention.
You must implement
IQueryContinue with your closing logic. This is how Notifu handles timeouts and replacing a popup with another.
Windows Vista introduced a new interface,
IUserNotification2. It has the same signature as the original Windows XP interface, except for the
Show method. That interface allows you to specify a callback that will be called when a user clicks on the the tray icon.
For some reason, the interface was duplicated, instead of doing a
IUserNotification2 that would have a
How is the source organized
Five files can be reused directly in you project :
NotifyUser.cppand it’s header
NOTIFU_PARAM.hprovide the small wrapper for the API
QueryContinue.cppand it’s header
QueryContinue.hprovide a sample implementation of a
IUserNotification is a COM interface, you must also call
CoInitializeEx before calling
NotifyUser. Just fill a
NOTIFU_PARAM structure and call
To start, just add those five files to your project and build it. It should work as is.
Notifu has no dependencies on anything, but you might need the platform SDK to build it. If you need a feature that Notifu doesn’t provide, ask me for it.