<?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>VoiceBot RSS: Need BFS.Window.Exists(); Open file if window not found!</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=d6995b89-c4e6-4185-952d-9df6d8353929" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=d6995b89-c4e6-4185-952d-9df6d8353929</link>
<description>VoiceBot RSS: Need BFS.Window.Exists(); Open file if window not found!</description>
<lastBuildDate>Wed, 20 May 2026 04:12:28 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=d6995b89-c4e6-4185-952d-9df6d8353929</generator>
<item>
<title>RE: Need BFS.Window.Exists(); Open file if window not found!</title>
<link>https://www.voicebot.net/Discussions/View/need-bfswindowexists-open-file-if-window-not-found/?ID=d6995b89-c4e6-4185-952d-9df6d8353929#2</link>
<pubDate>Wed, 24 Jan 2018 07:43:10 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/need-bfswindowexists-open-file-if-window-not-found/?ID=d6995b89-c4e6-4185-952d-9df6d8353929#2</guid>
<category>VoiceBot</category>
<description><![CDATA[The simplest example.
Code
Copy
Select All
using System;
public static class VoiceBotScript
{
public static void Run(IntPtr windowHandle)
{
// Example @"c:\MyPict\MyPict.png"
var pathToPict = @"Your path to picture with extension";
OpenPicture(pathToPict);
}
// For example used defau...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
The simplest example.<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="#code019e4395c36373b89c3d44bcbf58b3fc" class="ClipboardCopyControl"><img src="https://www.voicebot.net/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('code019e4395c36373b89c3d44bcbf58b3fcJs'); return false;"><img src="https://www.voicebot.net/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="code019e4395c36373b89c3d44bcbf58b3fcJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;

public static class VoiceBotScript
{
    public static void Run(IntPtr windowHandle)
    {
        // Example @"c:\MyPict\MyPict.png"
        var pathToPict = @"Your path to picture with extension";
        OpenPicture(pathToPict);
    }
    
    // For example used default Win10 picture viewer
    private static void OpenPicture(string pathToPict)
    {
        var wHnd = BFS.Window.GetWindowByText("*Photos");
        if (!wHnd.Equals(IntPtr.Zero))
            BFS.Window.Focus(wHnd);
        else
            BFS.VoiceBotActions.StartProgram(pathToPict);
    }
}</pre><textarea id="code019e4395c36373b89c3d44bcbf58b3fc" name="code019e4395c36373b89c3d44bcbf58b3fc" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>Need BFS.Window.Exists(); Open file if window not found!</title>
<link>https://www.voicebot.net/Discussions/View/need-bfswindowexists-open-file-if-window-not-found/?ID=d6995b89-c4e6-4185-952d-9df6d8353929</link>
<pubDate>Wed, 24 Jan 2018 01:20:01 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/need-bfswindowexists-open-file-if-window-not-found/?ID=d6995b89-c4e6-4185-952d-9df6d8353929</guid>
<category>VoiceBot</category>
<description><![CDATA[Need a way to get if a window exists in a more clear method.
I am trying to setup a script so that it will open a file but if the window already exists then it will not open the file but instead swtich to that window.
good for viewing photos or reference maps etc.
Current method for this could...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Need a way to get if a window exists in a more clear method.<br/>
<br/>
I am trying to setup a script so that it will open a file but if the window already exists then it will not open the file but instead swtich to that window.<br/>
<br/>
good for viewing photos or reference maps etc.<br/>
<br/>
Current method for this could be <br/>
<br/>
    IntPtr win = BFS.Window.GetWindowByText("text starts with *");<br/>
        if(!BFS.Window.Focus(win)){<br/>
        BFS.Dialog.ShowMessageError("found window");<br/>
        BFS.VoiceBotActions.OpenFile("path to file");
</div>
]]></content:encoded>
</item>
</channel>
</rss>