Processing Ajax...

Close Dialog


Close Dialog

Close Dialog

A recent AVG and Avast antivirus update is preventing DisplayFusion 9.9 from launching on some systems.
If you're running into this issue, please update to the latest DisplayFusion 10.0 Beta.

Refresh Tray Icons

This script will cause the tray icons on the taskbar to refresh (makes an icon for a terminated process go away).
Minimum Version
Created By
Date Created
Apr 23, 2018
Date Last Modified
Jun 30, 2018

Scripted Function (Macro) Code

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
    public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
	public static void Run(IntPtr windowHandle)
		var sysTrayContainerHandle = BFS.Window.GetWindowByClass("Shell_TrayWnd");
		var sysTrayHandle = BFS.Window.GetChildWindowByClass(sysTrayContainerHandle, "TrayNotifyWnd");
		var sysPagerHandle = BFS.Window.GetChildWindowByClass(sysTrayHandle, "SysPager");
		var notificationAreaHandle = BFS.Window.GetChildWindowByClass(sysPagerHandle, "ToolbarWindow32");
		var notifyIconOverflowWindowHandle = BFS.Window.GetWindowByClass("NotifyIconOverflowWindow");
        var overflowNotificationAreaHandle = BFS.Window.GetChildWindowByClass(notifyIconOverflowWindowHandle, "ToolbarWindow32");
		if (notificationAreaHandle == IntPtr.Zero)
	private static void RefreshTrayArea(IntPtr windowHandle)
        const uint wmMousemove = 0x0200;
        var rect = BFS.Window.GetClientRect(windowHandle);
        for (var x = 0; x < rect.Right; x += 5)
            for (var y = 0; y < rect.Bottom; y += 5)
                SendMessage(windowHandle, wmMousemove, 0, (y << 16) + x);