<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>John Koerner's Page</title>
    <link>http://www.johnkoerner.net/</link>
    <description>Programming, Computers, etc...</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2 - http://www.s9y.org/</generator>
    
    <image>
        <url>http://www.johnkoerner.net/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: John Koerner's Page - Programming, Computers, etc...</title>
        <link>http://www.johnkoerner.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Running Multiple Iterations of a Test using MSTest</title>
    <link>http://www.johnkoerner.net/index.php?/archives/59-Running-Multiple-Iterations-of-a-Test-using-MSTest.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/59-Running-Multiple-Iterations-of-a-Test-using-MSTest.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=59</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=59</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    I recently ran into a scenario where I wanted to run all of my tests within a TestClass multiple times, each with a different Selenium browser.   I did not want to resort to having each test have a loop within it or force each test to have a data source that fed it the browsers.
&lt;br /&gt;&lt;br /&gt;
After doing some &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=102&amp;amp;entry_id=59&quot;  onmouseover=&quot;window.status=&#039;http://stackoverflow.com/q/872669/573218&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;digging&quot;&gt;digging&lt;/a&gt;, more &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=103&amp;amp;entry_id=59&quot;  onmouseover=&quot;window.status=&#039;http://stackoverflow.com/q/557228/573218&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;digging&quot;&gt;digging&lt;/a&gt;, and more &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=104&amp;amp;entry_id=59&quot;  onmouseover=&quot;window.status=&#039;http://sqa.stackexchange.com/q/1562/4746&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;digging&quot;&gt;digging&lt;/a&gt; I thought all hope was lost.&lt;br /&gt;&lt;br /&gt;

Then I ran across this &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=105&amp;amp;entry_id=59&quot; title=&quot;http://blogs.msdn.com/b/vstsqualitytools/archive/2009/09/04/extending-the-visual-studio-unit-test-type-part-2.aspx&quot;  onmouseover=&quot;window.status=&#039;http://blogs.msdn.com/b/vstsqualitytools/archive/2009/09/04/extending-the-visual-studio-unit-test-type-part-2.aspx&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;article &lt;/a&gt; on extending the Visual Studio test types and decided to see if that would work.  To alleviate the suspense, yes, it did work, and after the break I will show you how. &lt;br /&gt;&lt;a href=&quot;http://www.johnkoerner.net/index.php?/archives/59-Running-Multiple-Iterations-of-a-Test-using-MSTest.html#extended&quot;&gt;Continue reading &quot;Running Multiple Iterations of a Test using MSTest&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 27 Jan 2013 23:46:07 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/59-guid.html</guid>
    
</item>
<item>
    <title>Dragging from an Application and Creating a File</title>
    <link>http://www.johnkoerner.net/index.php?/archives/58-Dragging-from-an-Application-and-Creating-a-File.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/58-Dragging-from-an-Application-and-Creating-a-File.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=58</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=58</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    There was a recent &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=100&amp;amp;entry_id=58&quot; title=&quot;http://stackoverflow.com/q/14293908/573218&quot;  onmouseover=&quot;window.status=&#039;http://stackoverflow.com/q/14293908/573218&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;question&lt;/a&gt; on StackOverflow asking how to drag content from a rich text box and drop it into windows explorer to create a file.  I did some digging and found that this was surprisingly easy to do.  The thing to understand is that Explorer drag and drop expects the file to exist.  So the solution I came up with was when the mouse leaves the RTB, if the left button is down, we save a temporary file and then setup the drag and drop.
&lt;br /&gt;
&lt;div class=&#039;code&#039;&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;font color=&#039;blue&#039;&gt;private&amp;#160;void&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;richTextBox1_MouseLeave_1(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;object&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;sender,&amp;#160;EventArgs&amp;#160;e)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;//&amp;#160;If&amp;#160;the&amp;#160;left&amp;#160;mouse&amp;#160;button&amp;#160;is&amp;#160;down&amp;#160;when&amp;#160;leaving&amp;#160;the&amp;#160;rtb&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;if&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;(MouseButtons&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;==&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;MouseButtons.Left)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;//&amp;#160;Write&amp;#160;everything&amp;#160;to&amp;#160;a&amp;#160;temp&amp;#160;file.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.IO.File.WriteAllText(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;@&quot;c:\Temp\helloWorld.rtf&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;richTextBox1.SelectedRtf)&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;string&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;[]&amp;#160;filenames&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;{&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;@&quot;c:\Temp\helloWorld.rtf&quot;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;}&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;DataObject&amp;#160;obj&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;new&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;DataObject()&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;//&amp;#160;Set&amp;#160;the&amp;#160;drag&amp;#160;drop&amp;#160;data&amp;#160;with&amp;#160;the&amp;#160;FileDrop&amp;#160;format&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;obj.SetData(DataFormats.FileDrop,&amp;#160;filenames)&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;//&amp;#160;Start&amp;#160;the&amp;#160;drag&amp;#160;drop&amp;#160;effect&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;DoDragDrop(obj,&amp;#160;DragDropEffects.All)&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;}&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;/font&gt;
	&lt;/div&gt;
	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;
	&lt;span style=&#039;font-family:tahoma;font-size:8pt;color:#808080&#039;&gt;Colorized by: &lt;a style=&#039;color:#808080&#039; href=&quot;http://www.johnkoerner.net/exit.php?url_id=101&amp;amp;entry_id=58&quot; title=&quot;http://www.CarlosAg.net/Tools/CodeColorizer/&quot;  onmouseover=&quot;window.status=&#039;http://www.CarlosAg.net/Tools/CodeColorizer/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;
&lt;br/&gt;&lt;br/&gt;

That&#039;s it.  Now you can highlight some text in the RTB and drag it out to a folder and it will create a file called helloworld.rtf.
 
    </content:encoded>

    <pubDate>Sun, 13 Jan 2013 22:48:05 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/58-guid.html</guid>
    
</item>
<item>
    <title>Windows 8 From Scratch - Draggable Images</title>
    <link>http://www.johnkoerner.net/index.php?/archives/57-Windows-8-From-Scratch-Draggable-Images.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/57-Windows-8-From-Scratch-Draggable-Images.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=57</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=57</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    In this video we go over the steps required to create draggable images in your Windows 8 application. We start from a brand new application so you understand all of the pieces required to get it working. 
&lt;br /&gt;&lt;br /&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/PiPNYGzlDmw&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;br /&gt;&lt;br /&gt;
Code after the break.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://www.johnkoerner.net/index.php?/archives/57-Windows-8-From-Scratch-Draggable-Images.html#extended&quot;&gt;Continue reading &quot;Windows 8 From Scratch - Draggable Images&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 21 Oct 2012 22:21:29 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/57-guid.html</guid>
    
</item>
<item>
    <title>Windows 8 From Scratch - Application Settings</title>
    <link>http://www.johnkoerner.net/index.php?/archives/56-Windows-8-From-Scratch-Application-Settings.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/56-Windows-8-From-Scratch-Application-Settings.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=56</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=56</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    In this video we go over the steps required to create a settings page for your Windows 8 application.  We start from a brand new application so you understand all of the pieces required to get it working.
&lt;br /&gt;&lt;br /&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/F8jVk8xIUE0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Oct 2012 23:54:59 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/56-guid.html</guid>
    
</item>
<item>
    <title>VS 2012 - Get Rid of Uppercase Menu</title>
    <link>http://www.johnkoerner.net/index.php?/archives/55-VS-2012-Get-Rid-of-Uppercase-Menu.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/55-VS-2012-Get-Rid-of-Uppercase-Menu.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=55</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=55</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    One of the first things I found jarring when I logged into VS 2012 was the uppercase menu.
&lt;br /&gt;&lt;br /&gt;
&lt;img src=&quot;images/UpperMenu.png&quot; alt=&quot;&quot; /&gt;
&lt;br /&gt;&lt;br /&gt;
I hate when my IDE yells at me, and by default it is now doing it all the time.  What gives?  It turns out there is an easy registry fix to get the menus back to normal.  Simply set the following registry key:
&lt;br /&gt;&lt;br /&gt;
&lt;blockquote&gt;[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General]&lt;br /&gt;
&quot;SuppressUppercaseConversion&quot;=dword:00000001&lt;/blockquote&gt;
Restart VS 2012, and everything is back to normal.  Well, as normal as VS 2012 gets.
&lt;br /&gt;&lt;br /&gt;
&lt;img src=&quot;images/FixedMenu.png&quot; alt=&quot;&quot; /&gt;
&lt;br /&gt;&lt;br /&gt;
Here is a reg file you can download to perform the fix for you:&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;DL/VS2012SuppressUppercase.reg&quot; target=&quot;_blank&quot;&gt;Suppress Uppercase Menu in VS 2012.reg&lt;/a&gt; 
    </content:encoded>

    <pubDate>Sun, 23 Sep 2012 00:28:09 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/55-guid.html</guid>
    
</item>
<item>
    <title>Jquery - Animating a car</title>
    <link>http://www.johnkoerner.net/index.php?/archives/54-Jquery-Animating-a-car.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/54-Jquery-Animating-a-car.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=54</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=54</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    There was a &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=97&amp;amp;entry_id=54&quot;  onmouseover=&quot;window.status=&#039;http://stackoverflow.com/questions/12513298/jquery-truck-movement-on-road-map-animation#comment16844606_12513298&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;question&quot;&gt;question &lt;/a&gt;over on stackoverflow the other day that I had some fun with.  Someone asked how to animate a truck moving on a map.  The implementation I provided was a static one and would only work for this map, but it was kind of fun to see the result.  I figured I would share the result here.  
&lt;br /&gt;&lt;br /&gt;
&lt;iframe style=&quot;width: 100%; height: 450px&quot; src=&quot;http://jsfiddle.net/johnkoer/PPVda/112/embedded/result,js,resources,html,css&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt; 
    </content:encoded>

    <pubDate>Fri, 21 Sep 2012 20:51:53 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/54-guid.html</guid>
    
</item>
<item>
    <title>Processing Command Line Applications using C#</title>
    <link>http://www.johnkoerner.net/index.php?/archives/53-Processing-Command-Line-Applications-using-C.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/53-Processing-Command-Line-Applications-using-C.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=53</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    Here is a quick video on how to get at the output from a command line application in C# 4.0:
&lt;br /&gt;&lt;br /&gt;

&lt;iframe width=&quot;960&quot; height=&quot;720&quot; src=&quot;http://www.youtube.com/v/BDTCviA-5M8&amp;hd=1&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;br /&gt;Code Snippets after the break. &lt;br /&gt;&lt;a href=&quot;http://www.johnkoerner.net/index.php?/archives/53-Processing-Command-Line-Applications-using-C.html#extended&quot;&gt;Continue reading &quot;Processing Command Line Applications using C#&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue,  8 May 2012 22:51:48 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/53-guid.html</guid>
    
</item>
<item>
    <title>ImgUr Album Downloader</title>
    <link>http://www.johnkoerner.net/index.php?/archives/52-ImgUr-Album-Downloader.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/52-ImgUr-Album-Downloader.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=52</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    I had some friends upload an album to imgur and I wanted to download them to my computer, but I found that imgur did not have an easy way to do this; So I wrote a little app that will let you download all pictures in an album directly to your machine.&lt;br /&gt;&lt;br /&gt;

Simply put the URL of the album into the Album URL text box and click the download button.  By default it will save the images to your My Pictures\ImgUr Albums folder, but that can be changed using the settings button.  Also, the folder icon will take you directly to the folder of the last album downloaded.&lt;br /&gt;&lt;br /&gt;  
&lt;img src=&quot;images/ImgurAlbumDownloader.png&quot; alt=&quot;&quot; /&gt;
&lt;br /&gt;&lt;br /&gt;

If you have any suggestions, post them here.
&lt;br /&gt;&lt;br /&gt;
Download the application &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=95&amp;amp;entry_id=52&quot;  onmouseover=&quot;window.status=&#039;http://www.johnkoerner.com/dl/AlbumDownloaderSetup.msi&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Download&quot;&gt;here&lt;/a&gt;.

&lt;br /&gt;&lt;br /&gt;
Update:  I have updated the installer to use a more standard installation package, which should alleviate problems in chrome and firefox.
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Update 2012-06-27&lt;/b&gt;:  The downloader has been updated to support albums with more than 56 items in it.  
    </content:encoded>

    <pubDate>Wed, 23 Nov 2011 21:22:19 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/52-guid.html</guid>
    
</item>
<item>
    <title>Using Reddit's API in C#</title>
    <link>http://www.johnkoerner.net/index.php?/archives/51-Using-Reddits-API-in-C.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/51-Using-Reddits-API-in-C.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=51</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=51</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    	&lt;style&gt;
		.code {
			word-wrap:break-word;
			margin:10px;
			padding:10px;
			border:2px ridge white;
			background-color:#eeeeee;
			font-family:Courier New;
			font-size:10pt;
			}
	&lt;/style&gt;
I started using Reddit&#039;s API in C# to try and get a list of stories and comments.  It took me a bit to get the JSON syntax parsing right, so for anyone who needs help here is a decent example of loading the list of stories from r/all.
&lt;br /&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.johnkoerner.net/index.php?/archives/51-Using-Reddits-API-in-C.html#extended&quot;&gt;Continue reading &quot;Using Reddit&#039;s API in C#&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon,  3 Oct 2011 12:00:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/51-guid.html</guid>
    
</item>
<item>
    <title>Windows Azure:  The subscription Id or the certificate provided is invalid</title>
    <link>http://www.johnkoerner.net/index.php?/archives/50-Windows-Azure-The-subscription-Id-or-the-certificate-provided-is-invalid.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/50-Windows-Azure-The-subscription-Id-or-the-certificate-provided-is-invalid.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    When testing an Azure application against the Microsoft Platform Ready tool, I received the error &quot;The subscription Id or the certificate provided is invalid&quot;.  
&lt;br /&gt;&lt;br /&gt;
&lt;img src=&quot;images/InvalidSubscription.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;I triple checked my subscription Id and I knew that the certificate I was referencing was associated with my hosted service, so I didn&#039;t understand the issue.

&lt;br /&gt;&lt;br /&gt;It turns out the certificate they are looking for is actually a management certificate associated with the subscription and not one tied to the hosted service.  So under your Azure management portal, go to the &quot;Hosted Services, Storage Accounts &amp;amp; CDN&quot; and select the Management certificates section, and use a certificate from there, or upload one if you haven&#039;t used one yet.
&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;Images/ManagementCertificate.png&quot; alt=&quot;&quot; /&gt; 
    </content:encoded>

    <pubDate>Sat,  1 Oct 2011 20:20:06 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/50-guid.html</guid>
    
</item>
<item>
    <title>Creating a Firewall Exception in VB.Net</title>
    <link>http://www.johnkoerner.net/index.php?/archives/49-Creating-a-Firewall-Exception-in-VB.Net.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/49-Creating-a-Firewall-Exception-in-VB.Net.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=49</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=49</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    	&lt;style&gt;
		.code {
			word-wrap:break-word;
			margin:10px;
			padding:10px;
			border:2px ridge white;
			background-color:#eeeeee;
			font-family:Courier New;
			font-size:10pt;
			}
	&lt;/style&gt;
Windows Vista and 7 provide a rather robust firewall API that can be used to add exceptions to the firewall.  The code below will add an exception to the windows firewall for the specified application, provided that the code is run with administrator privileges. Add a reference to &lt;b&gt;%systemroot%\system32\FirewallAPI.dll&lt;/b&gt; to your application.&lt;br /&gt;&lt;br /&gt;&lt;div class=&#039;code&#039;&gt;
&lt;font color=&#039;blue&#039;&gt;Imports&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;NetFwTypeLib&lt;br /&gt;
&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Public&amp;#160;Class&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Form1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Private&amp;#160;Sub&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button1_Click(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;sender&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Object&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;e&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.EventArgs)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Handles&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button1.Click&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Create&amp;#160;the&amp;#160;Application&amp;#160;we&amp;#160;want&amp;#160;to&amp;#160;add&amp;#160;to&amp;#160;the&amp;#160;exception&amp;#160;list&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;appType&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Type&amp;#160;=&amp;#160;Type&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.GetTypeFromProgID(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;HnetCfg.FwAuthorizedApplication&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;app&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;INetFwAuthorizedApplication&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;app&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;DirectCast(Activator.CreateInstance(appType),&amp;#160;INetFwAuthorizedApplication)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Set&amp;#160;the&amp;#160;application&amp;#160;properties&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;app.Name&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;Negative0&#039;s&amp;#160;Sandbox&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;app.ProcessImageFileName&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;C:\Users\Negative0\vbsandbox2.exe&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;app.Enabled&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Get&amp;#160;the&amp;#160;firewall&amp;#160;manager,&amp;#160;so&amp;#160;we&amp;#160;can&amp;#160;get&amp;#160;the&amp;#160;list&amp;#160;of&amp;#160;authorized&amp;#160;apps&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;fwMgrType&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Type&amp;#160;=&amp;#160;Type&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.GetTypeFromProgID(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;HnetCfg.FwMgr&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;fwMgr&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;INetFwMgr&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;fwMgr&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;DirectCast(Activator.CreateInstance(fwMgrType),&amp;#160;INetFwMgr)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Get&amp;#160;the&amp;#160;list&amp;#160;of&amp;#160;authorized&amp;#160;applications&amp;#160;from&amp;#160;the&amp;#160;Firewall&amp;#160;Manager,&amp;#160;so&amp;#160;we&amp;#160;can&amp;#160;add&amp;#160;our&amp;#160;app&amp;#160;to&amp;#160;that&amp;#160;list&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;apps&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;INetFwAuthorizedApplications&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;apps&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplications&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;apps.Add(app)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;Sub&lt;br /&gt;
&lt;br /&gt;
End&amp;#160;Class&lt;/font&gt;
	&lt;/div&gt;
	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;
	&lt;span style=&#039;font-family:tahoma;font-size:8pt;color:#808080&#039;&gt;Colorized by: &lt;a style=&#039;color:#808080&#039; href=&quot;http://www.johnkoerner.net/exit.php?url_id=91&amp;amp;entry_id=49&quot; title=&quot;http://www.CarlosAg.net/Tools/CodeColorizer/&quot;  onmouseover=&quot;window.status=&#039;http://www.CarlosAg.net/Tools/CodeColorizer/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;

 
    </content:encoded>

    <pubDate>Mon, 21 Dec 2009 22:30:46 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/49-guid.html</guid>
    
</item>
<item>
    <title>Find Pixels on the screen by color without using GetPixel API.</title>
    <link>http://www.johnkoerner.net/index.php?/archives/48-Find-Pixels-on-the-screen-by-color-without-using-GetPixel-API..html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/48-Find-Pixels-on-the-screen-by-color-without-using-GetPixel-API..html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    Occasionally I need to write an app that reads pixels from the screen.  When searching small chunks of the screen, the windows GetPixel API works fine, but if I need to search the whole screen, that gets too slow.  One way that I have found that is about twice as fast as GetPixel is copying the screen to a bitmap and using the Bitmap&#039;s GetPixel method.  Below is an extension method that works with the Screen class to find pixels.
&lt;br /&gt;
	&lt;style&gt;
		.code {
			word-wrap:break-word;
			margin:10px;
			padding:10px;
			border:2px ridge white;
			background-color:#eeeeee;
			font-family:Courier New;
			font-size:10pt;
			}
	&lt;/style&gt;
&lt;div class=&#039;code&#039;&gt;
&lt;font color=&#039;blue&#039;&gt;Module&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenExtensions&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;lt;Extension()&amp;gt;&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Public&amp;#160;Function&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;FindPixelsByColor(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;CurrentScreen&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Screen,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;SearchColor&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Color)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;List(Of&amp;#160;Point)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenBitmap&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Bitmap&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Nothing&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenCopier&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Graphics&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Nothing&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;CurrentScreen&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Is&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Nothing&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&amp;#160;Throw&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ArgumentException(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;The&amp;#160;screen&amp;#160;object&amp;#160;is&amp;#160;nothing.&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;SearchColor&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Color.Empty&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&amp;#160;Throw&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ArgumentException(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;The&amp;#160;search&amp;#160;color&amp;#160;is&amp;#160;empty.&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Try&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Initialize&amp;#160;our&amp;#160;output&amp;#160;of&amp;#160;points.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;OutputPoints&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;List(Of&amp;#160;Point)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Create&amp;#160;the&amp;#160;bitmap&amp;#160;object&amp;#160;that&amp;#160;will&amp;#160;be&amp;#160;used&amp;#160;to&amp;#160;store&amp;#160;the&amp;#160;image&amp;#160;of&amp;#160;the&amp;#160;screen.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenBitmap&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Bitmap(CurrentScreen.WorkingArea.Width,&amp;#160;CurrentScreen.WorkingArea.Height,&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Imaging.PixelFormat.Format32bppArgb)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Create&amp;#160;the&amp;#160;graphics&amp;#160;object&amp;#160;that&amp;#160;will&amp;#160;be&amp;#160;used&amp;#160;to&amp;#160;copy&amp;#160;the&amp;#160;screen&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenCopier&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Graphics.FromImage(ScreenBitmap)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Copy&amp;#160;from&amp;#160;the&amp;#160;screen&amp;#160;to&amp;#160;the&amp;#160;bitmap,&amp;#160;so&amp;#160;we&amp;#160;can&amp;#160;search&amp;#160;for&amp;#160;the&amp;#160;pixels&amp;#160;we&amp;#160;are&amp;#160;looking&amp;#160;for&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenCopier.CopyFromScreen(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Point(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;),&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Point(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;),&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Size(CurrentScreen.WorkingArea.Width,&amp;#160;CurrentScreen.WorkingArea.Height))&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenColor&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Color&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Loop&amp;#160;through&amp;#160;all&amp;#160;of&amp;#160;the&amp;#160;pixels&amp;#160;in&amp;#160;the&amp;#160;bitmap&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;For&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;x&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&amp;#160;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;To&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;CurrentScreen.WorkingArea.Width&amp;#160;-&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;1&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;For&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;y&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&amp;#160;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;To&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;CurrentScreen.WorkingArea.Height&amp;#160;-&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;1&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Get&amp;#160;the&amp;#160;color&amp;#160;at&amp;#160;the&amp;#160;current&amp;#160;pixel&amp;#160;from&amp;#160;the&amp;#160;screenshot.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenColor&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenBitmap.GetPixel(x,&amp;#160;y)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Compare&amp;#160;the&amp;#160;color&amp;#160;from&amp;#160;the&amp;#160;screenshot&amp;#160;with&amp;#160;the&amp;#160;desired&amp;#160;color.&amp;#160;&amp;#160;We&amp;#160;need&amp;#160;to&amp;#160;level&amp;#160;off&amp;#160;the&amp;#160;alpha&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&#039;&amp;#160;for&amp;#160;this&amp;#160;compare&amp;#160;to&amp;#160;work&amp;#160;properly.&amp;#160;&amp;#160;All&amp;#160;colors&amp;#160;from&amp;#160;the&amp;#160;screenshot&amp;#160;have&amp;#160;an&amp;#160;alpha&amp;#160;of&amp;#160;255.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenColor&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Color.FromArgb(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;255&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;SearchColor)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;If&amp;#160;we&amp;#160;have&amp;#160;a&amp;#160;match,&amp;#160;then&amp;#160;add&amp;#160;the&amp;#160;current&amp;#160;x,y&amp;#160;to&amp;#160;our&amp;#160;output.&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;OutputPoints.Add(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Point(x,&amp;#160;y))&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;If&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Next&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Next&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Return&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;OutputPoints&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Catch&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ex&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Exception&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Throw&amp;#160;New&amp;#160;Exception&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;Unable&amp;#160;to&amp;#160;perform&amp;#160;pixel&amp;#160;search.&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;ex)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Finally&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenBitmap&amp;#160;IsNot&amp;#160;Nothing&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenBitmap.Dispose()&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenCopier&amp;#160;IsNot&amp;#160;Nothing&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ScreenCopier.Dispose()&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;Try&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;End&amp;#160;Function&lt;br /&gt;
End&amp;#160;Module&lt;/font&gt;
	&lt;/div&gt;
	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;
	&lt;span style=&#039;font-family:tahoma;font-size:8pt;color:#808080&#039;&gt;Colorized by: &lt;a style=&#039;color:#808080&#039; href=&quot;http://www.johnkoerner.net/exit.php?url_id=90&amp;amp;entry_id=48&quot; title=&quot;http://www.CarlosAg.net/Tools/CodeColorizer/&quot;  onmouseover=&quot;window.status=&#039;http://www.CarlosAg.net/Tools/CodeColorizer/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;

	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;

&lt;br /&gt;&lt;br /&gt;To use this class. You can simply call it from any screen object.  For example:
&lt;br /&gt;&lt;br /&gt;&lt;div class=&#039;code&#039;&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;l&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;List(Of&amp;#160;Point)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;l&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Screen.PrimaryScreen.FindPixelsByColor(Color.FromArgb(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;128&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;128&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;128&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;))&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;MessageBox.Show(l.Count.ToString())&lt;/font&gt;
	&lt;/div&gt;
	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;
	&lt;span style=&#039;font-family:tahoma;font-size:8pt;color:#808080&#039;&gt;Colorized by: &lt;a style=&#039;color:#808080&#039; href=&quot;http://www.johnkoerner.net/exit.php?url_id=90&amp;amp;entry_id=48&quot; title=&quot;http://www.CarlosAg.net/Tools/CodeColorizer/&quot;  onmouseover=&quot;window.status=&#039;http://www.CarlosAg.net/Tools/CodeColorizer/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;

&lt;br /&gt;	 
    </content:encoded>

    <pubDate>Sun, 29 Nov 2009 22:27:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/48-guid.html</guid>
    
</item>
<item>
    <title>Taking a screenshot in VB.Net</title>
    <link>http://www.johnkoerner.net/index.php?/archives/47-Taking-a-screenshot-in-VB.Net.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/47-Taking-a-screenshot-in-VB.Net.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=47</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=47</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    Taking a screenshot from a .Net app is very easy.  The function to use is the CopyFromScreen function from the Graphics class.
&lt;br /&gt;&lt;br /&gt;
	&lt;style&gt;
		.code {
			word-wrap:break-word;
			margin:10px;
			padding:10px;
			border:2px ridge white;
			background-color:#eeeeee;
			font-family:Courier New;
			font-size:10pt;
			}
	&lt;/style&gt;&lt;div class=&#039;code&#039;&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;b&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Bitmap&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;Hide&amp;#160;the&amp;#160;form,&amp;#160;so&amp;#160;it&amp;#160;doesn&#039;t&amp;#160;show&amp;#160;in&amp;#160;the&amp;#160;screenshot&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Me&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.Hide()&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;b&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Bitmap(My.Computer.Screen.WorkingArea.Width,&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;My.Computer.Screen.WorkingArea.Height,&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Imaging.PixelFormat.Format32bppArgb)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;g&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Graphics&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Graphics.FromImage(b)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;g.CopyFromScreen(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Point(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;),&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Point(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;0&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;),&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Size(My.Computer.Screen.WorkingArea.Width,&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;My.Computer.Screen.WorkingArea.Height))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;Show&amp;#160;the&amp;#160;form&amp;#160;again&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Me&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.Show()&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;Save&amp;#160;the&amp;#160;file&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ofd&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;SaveFileDialog&amp;#160;()&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;ofd.Filter&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;(*.bmp)|*.bmp&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;If&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ofd.ShowDialog()&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Windows.Forms.DialogResult.OK&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Then&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;b.Save(ofd.FileName)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;If&amp;#160;&lt;/font&gt;
	&lt;/div&gt;
	&lt;hr style=&#039;height:1px;background-color:#808080&#039; /&gt;
	&lt;span style=&#039;font-family:tahoma;font-size:8pt;color:#808080&#039;&gt;Colorized by: &lt;a style=&#039;color:#808080&#039; href=&quot;http://www.johnkoerner.net/exit.php?url_id=92&amp;amp;entry_id=47&quot; title=&quot;http://www.CarlosAg.net/Tools/CodeColorizer/&quot;  onmouseover=&quot;window.status=&#039;http://www.CarlosAg.net/Tools/CodeColorizer/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;
 
    </content:encoded>

    <pubDate>Sat, 14 Mar 2009 13:24:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/47-guid.html</guid>
    
</item>
<item>
    <title>Using the ShowWindow API on a VB6 App from .Net</title>
    <link>http://www.johnkoerner.net/index.php?/archives/46-Using-the-ShowWindow-API-on-a-VB6-App-from-.Net.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/46-Using-the-ShowWindow-API-on-a-VB6-App-from-.Net.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    I was helping someone with an issue &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=88&amp;amp;entry_id=46&quot; title=&quot;http://www.vbforums.com/showthread.php?t=557314&quot;  onmouseover=&quot;window.status=&#039;http://www.vbforums.com/showthread.php?t=557314&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;restoring &lt;/a&gt; vb6 windows from a .Net application over on &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=89&amp;amp;entry_id=46&quot; title=&quot;http://www.vbforums.com&quot;  onmouseover=&quot;window.status=&#039;http://www.vbforums.com&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;VBForums&lt;/a&gt;.  The issue ended up being that the MainWindowHandle of the process was returning the window handle for the ThunderRT6Main window.  The ThunderRT6Main is a hidden window that all VB6 apps have that is used for message processing.  When we called ShowWindow against this window handle, nothing would happen.  To get around this, I ended up calling the GetWindow API with a GW_HWNDPREV to get the window handle of the form window and then called ShowWindow on that.&lt;br /&gt;&lt;br /&gt;
	&lt;div class=&#039;code&#039;&gt;
&amp;#160;&lt;font color=&#039;blue&#039;&gt;Private&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;SW_SHOWNORMAL&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&amp;#160;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;&amp;H1&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;lt;Runtime.InteropServices.DllImport(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;user32&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;EntryPoint:&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;ShowWindow&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&amp;gt;&amp;#160;_&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Private&amp;#160;Shared&amp;#160;Function&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ShowWindow(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;hwnd&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;IntPtr,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;nCmdShow&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;End&amp;#160;Function&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Declare&amp;#160;Auto&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Function&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;GetWindow&amp;#160;Lib&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;user32.dll&quot;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;(&amp;#160;_&lt;br /&gt;
&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;hWnd&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;IntPtr,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;uCmd&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;UInt32)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;IntPtr&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Const&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;GW_HWNDPREV&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;Integer&amp;#160;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;3&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;proc&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;New&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Process&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Private&amp;#160;Sub&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button1_Click(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;sender&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Object&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;e&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.EventArgs)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Handles&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button1.Click&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Start&amp;#160;the&amp;#160;process&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;With&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;proc&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;.StartInfo.FileName&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;c:\temp\project1.exe&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.Start()&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;With&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Wait&amp;#160;for&amp;#160;it&amp;#160;to&amp;#160;finish&amp;#160;loading&amp;#160;and&amp;#160;put&amp;#160;the&amp;#160;window&amp;#160;handle&amp;#160;into&amp;#160;the&amp;#160;form&amp;#160;caption&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;proc.WaitForInputIdle(&lt;/font&gt;&lt;font color=&#039;maroon&#039;&gt;10000&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Me&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;.Text&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;proc.MainWindowHandle.ToString(&lt;/font&gt;&lt;font color=&#039;#808080&#039;&gt;&quot;x8&quot;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Private&amp;#160;Sub&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button2_Click(&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;sender&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Object&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;,&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;ByVal&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;e&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;System.EventArgs)&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Handles&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;Button2.Click&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Call&amp;#160;GetWindow&amp;#160;with&amp;#160;GW_HWNDPREV&amp;#160;to&amp;#160;get&amp;#160;the&amp;#160;form&amp;#160;from&amp;#160;the&amp;#160;ThunderRT6Main&amp;#160;window&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;Dim&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;vb6Window&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;As&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;IntPtr&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;=&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;GetWindow(proc.MainWindowHandle,&amp;#160;GW_HWNDPREV)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;darkgreen&#039;&gt;&#039;&amp;#160;Call&amp;#160;ShowWindow&amp;#160;on&amp;#160;the&amp;#160;window&amp;#160;we&amp;#160;got&amp;#160;back&amp;#160;from&amp;#160;the&amp;#160;last&amp;#160;call,&amp;#160;which&amp;#160;should&amp;#160;be&amp;#160;the&amp;#160;ThunderRT6FormDC&amp;#160;window&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;black&#039;&gt;ShowWindow(vb6Window,&amp;#160;SW_SHOWNORMAL)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;&lt;font color=&#039;blue&#039;&gt;End&amp;#160;Sub&lt;/font&gt;
	&lt;/div&gt; 
    </content:encoded>

    <pubDate>Thu, 12 Feb 2009 22:14:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/46-guid.html</guid>
    
</item>
<item>
    <title>Keyboard Listener</title>
    <link>http://www.johnkoerner.net/index.php?/archives/45-Keyboard-Listener.html</link>
    
    <comments>http://www.johnkoerner.net/index.php?/archives/45-Keyboard-Listener.html#comments</comments>
    <wfw:comment>http://www.johnkoerner.net/wfwcomment.php?cid=45</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.johnkoerner.net/rss.php?version=2.0&amp;type=comments&amp;cid=45</wfw:commentRss>
    

    <author>nospam@example.com (JohnKoer)</author>
    <content:encoded>
    Whenever I need to write a keyboard listener, I always have to go back and search through old code to get the exact syntax.  I then end up copying and pasting a whole bunch of code.  I decided it was time to create a DLL that will handle all of this work for me.  I also decided that I will post the DLL up here for anyone to use as they see fit.
&lt;br /&gt;&lt;br /&gt;
The DLL is copyrighted, however, it is free for distribution with personal or commercial applications.
&lt;br /&gt;&lt;br /&gt;
The setup package, which includes a help file, a sample app, and the DLL, can be downloaded from the downloads page, or from the link below.
&lt;br /&gt;&lt;br /&gt;

Download: &lt;a href=&quot;http://www.johnkoerner.net/exit.php?url_id=87&amp;amp;entry_id=45&quot; title=&quot;http://johnkoerner.com/dl/KeyboardListener.msi&quot;  onmouseover=&quot;window.status=&#039;http://johnkoerner.com/dl/KeyboardListener.msi&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;KeyboardListener.msi&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
The sample app shows off the basic functionality of listening for one particular key, a set number of keys, or all key presses on a system.  Below is a screenshot of the sample application.  This dll works system wide, not just within the application that is using it.
&lt;br /&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.johnkoerner.com/images/KeyboardListenerForm.png&quot; alt=&quot;&quot; /&gt; 
    </content:encoded>

    <pubDate>Mon, 24 Nov 2008 15:30:28 -0500</pubDate>
    <guid isPermaLink="false">http://www.johnkoerner.net/index.php?/archives/45-guid.html</guid>
    
</item>

</channel>
</rss>