<?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/"
	>

<channel>
	<title>Matt Refghi&#039;s Blog &#187; filter</title>
	<atom:link href="http://mattrefghi.com/wordpress/tag/filter/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattrefghi.com/wordpress</link>
	<description>Computer Science and other written works</description>
	<lastBuildDate>Fri, 27 Aug 2010 01:10:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Applying a Custom Filter in an Open File Dialog</title>
		<link>http://mattrefghi.com/wordpress/2009/04/applying-a-custom-filter-in-an-open-file-dialog/</link>
		<comments>http://mattrefghi.com/wordpress/2009/04/applying-a-custom-filter-in-an-open-file-dialog/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 03:14:57 +0000</pubDate>
		<dc:creator>Matt Refghi</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://www.mattrefghi.com/wordpress/?p=498</guid>
		<description><![CDATA[What I&#8217;m going to cover]]></description>
			<content:encoded><![CDATA[<p>What I&#8217;m going to cover now is a pretty minor feature of Windows. I would of skipped this article, but I encountered a few people that never heard of this trick. I&#8217;ve personally found it useful in scenarios where I was working with custom file extensions&#8230; for example, I knew that a particular file with the uncommon extension &#8220;.def&#8221; could be opened in Microsoft Access.  The file extension &#8220;.def&#8221; is not typically associated with Microsoft Access, but I knew it was a valid file.</p>
<p>To explain how the feature works, consider your typical, everyday &#8220;Open File&#8221; dialog:</p>
<div id="attachment_502" class="wp-caption aligncenter" style="width: 514px"><a href="http://mattrefghi.com/wordpress/wp-content/uploads/2009/04/fileopendialog.jpg" rel="lightbox[498]"><img class="size-full wp-image-502  " src="http://mattrefghi.com/wordpress/wp-content/uploads/2009/04/fileopendialog.jpg" alt="A an example of a File-Open dialog showing an active filter." width="504" height="400" /></a><p class="wp-caption-text">An example of a typical &quot;Open File&quot; dialog - from uTorrent</p></div>
<p style="text-align: left;">In this example, the dialog wants you to select a &#8220;.torrent&#8221; file by default. Because this is the <em>active</em> filter, you only see files that have a &#8220;.torrent&#8221; extension in the folders you view.  What if you had a file with a &#8220;.abc&#8221; extension &#8211; and you knew it was a valid torrent file,  just with a different extension? If you wanted to select it, you&#8217;d have to change the filter dropdown to &#8220;All Files&#8221;, and then find it that way. If you had a lot of files in the same folder as the &#8220;.abc&#8221; file, you&#8217;d have to look through the list to find the one you want.</p>
<p style="text-align: left;">Wouldn&#8217;t it be great if you could simply filter for &#8220;.abc&#8221; files, even though the dropdown doesn&#8217;t have it as an option? Guess what&#8230;<strong> you can</strong>.</p>
<p style="text-align: left;">Simply type:</p>
<blockquote>
<p style="text-align: left; padding-left: 30px;">*.abc</p>
</blockquote>
<p style="text-align: left;">in the &#8220;File name&#8221; textbox, and click press Enter.</p>
<p style="text-align: left;">This is the result:</p>
<p style="text-align: center;"><a href="http://mattrefghi.com/wordpress/wp-content/uploads/2009/04/fileopendialogfiltered.jpg" rel="lightbox[498]"><img class="size-full wp-image-504 aligncenter" src="http://mattrefghi.com/wordpress/wp-content/uploads/2009/04/fileopendialogfiltered.jpg" alt="A File-Open dialog with a custom filter applied." width="559" height="442" /></a></p>
<p style="text-align: left;">Notice how the &#8220;.torrent&#8221; file is no longer visible? This is because we just applied a custom filter, one that told the dialog to <em>only</em> display the files having an extension of &#8220;.abc&#8221;.  This little trick can be useful when you&#8217;re dealing with lots of a files -  it can reduce the clutter and make it easy to find something specific.</p>
<p style="text-align: left;">Here&#8217;s an interesting detail: if you take another look at the filter dropdown, as show in the screenshots, you&#8217;ll notice that the filter itself is shown in the name of the dropdown choice. Consider the &#8220;Torrents&#8221; filter from the above screenshot:</p>
<blockquote>
<p style="text-align: left; padding-left: 30px;">Torrents (<strong><span style="color: #339966;">*.torrent</span></strong>)</p>
</blockquote>
<p style="text-align: left;">The portion within the parentheses (green font) is the filter that Windows is internally applying when you select the dropdown. All we&#8217;re really doing by typing the filter directly in the &#8220;File name&#8221; textbox is bypassing the limited options in the user interface, likely using the same approach as Windows would had the option been available as a dropdown.</p>
<p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fmattrefghi.com%2Fwordpress%2F2009%2F04%2Fapplying-a-custom-filter-in-an-open-file-dialog%2F&amp;linkname=Applying%20a%20Custom%20Filter%20in%20an%20Open%20File%20Dialog" title="Digg" rel="nofollow" target="_blank"><img src="http://mattrefghi.com/wordpress/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fmattrefghi.com%2Fwordpress%2F2009%2F04%2Fapplying-a-custom-filter-in-an-open-file-dialog%2F&amp;linkname=Applying%20a%20Custom%20Filter%20in%20an%20Open%20File%20Dialog" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://mattrefghi.com/wordpress/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fmattrefghi.com%2Fwordpress%2F2009%2F04%2Fapplying-a-custom-filter-in-an-open-file-dialog%2F&amp;linkname=Applying%20a%20Custom%20Filter%20in%20an%20Open%20File%20Dialog" title="Twitter" rel="nofollow" target="_blank"><img src="http://mattrefghi.com/wordpress/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fmattrefghi.com%2Fwordpress%2F2009%2F04%2Fapplying-a-custom-filter-in-an-open-file-dialog%2F&amp;linkname=Applying%20a%20Custom%20Filter%20in%20an%20Open%20File%20Dialog" title="Facebook" rel="nofollow" target="_blank"><img src="http://mattrefghi.com/wordpress/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fmattrefghi.com%2Fwordpress%2F2009%2F04%2Fapplying-a-custom-filter-in-an-open-file-dialog%2F&amp;linkname=Applying%20a%20Custom%20Filter%20in%20an%20Open%20File%20Dialog" title="Reddit" rel="nofollow" target="_blank"><img src="http://mattrefghi.com/wordpress/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://mattrefghi.com/wordpress/2009/04/applying-a-custom-filter-in-an-open-file-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
