<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>DisplayFusion RSS: Feature Request: BFS.Taskbar.RefreshIconTray</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=a8740f0a-b046-4dff-80ca-3dcca18e340d" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=a8740f0a-b046-4dff-80ca-3dcca18e340d</link>
<description>DisplayFusion RSS: Feature Request: BFS.Taskbar.RefreshIconTray</description>
<lastBuildDate>Thu, 21 May 2026 23:26:22 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=a8740f0a-b046-4dff-80ca-3dcca18e340d</generator>
<item>
<title>RE: Feature Request: BFS.Taskbar.RefreshIconTray</title>
<link>https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#4</link>
<pubDate>Mon, 23 Apr 2018 16:18:14 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks Pablo! I've added this to the online Scripted Function repository]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks Pablo! I've added this to the online Scripted Function repository <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Feature Request: BFS.Taskbar.RefreshIconTray</title>
<link>https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#3</link>
<pubDate>Sat, 21 Apr 2018 15:46:53 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
Using the solution you found on stackoverflow, I adapted it for use in DisplayFusion. Perhaps there are simpler and more elegant solutions, but it is quite working as a temporary, until the developers do not implement their own.
Thanks so much for taking the time to do this, Pablo!
I di...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>Using the solution you found on stackoverflow, I adapted it for use in DisplayFusion. Perhaps there are simpler and more elegant solutions, but it is quite working as a temporary, until the developers do not implement their own.  <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /></div></div><br/>
<br/>
Thanks so much for taking the time to do this, Pablo!<br/>
<br/>
I did have to delete lines 19 and 25 (kill the calling app?) above for it to work for me, but it's exactly what I needed.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Feature Request: BFS.Taskbar.RefreshIconTray</title>
<link>https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#2</link>
<pubDate>Sat, 21 Apr 2018 06:20:43 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Using the solution you found on stackoverflow, I adapted it for use in DisplayFusion. Perhaps there are simpler and more elegant solutions, but it is quite working as a temporary, until the developers do not implement their own.
Code
Copy
Select All
using System;
using System.Drawing;
using...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Using the solution you found on stackoverflow, I adapted it for use in DisplayFusion. Perhaps there are simpler and more elegant solutions, but it is quite working as a temporary, until the developers do not implement their own.  <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /> <br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019e4cdc8add764bbc9faa0ac5a3ab61" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019e4cdc8add764bbc9faa0ac5a3ab61Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019e4cdc8add764bbc9faa0ac5a3ab61Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">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
{
    [DllImport("user32.dll")]
    public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
    
    public static void Run(IntPtr windowHandle)
    {
        var appId = BFS.Application.GetAppIDByWindow(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");
        
        BFS.Application.Kill(appId);
        if (notificationAreaHandle == IntPtr.Zero)
        {
            var notifyIconOverflowWindowHandle = BFS.Window.GetWindowByClass("NotifyIconOverflowWindow");
            var overflowNotificationAreaHandle = BFS.Window.GetChildWindowByClass(notifyIconOverflowWindowHandle, "ToolbarWindow32");
            RefreshTrayArea(overflowNotificationAreaHandle);
        }
        RefreshTrayArea(notificationAreaHandle);
    }
    
    private static void RefreshTrayArea(IntPtr windowHandle)
    {
        const uint wmMousemove = 0x0200;
        var rect = BFS.Window.GetClientRect(windowHandle);
        
        for (var x = 0; x &lt; rect.Right; x += 5)
            for (var y = 0; y &lt; rect.Bottom; y += 5)
                SendMessage(windowHandle, wmMousemove, 0, (y &lt;&lt; 16) + x);
    }
}</pre><textarea id="code019e4cdc8add764bbc9faa0ac5a3ab61" name="code019e4cdc8add764bbc9faa0ac5a3ab61" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>Feature Request: BFS.Taskbar.RefreshIconTray</title>
<link>https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d</link>
<pubDate>Fri, 20 Apr 2018 19:46:36 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/feature-request-bfstaskbarrefreshicontray/?ID=a8740f0a-b046-4dff-80ca-3dcca18e340d</guid>
<category>DisplayFusion</category>
<description><![CDATA[An annoying "feature" of the Windows Taskbar (or Icon Tray - whatever it's called) is that it doesn't refresh itself if you kill tasks. An icon for the killed task will remain in the icon tray until you mouse over the tray or some other event causes it to refresh itself.
BFS.Application has feat...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
An annoying "feature" of the Windows Taskbar (or Icon Tray - whatever it's called) is that it doesn't refresh itself if you kill tasks. An icon for the killed task will remain in the icon tray until you mouse over the tray or some other event causes it to refresh itself.<br/>
<br/>
BFS.Application has features (THANK YOU!) that let you easily kill tasks.<br/>
<br/>
I'd like to request a related <b>scripted function that causes a Task Bar and/or Icon Bar refresh.</b><br/>
<br/>
Here's a link to some C# sample code for what I have in mind, but don't have the skill to make in to my own DisplayFusion function:<br/>
<br/>
<a href="https://stackoverflow.com/questions/8342614/refreshing-system-tray-icons-programmatically" target="_blank" rel="nofollow"><b>https://stackoverflow.com/questions/8342614/refreshing-system-tray-icons-programmatically</b></a><br/>
<br/>
Thanks for your consideration.
</div>
]]></content:encoded>
</item>
</channel>
</rss>