<?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: Trigger when Window is not focused</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=434fa005-2802-4f67-9a4a-624ac350586b" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=434fa005-2802-4f67-9a4a-624ac350586b</link>
<description>DisplayFusion RSS: Trigger when Window is not focused</description>
<lastBuildDate>Sun, 19 Apr 2026 10:47:17 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=434fa005-2802-4f67-9a4a-624ac350586b</generator>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#17</link>
<pubDate>Mon, 17 Sep 2018 17:25:20 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#17</guid>
<category>DisplayFusion</category>
<description><![CDATA[Yeah, sounds like that is probably the way to go. I couldn't even get nircmd to actually suspend any apps here, so I'm a bit stuck anyways]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Yeah, sounds like that is probably the way to go. I couldn't even get nircmd to actually suspend any apps here, so I'm a bit stuck anyways <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-frown.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: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#16</link>
<pubDate>Fri, 14 Sep 2018 18:51:08 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#16</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks for the quick help.
But that didn´t help either. The program stays frozen. Still don´t understand why, but whatever.
I think i will go with the hotkey way.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks for the quick help.<br/>
But that didn´t help either. The program stays frozen. Still don´t understand why, but whatever.<br/>
I think i will go with the hotkey way.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#15</link>
<pubDate>Fri, 14 Sep 2018 18:42:12 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#15</guid>
<category>DisplayFusion</category>
<description><![CDATA[That will only return a true/false. "e.g. is the window hung?"
It's not for finding a hung window. You could try this to identify whether the focused window is hung:
Code
Copy
Select All
BFS.Window.IsHung(BFS.Window.GetFocusedWindow)
Or the whole script like this:
Code
Copy
Select All
u...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
That will only return a true/false. "e.g. is the window hung?"<br/>
<br/>
It's not for finding a hung window. You could try this to identify whether the focused window is hung:<br/>
<br/>
<div id="" 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="#code019da55a1310734c9cd4012d70122e25" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a1310734c9cd4012d70122e25Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a1310734c9cd4012d70122e25Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">BFS.Window.IsHung(BFS.Window.GetFocusedWindow)</pre><textarea id="code019da55a1310734c9cd4012d70122e25" name="code019da55a1310734c9cd4012d70122e25" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Or the whole script like this:<br/>
<br/>
<div id="" 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="#code019da55a131675fcbcec5c09638d9b2d" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a131675fcbcec5c09638d9b2dJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a131675fcbcec5c09638d9b2dJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Check if the window is not in focus
        if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
        {
        // Suspend the process
        uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "suspendprocess Example.exe");
        }
        // Check if the window is in focus
        if (BFS.Window.IsHung(BFS.Window.GetFocusedWindow()))
        {
        // Resume the process
        uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "resumeprocess Example.exe");
        }
    }
}</pre><textarea id="code019da55a131675fcbcec5c09638d9b2d" name="code019da55a131675fcbcec5c09638d9b2d" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#14</link>
<pubDate>Fri, 14 Sep 2018 17:26:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#14</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
Yep, I have it
I've tried with and without quotes as well.
Maybe it would make more sense to just have two scripts, one for suspending the process and one for resuming it, and then you can just run them using hotkeys? It sounds like maybe the suspended window doesn't send any Window Foc...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>Yep, I have it <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/>
I've tried with and without quotes as well.<br/>
<br/>
Maybe it would make more sense to just have two scripts, one for suspending the process and one for resuming it, and then you can just run them using hotkeys? It sounds like maybe the suspended window doesn't send any Window Focused messages <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-frown.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/>
Hmm. But do you get it suspended or not?<br/>
I have already a hotkey alternative with Autohotkey. But a seamless Way is always better. But for what is the <br/>
<br/>
<div id="" 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="#code019da55a132075c3a0f0bd398735b151" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a132075c3a0f0bd398735b151Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a132075c3a0f0bd398735b151Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">if (BFS.Window.IsHung(windowHandle).Contains("Example: Source"));</pre><textarea id="code019da55a132075c3a0f0bd398735b151" name="code019da55a132075c3a0f0bd398735b151" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
then here when i can not use it?<br/>
It seems that this should be the code we could use for that issue. Because in the Window Title it also says (Not Responding). Display Fusion should see it.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#13</link>
<pubDate>Fri, 14 Sep 2018 17:00:33 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#13</guid>
<category>DisplayFusion</category>
<description><![CDATA[Yep, I have it
I've tried with and without quotes as well.
Maybe it would make more sense to just have two scripts, one for suspending the process and one for resuming it, and then you can just run them using hotkeys? It sounds like maybe the suspended window doesn't send any Window Focused mes...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Yep, I have it <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/>
I've tried with and without quotes as well.<br/>
<br/>
Maybe it would make more sense to just have two scripts, one for suspending the process and one for resuming it, and then you can just run them using hotkeys? It sounds like maybe the suspended window doesn't send any Window Focused messages <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-frown.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: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#12</link>
<pubDate>Fri, 14 Sep 2018 16:52:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#12</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
I'm trying to test this out here, but I can't get nircmd to work, even manually. I run "nircmd.exe suspendprocess notepad.exe" but it doesn't seem to do anything at all. Am I missing anything here?
No, the command seems okay.
But you know that nircmd is a external tool and not build in ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>I'm trying to test this out here, but I can't get nircmd to work, even manually. I run "nircmd.exe suspendprocess notepad.exe" but it doesn't seem to do anything at all. Am I missing anything here?</div></div><br/>
<br/>
No, the command seems okay.<br/>
But you know that nircmd is a external tool and not build in Windows?<br/>
<br/>
<a href="http://www.nirsoft.net/utils/nircmd.html" target="_blank" rel="nofollow"><b>http://www.nirsoft.net/utils/nircmd.html</b></a><br/>
<br/>
And also maybe put the target into Quotation marks to be sure:<br/>
nircmd.exe suspendprocess "notepad.exe"
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#11</link>
<pubDate>Fri, 14 Sep 2018 16:08:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#11</guid>
<category>DisplayFusion</category>
<description><![CDATA[I'm trying to test this out here, but I can't get nircmd to work, even manually. I run "nircmd.exe suspendprocess notepad.exe" but it doesn't seem to do anything at all. Am I missing anything here?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I'm trying to test this out here, but I can't get nircmd to work, even manually. I run "nircmd.exe suspendprocess notepad.exe" but it doesn't seem to do anything at all. Am I missing anything here?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#10</link>
<pubDate>Fri, 14 Sep 2018 09:01:02 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#10</guid>
<category>DisplayFusion</category>
<description><![CDATA[Okay, thank you. Your script works wonderful.
But i have sadly another problem.
Whenever the program get´s suspended, it of course creates the "Ghost" Image over it (White Overlay over the Window) and the window title get´s the "(Not Responding)" text added to the Program´s Title (examle is Pic...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Okay, thank you. Your script works wonderful. <br/>
But i have sadly another problem.<br/>
Whenever the program get´s suspended, it of course creates the "Ghost" Image over it (White Overlay over the Window) and the window title get´s the "(Not Responding)" text added to the Program´s Title (examle is Picture 01)<br/>
And this is where the script won´t work anymore, because it can´t see the Program´s Progress or something.<br/>
I thought of maybe using this ("Example: Source" is the title of the program)<br/>
<br/>
<div id="" 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="#code019da55a133575ffa9e8aad953cb89bc" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a133575ffa9e8aad953cb89bcJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a133575ffa9e8aad953cb89bcJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))</pre><textarea id="code019da55a133575ffa9e8aad953cb89bc" name="code019da55a133575ffa9e8aad953cb89bc" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
but instead using<br/>
<br/>
<div id="" 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="#code019da55a13367068999a8e33ee2a419a" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a13367068999a8e33ee2a419aJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a13367068999a8e33ee2a419aJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">if (BFS.Window.GetText(windowHandle).Contains("Example: Source (Not Responding)"));</pre><textarea id="code019da55a13367068999a8e33ee2a419a" name="code019da55a13367068999a8e33ee2a419a" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
or<br/>
<br/>
<div id="" 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="#code019da55a133873e1aef1806a4e3377d6" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a133873e1aef1806a4e3377d6Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a133873e1aef1806a4e3377d6Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">if (BFS.Window.IsHung(windowHandle).Contains("Example: Source"));</pre><textarea id="code019da55a133873e1aef1806a4e3377d6" name="code019da55a133873e1aef1806a4e3377d6" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
But nothing i tried since 5 hours works here. I don´t get it.<br/>
As usual, i always use this Function with the Trigger from Picture 02.<br/>
<br/>
So in Summary i want to do the following:<br/>
<br/>
1.- Start the Program (Example.exe)<br/>
<br/>
2.- When Mouse is not over Example.exe´s Window, then launch "nircmd.exe suspendprocess Example.exe".<br/>
<br/>
3.- Program (Example.exe) get´s frozen and don´t use any unescesarry CPU Resources while it´s not focused.<br/>
<br/>
4.- When Mouse is over Example.exe´s Window, then launch "nircmd.exe resumeprocess Example.exe"<br/>
<br/>
5.- Program (Example.exe) get´s out of the Frozen State and you can work on the Program again. Until it´s not focused, then  the whole Function starts from the beginnning.<br/>
<br/>
At Point 4, this is where it seems not to work, because the program get´s not unfrozed anymore. So maybe using the Window Title or the Function Windows Hung as i described above instead of only using the Programs Exe could be working.<br/>
<br/>
Sorry for all that questions, but as i said before, i already tried that since 5 hours myself searching through Example Scrips and whatnot.<br/>
Thank you very much.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#9</link>
<pubDate>Thu, 13 Sep 2018 18:27:55 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#9</guid>
<category>DisplayFusion</category>
<description><![CDATA[You just need to take the ! out of line 15. That exclamation means "if it's false". So you're script would look like this now (I've added comments to clarify the steps):
Code
Copy
Select All
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
You just need to take the ! out of line 15. That exclamation means "if it's false". So you're script would look like this now (I've added comments to clarify the steps):<br/>
<br/>
<div id="" 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="#code019da55a133f71d6bf342f196f4aeb53" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a133f71d6bf342f196f4aeb53Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a133f71d6bf342f196f4aeb53Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Check if the window is not in focus
        if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
        {
        // Suspend the process
        uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "suspendprocess Example.exe");
        }
        // Check if the window is in focus
        if (BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
        {
        // Resume the process
        uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "resumeprocess Example.exe");
        }
    }
}</pre><textarea id="code019da55a133f71d6bf342f196f4aeb53" name="code019da55a133f71d6bf342f196f4aeb53" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#8</link>
<pubDate>Tue, 11 Sep 2018 19:57:48 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#8</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thank you so much.
The Script now works flawlessy without any problems.
Whenever i move my mouse away from "Example.exe"´s Window, Nircmd jumps in and suspence the Process to Zero.
But......
I hoped this would be the last help i wanted from you.
The last thing i need is to have, whenever my ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thank you so much.<br/>
The Script now works flawlessy without any problems.<br/>
<br/>
Whenever i move my mouse away from "Example.exe"´s Window, Nircmd jumps in and suspence the Process to Zero.<br/>
But......<br/>
I hoped this would be the last help i wanted from you.<br/>
The last thing i need is to have, whenever my mouse goes back to "Example.exe"´s Window and Focus on it, Nircmd jumps in with the "Process Resume" Command to resume the Program out of it´s frozen State.<br/>
<br/>
I have this script here based on your previous script so far:<br/>
<br/>
<div id="" 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="#code019da55a13467285a1399e19f6f32d76" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a13467285a1399e19f6f32d76Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a13467285a1399e19f6f32d76Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Check if the window is not in focus
if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
{
uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "suspendprocess Example.exe");
}
// Until here it works, but how do i go along then from here? I want to have a second function where it´s looking when the 
// window is focused again.
if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
{
uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe", "resumeprocess Example.exe");
}
}
}</pre><textarea id="code019da55a13467285a1399e19f6f32d76" name="code019da55a13467285a1399e19f6f32d76" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
The problem also is that of course after you frozen the command with the "Suspendprocess" Command, after a while the Windows Ghosting jumps in. And from that point i don´t know how to go along. Because of the Frozen State, the Programs Window do not notice that it´s focused. <br/>
A Workaround would be instead of having the Example.exe in the Script, instead it uses the Program´s Window Title. So when using the Title "ExampleTitle (Not Responding), the Trigger will know which exactly Window i mean.<br/>
<br/>
Okay, i believe this will be hard to understand what i want here. Please say it to me if something is not clear.  <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/>
I already readed the Help File for the scripts, but can´t find it. But i also saw that command for "Window Hung", which could maybe also be some help in the Script.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#7</link>
<pubDate>Tue, 11 Sep 2018 18:01:18 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#7</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ah ok, your code should look like this then (make sure to delete all code from the scripted function before pasting this in):
Code
Copy
Select All
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Check if th...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ah ok, your code should look like this then (make sure to delete all code from the scripted function before pasting this in):<br/>
<br/>
<div id="" 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="#code019da55a135374db9685ab02a1d3c000" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a135374db9685ab02a1d3c000Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a135374db9685ab02a1d3c000Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Check if the window is not in focus
        if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("ExampleProgram.exe"))
        {
               uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe.exe", "suspendprocess ExampleProgram.exe");
        }
    }
}</pre><textarea id="code019da55a135374db9685ab02a1d3c000" name="code019da55a135374db9685ab02a1d3c000" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Then you create a Trigger rule that looks like the attached screenshot.<br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#6</link>
<pubDate>Mon, 10 Sep 2018 18:47:45 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
There are a few issues here, but I'm a bit confused. Are you wanting it to run that nircmd command when a certain application loses focus?
That´s because "Nircmd" has a command to Suspend a Process.
I have a Program that is using 20-25 CPU when using. I have it running in the background...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>There are a few issues here, but I'm a bit confused. Are you wanting it to run that nircmd command when a certain application loses focus?</div></div><br/>
<br/>
That´s because "Nircmd" has a command to Suspend a Process.<br/>
I have a Program that is using 20-25 CPU when using. I have it running in the background the whole time.<br/>
So i found this program "Nircmd", because it has the perfect two commands for that case.<br/>
<br/>
nircmd.exe resumeprocess "Example.exe"<br/>
nircmd.exe suspendprocess "Example.exe"<br/>
<br/>
This works so good and flawless. Now i know that DF can do Triggering with the Windows (as you also stated before).<br/>
So i wanted to have the following Trigger. <br/>
When the window of this programs (Example.exe) is NOT in focus, it triggers <br/>
<br/>
nircmd.exe suspendprocess"Example.exe". <br/>
<br/>
When i alttab to it back, it triggers <br/>
nircmd.exe resumeprocess "Example.exe" <br/>
for resuming a process<br/>
<br/>
So now i can use it all the time and have it running in the background without heavy CPU Load. Please don´t ask why i have to run this all the time. <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/>
But again, i can´t really find a way to have all this in a trigger in the first place.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#5</link>
<pubDate>Mon, 10 Sep 2018 17:55:30 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[There are a few issues here, but I'm a bit confused. Are you wanting it to run that nircmd command when a certain application loses focus?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
There are a few issues here, but I'm a bit confused. Are you wanting it to run that nircmd command when a certain application loses focus?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#4</link>
<pubDate>Sat, 08 Sep 2018 05:48:12 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hello again.
I tried some code based on the "Downloadable Scripted Functions".
But i can´t get behind it to have it triggered when it´s NOT in focus.
Here´s my Script so far:
Code
Copy
Select All
using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello again.<br/>
I tried some code based on the "Downloadable Scripted Functions".<br/>
But i can´t get behind it to have it triggered when it´s NOT in focus.<br/>
Here´s my Script so far:<br/>
<br/>
<div id="" 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="#code019da55a13647600b1e4d287717904e9" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a13647600b1e4d287717904e9Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a13647600b1e4d287717904e9Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

// 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
using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        //this is where i want to have the Window NOT in Focus, but i can´t get how.
        if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("ExampleProgram.exe"))
           IntPtr mainWindow = BFS.Application.GetMainWindowByFile("ExampleProgram.exe");
           BFS.Window.Focus(mainWindow);
        {
               uint appID = BFS.Application.Start("A:\\PROGRAMS\\_NirCmdc\\nircmd.exe.exe", "suspendprocess ExampleProgram.exe");
        }
    }
}</pre><textarea id="code019da55a13647600b1e4d287717904e9" name="code019da55a13647600b1e4d287717904e9" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Edit:<br/>
I should also say that when i save it, DF says the code is invalid.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#3</link>
<pubDate>Fri, 07 Sep 2018 19:42:12 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks for the tipp. I will try that.
Can you please take a look in the thread when you have time?
I added something to that, in case you missed it.
https://www.displayfusion.com/Discussions/View/a-few-requests-from-a-new-user/?ID=d388e1d9-e687-42ce-822b-ddf0d569fb37]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks for the tipp. I will try that. <br/>
Can you please take a look in the thread when you have time? <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/>
I added something to that, in case you missed it. <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/>
https://www.displayfusion.com/Discussions/View/a-few-requests-from-a-new-user/?ID=d388e1d9-e687-42ce-822b-ddf0d569fb37
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#2</link>
<pubDate>Fri, 07 Sep 2018 18:48:44 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[There isn't really a way to do that, because there's no "focus lost" message that we can hook globally. What you could do is have a Scripted Function that checks what the focused process is, and if it's not your specific program, it executes the rest of the code. Then run that from a Window Focus...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
There isn't really a way to do that, because there's no "focus lost" message that we can hook globally. What you could do is have a Scripted Function that checks what the focused process is, and if it's not your specific program, it executes the rest of the code. Then run that from a Window Focused trigger that's set to fire for all applications (*.* in the process filename).<br/>
<br/>
Here's some sample code for the scripted function:<br/>
<div id="" 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="#code019da55a13847606a5422192323e54ee" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da55a13847606a5422192323e54eeJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da55a13847606a5422192323e54eeJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("notepad.exe"))
        {
            // do stuff here
        }
    }
}</pre><textarea id="code019da55a13847606a5422192323e54ee" name="code019da55a13847606a5422192323e54ee" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>Trigger when Window is not focused</title>
<link>https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b</link>
<pubDate>Fri, 07 Sep 2018 13:23:54 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/trigger-when-window-is-not-focused/?ID=434fa005-2802-4f67-9a4a-624ac350586b</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hello. I have a program where i want to have the ability that whenever it´s window is not in focus, it triggers something. I wanted to do that in DF, but i saw there is only a command for "Window Focus". I would need the exact opposite. Can you do something about that?
Thank you very much.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello. I have a program where i want to have the ability that whenever it´s window is not in focus, it triggers something. I wanted to do that in DF, but i saw there is only a command for "Window Focus". I would need the exact opposite. Can you do something about that?<br/>
Thank you very much.
</div>
]]></content:encoded>
</item>
</channel>
</rss>