Tutorial: application.setTrayIcon

application.setTrayIcon

Adds a customizable icon in the system tray and notifies the application when clicked.

Example

var application = fin.desktop.Application.getCurrent();

application.setTrayIcon("https://developer.openf.in/download/openfin.png", function (clickInfo) {
    console.log("The mouse has clicked at (" + clickInfo.x + "," + clickInfo.y + ")");
});

Click info

//This response has the following shape:
{
    button: 40, //the mouse button clicked
                //0 - left
                //1 - middle
                //2 - right
    monitorInfo: {}, //Please see fin.desktop.System.getMonitorInfo for more information,
    x: 40, //the left position of the mouse in virtual screen coordinates,
    y: 40, //the top position of the mouse in virtual screen coordinates
}