<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" 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/"><channel><title>Mark Schmidt's Abode : Cool Stuff</title><link>http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx</link><description>Tags: Cool Stuff</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>A Christmas Card for my Readers</title><link>http://blogs.msdn.com/markhsch/archive/2007/12/07/a-christmas-card-for-my-readers.aspx</link><pubDate>Sat, 08 Dec 2007 02:06:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6697884</guid><dc:creator>markhsch</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/6697884.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=6697884</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=6697884</wfw:comment><description>&lt;p&gt;Most people have seen it at least once in their life. In my family, the picture below is referenced every year. Merry Christmas and Happy Holidays.&lt;/p&gt; &lt;p&gt;-Mark &lt;strong&gt;Schmidt&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/AChristmasCardformyReaders_D46D/309854993_bba4665187_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="309854993_bba4665187" src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/AChristmasCardformyReaders_D46D/309854993_bba4665187_thumb.jpg" width="402" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Oh and a extra special shout out to all the Schmidt's at Microsoft including the 3 other Mark Schmidt's (yes, there are 4 Mark Schmidt's here)!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6697884" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Humor/default.aspx">Humor</category></item><item><title>C# WebCam User Control Source</title><link>http://blogs.msdn.com/markhsch/archive/2007/11/19/c-webcam-user-control-source.aspx</link><pubDate>Mon, 19 Nov 2007 23:52:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6410347</guid><dc:creator>markhsch</dc:creator><slash:comments>37</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/6410347.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=6410347</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=6410347</wfw:comment><description>&lt;p&gt;Some people have asked if they could take a look at the source for the WebCam Vista Sidebar gadget. After a little bit of cleaning up, I'm posting it now for you to take a look at. Here are some things worth mentioning:&lt;/p&gt; &lt;p&gt;1. Uses the DirectShow.NET library&lt;/p&gt; &lt;p&gt;2. I found some source in VB.NET and used that as a baseline (performed the conversion and cleaned up stuff that really wasn't needed)&lt;/p&gt; &lt;p&gt;3. I am in no way a DirectX/DirectShow expert. Any questions sent my way will likely result in a blank stare back at you :-) (though fwiw, I do pick up things quickly and might be able to at least get you started on the correct path)&lt;/p&gt; &lt;p&gt;4. If you look at the source, you might think "I thought this was a Vista Sidebar Gadget. Where is the gadget source?" That's the easy part. At the bottom of this post is a link to my .NET Gadget Creator application that I wrote (with instructions on how to use it with the WebCam control). That application will allow you to take any .NET UserControl and convert it into a Vista Sidebar Gadget. Just compile the WebCamControl2 control, and use the .NET Gadget Creator to create an instant Vista Sidebar gadget.&lt;/p&gt; &lt;p&gt;5. You may receive an error when you run the provided test application saying something along the lines of "invalid argument". This is a known issue and is happens when more than one application tries to access the same camera. I haven't looked into fixing this so if someone wants to take a stab at it, clue me in on how to fix it.&lt;/p&gt; &lt;p&gt;When looking through the source (there isn't that much to it) pay attention to the 2 primary methods. The first is the &lt;em&gt;GetInterfaces&lt;/em&gt; method which creates all the necessary DirectShow interfaces and then creates the connection between DirectShow and your UserControl window (events are passed to the control via Window messages).&lt;/p&gt; &lt;p&gt;The &lt;em&gt;FindCaptureDevice&lt;/em&gt; method enumerates through your devices looking for the 1st video device it finds that provides an input (&lt;em&gt;FilterCategory.InputDevice&lt;/em&gt;). This is done by creating a device class enumerator. Currently, the source will just grab the first device that it sees. If anyone is interested in knowing how to present the user with a list of all input devices, I can write some code to do that as well. Just let me know.&lt;/p&gt; &lt;p&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red43\green145\blue175;\red255\green255\blue255;\red0\green0\blue0;\red1\green0\blue1;\red0\green0\blue255;}??\fs20 \cf1 UCOMIEnumMoniker\cf0 {\b  }\cf4 classEnum\cf0 {\b  = }\cf5 null\cf0 {\b ;}\par ??\cf1 UCOMIMoniker\cf0 {\b [] }\cf4 moniker\cf0 {\b  = }\cf5 new\cf0 {\b  }\cf1 UCOMIMoniker\cf0 {\b [1];}\par ??\cf5 object\cf0 {\b  }\cf4 source\cf0 {\b  = }\cf5 null\cf0 {\b ;}\par ??\par ??\cf1 ICreateDevEnum\cf0 {\b  }\cf4 devEnum\cf0 {\b  = (}\cf1 ICreateDevEnum\cf0 {\b )(}\cf5 new\cf0 {\b  }\cf1 CreateDevEnum\cf0 {\b ());}\par ??\cf5 int\cf0 {\b  }\cf4 hr\cf0 {\b  = }\cf4 devEnum\cf0 .\cf4 CreateClassEnumerator\cf0 {\b (}\cf1 FilterCategory\cf0 .\cf4 VideoInputDevice\cf0 {\b , }\cf5 out\cf0 {\b  }\cf4 classEnum\cf0 {\b , }\cf1 CDef\cf0 .\cf4 None\cf0 {\b );}\par ??\cf1 DsError\cf0 .\cf4 ThrowExceptionForHR\cf0 {\b (}\cf4 hr\cf0 {\b );}\par ??\cf1 Marshal\cf0 .\cf4 ReleaseComObject\cf0 {\b (}\cf4 devEnum\cf0 {\b );}\par ??}
--&gt; &lt;div style="font-weight: bold; font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 103&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;UCOMIEnumMoniker&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;classEnum&lt;/span&gt; = &lt;span style="font-weight: normal; color: blue"&gt;null&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 104&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;UCOMIMoniker&lt;/span&gt;[] &lt;span style="font-weight: normal; color: #010001"&gt;moniker&lt;/span&gt; = &lt;span style="font-weight: normal; color: blue"&gt;new&lt;/span&gt; &lt;span style="font-weight: normal; color: #2b91af"&gt;UCOMIMoniker&lt;/span&gt;[1];&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 105&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;object&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;source&lt;/span&gt; = &lt;span style="font-weight: normal; color: blue"&gt;null&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 106&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 107&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;ICreateDevEnum&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;devEnum&lt;/span&gt; = (&lt;span style="font-weight: normal; color: #2b91af"&gt;ICreateDevEnum&lt;/span&gt;)(&lt;span style="font-weight: normal; color: blue"&gt;new&lt;/span&gt; &lt;span style="font-weight: normal; color: #2b91af"&gt;CreateDevEnum&lt;/span&gt;());&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 108&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;int&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;hr&lt;/span&gt; = &lt;span style="font-weight: normal; color: #010001"&gt;devEnum&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;CreateClassEnumerator&lt;/span&gt;(&lt;span style="font-weight: normal; color: #2b91af"&gt;FilterCategory&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;VideoInputDevice&lt;/span&gt;, &lt;span style="font-weight: normal; color: blue"&gt;out&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;classEnum&lt;/span&gt;, &lt;span style="font-weight: normal; color: #2b91af"&gt;CDef&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;None&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 109&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;DsError&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;ThrowExceptionForHR&lt;/span&gt;(&lt;span style="font-weight: normal; color: #010001"&gt;hr&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 110&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;Marshal&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;ReleaseComObject&lt;/span&gt;(&lt;span style="font-weight: normal; color: #010001"&gt;devEnum&lt;/span&gt;);&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Once the class enumerator is created, I just grab the first one that was found (assuming one was found) and bind it to an IBaseFilter object which I then return.&lt;/p&gt; &lt;p&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red1\green0\blue1;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 int\cf0 {\b  }\cf4 none\cf0 {\b  = 0;}\par ??\par ??\cf1 if\cf0 {\b  (}\cf4 classEnum\cf0 .\cf4 Next\cf0 {\b (}\cf4 moniker\cf0 .\cf4 Length\cf0 {\b , }\cf4 moniker\cf0 {\b , }\cf1 out\cf0 {\b  }\cf4 none\cf0 {\b ) == 0)}\par ??{\b \{}\par ??{\b     }\cf5 Guid\cf0 {\b  }\cf4 iid\cf0 {\b  = }\cf1 typeof\cf0 {\b (}\cf5 IBaseFilter\cf0 {\b ).}\cf4 GUID\cf0 {\b ;}\par ??{\b     }\cf4 moniker\cf0 {\b [0].}\cf4 BindToObject\cf0 {\b (}\cf1 null\cf0 {\b , }\cf1 null\cf0 {\b , }\cf1 ref\cf0 {\b  }\cf4 iid\cf0 {\b , }\cf1 out\cf0 {\b  }\cf4 source\cf0 {\b );}\par ??{\b \}}\par ??\cf1 else\par ??\cf0 {\b \{}\par ??{\b     }\cf1 throw\cf0 {\b  }\cf1 new\cf0 {\b  }\cf5 ApplicationException\cf0 {\b (}\cf6 "Unable to access video capture device!"\cf0 {\b );}\par ??{\b \}}\par ??\par ??\cf5 Marshal\cf0 .\cf4 ReleaseComObject\cf0 {\b (}\cf4 moniker\cf0 {\b [0]);}\par ??\cf5 Marshal\cf0 .\cf4 ReleaseComObject\cf0 {\b (}\cf4 classEnum\cf0 {\b );}\par ??\par ??\cf1 return\cf0 {\b  (}\cf5 IBaseFilter\cf0 {\b )}\cf4 source\cf0 {\b ;}\par ??}
--&gt; &lt;div style="font-weight: bold; font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 117&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;int&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;none&lt;/span&gt; = 0;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 118&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 119&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;if&lt;/span&gt; (&lt;span style="font-weight: normal; color: #010001"&gt;classEnum&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;Next&lt;/span&gt;(&lt;span style="font-weight: normal; color: #010001"&gt;moniker&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;Length&lt;/span&gt;, &lt;span style="font-weight: normal; color: #010001"&gt;moniker&lt;/span&gt;, &lt;span style="font-weight: normal; color: blue"&gt;out&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;none&lt;/span&gt;) == 0)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 120&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 121&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight: normal; color: #2b91af"&gt;Guid&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;iid&lt;/span&gt; = &lt;span style="font-weight: normal; color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="font-weight: normal; color: #2b91af"&gt;IBaseFilter&lt;/span&gt;).&lt;span style="font-weight: normal; color: #010001"&gt;GUID&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 122&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight: normal; color: #010001"&gt;moniker&lt;/span&gt;[0].&lt;span style="font-weight: normal; color: #010001"&gt;BindToObject&lt;/span&gt;(&lt;span style="font-weight: normal; color: blue"&gt;null&lt;/span&gt;, &lt;span style="font-weight: normal; color: blue"&gt;null&lt;/span&gt;, &lt;span style="font-weight: normal; color: blue"&gt;ref&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;iid&lt;/span&gt;, &lt;span style="font-weight: normal; color: blue"&gt;out&lt;/span&gt; &lt;span style="font-weight: normal; color: #010001"&gt;source&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 123&lt;/span&gt; }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 124&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;else&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 125&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 126&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight: normal; color: blue"&gt;throw&lt;/span&gt; &lt;span style="font-weight: normal; color: blue"&gt;new&lt;/span&gt; &lt;span style="font-weight: normal; color: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="font-weight: normal; color: #a31515"&gt;"Unable to access video capture device!"&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 127&lt;/span&gt; }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 128&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 129&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;Marshal&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;ReleaseComObject&lt;/span&gt;(&lt;span style="font-weight: normal; color: #010001"&gt;moniker&lt;/span&gt;[0]);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 130&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: #2b91af"&gt;Marshal&lt;/span&gt;&lt;span style="font-weight: normal"&gt;.&lt;/span&gt;&lt;span style="font-weight: normal; color: #010001"&gt;ReleaseComObject&lt;/span&gt;(&lt;span style="font-weight: normal; color: #010001"&gt;classEnum&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 131&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: normal; color: #2b91af"&gt;&amp;nbsp; 132&lt;/span&gt;&amp;nbsp;&lt;span style="font-weight: normal; color: blue"&gt;return&lt;/span&gt; (&lt;span style="font-weight: normal; color: #2b91af"&gt;IBaseFilter&lt;/span&gt;)&lt;span style="font-weight: normal; color: #010001"&gt;source&lt;/span&gt;;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Once the video input device is found and we have our base filter, we associate it with an ICaptureGraphBuilder2 object by telling it render a video stream through the preview pin of the input device(line 68 below of the CaptureVideo method).&lt;/p&gt; &lt;p&gt; &lt;style type="text/css"&gt;
.cf { font-family: consolas; font-size: 10pt; color: black; background: white; font-weight: bold; }
.cl { margin: 0px; }
.cln { color: #2b91af; font-weight: normal; }
.cb1 { color: blue; font-weight: normal; }
.cb2 { color: #010001; font-weight: normal; }
.cb3 { color: #2b91af; font-weight: normal; }
.cb4 { color: green; font-weight: normal; }
.cb5 { font-weight: normal; }
.cb6 { color: #a31515; font-weight: normal; }
&lt;/style&gt;  &lt;div class="cf"&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 51&lt;/span&gt;&amp;nbsp;&lt;span class="cb1"&gt;private&lt;/span&gt; &lt;span class="cb1"&gt;void&lt;/span&gt; &lt;span class="cb2"&gt;CaptureVideo&lt;/span&gt;()&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 52&lt;/span&gt; {&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 53&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb1"&gt;int&lt;/span&gt; &lt;span class="cb2"&gt;hr&lt;/span&gt; = 0;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 54&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;IBaseFilter&lt;/span&gt; &lt;span class="cb2"&gt;sourceFilter&lt;/span&gt; = &lt;span class="cb1"&gt;null&lt;/span&gt;;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 55&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb1"&gt;try&lt;/span&gt;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 56&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 57&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb4"&gt;// create the necessary DirectShow interfaces&lt;/span&gt;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 58&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;GetInterfaces&lt;/span&gt;();&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 59&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 60&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;hr&lt;/span&gt; = &lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;captureGraphBuilder&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;SetFiltergraph&lt;/span&gt;(&lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;graphBuilder&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 61&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;DsError&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ThrowExceptionForHR&lt;/span&gt;(&lt;span class="cb2"&gt;hr&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 62&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 63&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;sourceFilter&lt;/span&gt; = &lt;span class="cb2"&gt;FindCaptureDevice&lt;/span&gt;();&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 64&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 65&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;hr&lt;/span&gt; = &lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;graphBuilder&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;AddFilter&lt;/span&gt;(&lt;span class="cb2"&gt;sourceFilter&lt;/span&gt;, &lt;span class="cb6"&gt;"WebCamControl Video"&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 66&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;DsError&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ThrowExceptionForHR&lt;/span&gt;(&lt;span class="cb2"&gt;hr&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 67&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 68&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;hr&lt;/span&gt; = &lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;captureGraphBuilder&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;RenderStream&lt;/span&gt;(&lt;span class="cb3"&gt;PinCategory&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;Preview&lt;/span&gt;, &lt;span class="cb3"&gt;MediaType&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;Video&lt;/span&gt;, &lt;span class="cb2"&gt;sourceFilter&lt;/span&gt;, &lt;span class="cb1"&gt;null&lt;/span&gt;, &lt;span class="cb1"&gt;null&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 69&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;Debug&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;WriteLine&lt;/span&gt;(&lt;span class="cb3"&gt;DsError&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;GetErrorText&lt;/span&gt;(&lt;span class="cb2"&gt;hr&lt;/span&gt;));&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 70&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;DsError&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ThrowExceptionForHR&lt;/span&gt;(&lt;span class="cb2"&gt;hr&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 71&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 72&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;Marshal&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ReleaseComObject&lt;/span&gt;(&lt;span class="cb2"&gt;sourceFilter&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 73&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 74&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;SetupVideoWindow&lt;/span&gt;();&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 75&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 76&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb2"&gt;hr&lt;/span&gt; = &lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;mediaControl&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;Run&lt;/span&gt;();&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 77&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;DsError&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ThrowExceptionForHR&lt;/span&gt;(&lt;span class="cb2"&gt;hr&lt;/span&gt;);&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 78&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 79&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb1"&gt;this&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;CurrentState&lt;/span&gt; = &lt;span class="cb3"&gt;PlayState&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;Running&lt;/span&gt;;&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 80&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 81&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb1"&gt;catch&lt;/span&gt; (&lt;span class="cb3"&gt;Exception&lt;/span&gt; &lt;span class="cb2"&gt;ex&lt;/span&gt;)&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 82&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 83&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cb3"&gt;MessageBox&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;Show&lt;/span&gt;(&lt;span class="cb6"&gt;"An unrecoverable error has occurred.\r\n"&lt;/span&gt; + &lt;span class="cb2"&gt;ex&lt;/span&gt;&lt;span class="cb5"&gt;.&lt;/span&gt;&lt;span class="cb2"&gt;ToString&lt;/span&gt;());&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 84&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p class="cl"&gt;&lt;span class="cln"&gt;&amp;nbsp;&amp;nbsp; 85&lt;/span&gt; }&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now, if you want to use that control in the Vista Sidebar, just download and install the following application:&lt;/p&gt; &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-d0866aae93a8e1aa.skydrive.live.com/embedrowdetail.aspx/Blog/NetSBHostCreator.exe" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;When you launch the application and click Next it will ask you to add .NET assemblies. Click the Add button, navigate to the WebCamTest or WebCamControl2 bin directory and select the WebCamControl2.dll AND the DirectShowLib.dll assemblies as shown below.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/CWebCamUserControlSource_ACB1/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="151" alt="image" src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/CWebCamUserControlSource_ACB1/image_thumb.png" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click Next twice to get to the "Select UserControl to Embed". Select the WebCamControl2.WebCamControl2 type and click Next. The next screen allows you to enter the information about the gadget. I provided an icon for you in the WebCamTest base directory. After you fill in the information, keep clicking Next and the gadget will be built for you. Go into the output directory you specified and you'll see the .gadget file. Simply double click on this and if all goes well, you should be looking at your webcam in the Vista Sidebar. Also, since you used the .NET Gadget Creator application, your gadget will uninstall successfully even while it is running (see &lt;a title=".NET Sidebar Gadget Creator Update #2" href="http://blogs.msdn.com/markhsch/archive/2007/08/01/net-sidebar-gadget-creator-update-2.aspx"&gt;.NET Sidebar Gadget Creator Update #2&lt;/a&gt; for more information).&lt;/p&gt; &lt;p&gt;Without further ado, here's the link to the WebCamControl source code.&lt;/p&gt; &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-d0866aae93a8e1aa.skydrive.live.com/embedrowdetail.aspx/Blog/WebCamControl2_src.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/CWebCamUserControlSource_ACB1/image_10.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/CWebCamUserControlSource_ACB1/image_thumb_4.png" width="229" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6410347" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>New &amp; Improved NHL Schedule Importer for Outlook</title><link>http://blogs.msdn.com/markhsch/archive/2007/09/27/new-improved-nhl-schedule-importer-for-outlook.aspx</link><pubDate>Fri, 28 Sep 2007 01:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5174371</guid><dc:creator>markhsch</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/5174371.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=5174371</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=5174371</wfw:comment><description>&lt;P&gt;*EDIT*&amp;nbsp;Looks like the nhl.com scheduling page has changed thus breaking my importer. I'm working on a new version but no idea when it will be done. I've taken the link down.&lt;/P&gt;
&lt;P&gt;Ok, I redid the whole application (since I lost the source code) and added some new features as well. The previous application utilized XML which required you to actually get the NHL schedule in XML format somehow (I used Excel). Needless to say, it was a long and complicated process.&lt;/P&gt;
&lt;P&gt;This new version utilizes good old fashioned screen-scraping to get the job done. Here are some key features that I've added:&lt;/P&gt;
&lt;P&gt;1. Location field will tell if the stations the game is on for national and local (both away and home team) markets&lt;/P&gt;
&lt;P&gt;2. The body for each appointment when you open it up in Outlook contains links to each teams website as well as links to subscribe to that team's RSS feed (see screenshot below)&lt;/P&gt;
&lt;P&gt;3. ** Here's the cool feature ** After you ran the application and import your team's schedule, you can run the application at a later date and it will not create duplicate entries. In fact, if you run it a second time, it will add the game's final score and a link to show the recap of that game (again, see screenshot).&lt;/P&gt;
&lt;P&gt;4. You know have the ability to add an outlook reminder or not for each game&lt;/P&gt;
&lt;P&gt;5. UI is prettier. When you select a team from the drop down list, it will fetch that team's logo from the web and full team name (see screenshot).&lt;/P&gt;
&lt;P&gt;6. Internally everything is different. It would have been easy to allow you to select a year (e.g. 2008-2009) but I'll wait to add that. In any case, whenever a new NHL schedule is created, it's a trivial change to get the application to work with it.&lt;/P&gt;
&lt;P&gt;*NOTE* I tested this using Vista and Outlook 2007. If you have any issues when importing your team(s) schedule(s), let me know. It helps if you can send a screenshot or any error messages word for word. For developer types who know what a call stack is, send that as well if you can.&lt;/P&gt;
&lt;P&gt;Here's some screenshots followed by the link to download the application (complete with installer)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/importing_2.png" mce_href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/importing_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=importing src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/importing_thumb.png" width=518 border=0 mce_src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/importing_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/appointment_2.png" mce_href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/appointment_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=460 alt=appointment src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/appointment_thumb.png" width=644 border=0 mce_src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/appointment_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;H4&gt;&lt;EM&gt;&lt;/EM&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H1 align=left&gt;&lt;EM&gt;&lt;FONT color=#804040&gt;&amp;nbsp;&lt;A href="http://avalanche.nhl.com/" target=_blank mce_href="http://avalanche.nhl.com/"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=75 alt=col src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_3.png" width=75 border=0 mce_src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_3.png"&gt;&lt;/A&gt; GO AVS!!! &lt;A href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_5.png" mce_href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_5.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=75 alt=col src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_thumb_1.png" width=75 border=0 mce_src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/NewImprovedNHLScheduleImporterforOutlook_D4D0/col_thumb_1.png"&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/EM&gt;&lt;/H1&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5174371" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>Use for the WebCam Sidebar Gadget</title><link>http://blogs.msdn.com/markhsch/archive/2007/09/21/use-for-the-webcam-sidebar-gadget.aspx</link><pubDate>Fri, 21 Sep 2007 22:08:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5038359</guid><dc:creator>markhsch</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/5038359.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=5038359</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=5038359</wfw:comment><description>&lt;p&gt;Someone asked "Why would I want a WebCam Sidebar Gadget to display my webcam in realtime"?&lt;/p&gt; &lt;p&gt;Good question. Answer: So you are prepared when the maiger strikes again!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/UsefortheWebCamSidebarGadget_AA9F/maiger_sneek_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="182" alt="maiger_sneek" src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/UsefortheWebCamSidebarGadget_AA9F/maiger_sneek_thumb.png" width="182" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;It's Friday. What can I say.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5038359" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>.NET Sidebar Gadget Creator 2.0 Release</title><link>http://blogs.msdn.com/markhsch/archive/2007/08/09/net-sidebar-gadget-creator-2-0-release.aspx</link><pubDate>Fri, 10 Aug 2007 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4315540</guid><dc:creator>markhsch</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/4315540.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=4315540</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=4315540</wfw:comment><description>&lt;P&gt;Ok, I finally worked out most of the bugs (I hope). I'll post the link and follow up with some tutorials and Sidebar Gadget development using .NET.&lt;/P&gt;
&lt;P&gt;Here's the file...using the new SkyDrive Beta to host the file!!!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IFRAME style="BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff" marginWidth=0 marginHeight=0 src="http://cid-d0866aae93a8e1aa.skydrive.live.com/embedrowdetail.aspx/Blog/NetSBHostCreator.exe" frameBorder=0 scrolling=no mce_src="http://cid-d0866aae93a8e1aa.skydrive.live.com/embedrowdetail.aspx/Blog/NetSBHostCreator.exe"&gt;&lt;/IFRAME&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4315540" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/C_2F00_C_2B002B00_/default.aspx">C/C++</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>.NET Sidebar Gadget Creator Update #2</title><link>http://blogs.msdn.com/markhsch/archive/2007/08/01/net-sidebar-gadget-creator-update-2.aspx</link><pubDate>Thu, 02 Aug 2007 03:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4179370</guid><dc:creator>markhsch</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/4179370.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=4179370</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=4179370</wfw:comment><description>&lt;P&gt;I had quite the breakthrough today. First off, I totally rewrote major portions of the .NET Sidebar Gadget Creator. It is now a wizard (photos below) that leads you through the steps to create a Vista Sidebar that uses .NET. Here are some of the changes (then I'll explain my breakthrough):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can now create any .NET type. You have the "option" of embedding a UserControl as the UI but it isn't required. Have a cool class you want to use. This makes it easy.&lt;/LI&gt;
&lt;LI&gt;A .gadget file is automatically created for you. More often than not, you will need to fiddle around with the final result, but just in case, I went ahead and added this feature anyway&lt;/LI&gt;
&lt;LI&gt;Reworked the entire act of copying to temp directory and registering assemblies...this is the breakthrough&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As one reader pointed out, they noticed that I was simply copying the .NET assembly to the temp folder, creating the COM Interop registry keys to point to that location and having sidebar/Trident load it up from there. Was that the ideal solution? No way. He was right. It was the wrong way to do it. The benefit was that it allowed you to uninstall your gadget from the Sidebar UI, but left the file in the temp directory and orphaned registry keys.&lt;/P&gt;
&lt;P&gt;Here's the breakthrough. What if I told you that your .NET assemblies are not copyed over. They remain in your gadget directory. What if I also told you, you don't have to worry about registration. Yeah, so. You didn't with previous versions either right since my tool did it for you. Well, what if I told you that my tool also doesn't have to worry about registering your assemblies for COM interop? You heard right. Nothing about your assembly ever gets registered into the registry (i.e. I don't register your assembly for COM interop). However, you will still be loaded just fine and if you are a UserControl based object, you will be embedded. Additionally, you can still be safely uninstalled and all the gadget files will be deleted just fine.&lt;/P&gt;
&lt;P&gt;If you have a clue as to how I do this...feel free to submit your best guesses. I'm going to put the finishing touches on the tool and send it out. After that, I'll have a series of tutorials and an examination of the code (as well as my solution to how I solved this problem).&lt;/P&gt;
&lt;P&gt;Here's some pics:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179230/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179230/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179230/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179230/thumb.aspx"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179236/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179236/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179236/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179236/thumb.aspx"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179239/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179239/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179239/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179239/thumb.aspx"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179243/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179243/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179243/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179243/thumb.aspx"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179246/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179246/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179246/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179246/thumb.aspx"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/photos/markhsch/images/4179256/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/markhsch/images/4179256/original.aspx"&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/4179256/thumb.aspx" border=0 mce_src="http://blogs.msdn.com/photos/markhsch/images/4179256/thumb.aspx"&gt;&lt;/A&gt; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4179370" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/C_2F00_C_2B002B00_/default.aspx">C/C++</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>Creating .NET Sidebar Gadgets...The Easy Way</title><link>http://blogs.msdn.com/markhsch/archive/2007/07/17/creating-net-sidebar-gadgets-the-easy-way.aspx</link><pubDate>Tue, 17 Jul 2007 10:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3908804</guid><dc:creator>markhsch</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/3908804.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=3908804</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=3908804</wfw:comment><description>&lt;P&gt;So you want to create a Vista Sidebar gadget and you want to use .NET to do so. While it is certainly possible, it does have a few hurtles to jump. 2 of the major hurdles include assembly registration and gadget uninstallation. Let me explain:&lt;/P&gt;
&lt;P&gt;First off, let me explain the typical setup of a gadget. Skip this paragraph if you already know. A gadget consists of a main HTML page with corresponding image and javascript supporting files. Each gadget also can optionally use a separate HTML file for settings. Each HTML file can utilize the gadget API provided by Sidebar. All the files and the gadget information itself is described using an XML file. This file contains information such as the gadget name, author, support URL, main gadget HTML filename, etc... Now, if you want to use a .NET UserControl, you have to register it as a COM server and embed it using the IE AcitveX object embedding mechanism. Easier done than said. OK, with that out of the way, let's continue.&lt;/P&gt;
&lt;P&gt;The ideal situation is to have a user download your gadget from &lt;A href="http://gallery.live.com/" mce_href="http://gallery.live.com"&gt;http://gallery.live.com&lt;/A&gt; and have the gadget install for you (Sidebar uses the .gadget file extension for this purpose). However, since you're not following a traditional installation path, you don't have the ability to register your assembly for COM so that it can be embedded within the HTML file your gadget uses. The current workaround is to create a Windows Shell Scripting object and manually add the registry entries each time your gadget is loaded. I won't display the code here because frankly it's somewhat ugly and susceptible with error. To further compound the problem, you have to create the registry entries in either HKCU or HKLM depending on whether the user is an administrator or not. Well, if you manage to do that, you're good to go. Of course, next time you create another gadget, you'll have to do it all again (ok, just a cut-n-paste and GUID changes but....still a pain).&lt;/P&gt;
&lt;P&gt;The 2nd issue that occurs when trying to create a .NET based Sidebar gadget is gadget uninstallation. This is the main issue that I've seen people just can't seem to figure out (until now that is...be patient and read on. Don't skip to the end). Once your gadget is installed and running, a user should be able to open the Add Gadget window (click the + sign on top of Sidebar), right click on your gadget and select Uninstall. Sidebar then removes any instances from the Sidebar and attempts to delete the gadget files. Here's the problem (and I can't get too specific). Even though the gadget is removed from the Sidebar, the .NET assembly is still loaded within the Sidebar process. Sidebar therefore cannot remove the files and will display an error message. The 2 options you have are to restart the Sidebar or to wait a certain amount of time (I forget, but it's awhile...like 10 or 20 minutes). Not ideal for users is it.&lt;/P&gt;
&lt;P&gt;While some developers might just think it'll be ok to let the uninstallation failure slide, you should know that when you submit your gadget to &lt;A href="http://gallery.live.com/" mce_href="http://gallery.live.com"&gt;http://gallery.live.com&lt;/A&gt;, it will fail since it doesn't uninstall.&lt;/P&gt;
&lt;P&gt;So, what's a developer to do? I ran into this same problem with my ScreenSaver gadget. To that end, I now present the .NET Sidebar Gadget creator (link at bottom). This is an application that will make creating a .NET based Sidebar gadget extremely easy. Wouldn't it be nice if all you had to do was (after creating your .NET control of course) fill out a few form fields, click a button and be finished? It is now. The application itself should be fairly self-explanatory when you run it. The main sticky point is that you obviously need a .NET assembly containing a UserControl that will be the main UI of your gadget (if need be, I can post the source code for the BouncingBall gadget that is included as a sample for the application).&lt;/P&gt;
&lt;P&gt;Run the application, browse to your assembly, fill out the required information and click the Build button. The .NET Sidebar gadget creator will then reflect on the assembly and extract control information, generate HTML, JavaScript and the gadget XML files and place everything in the destination directory you specify. Here's a screenshot:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/Creating.NETSidebarGadgets.TheEasyWay_28E/image.png" mce_href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/Creating.NETSidebarGadgets.TheEasyWay_28E/image.png" atomicselection="true"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=480 alt=image src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/Creating.NETSidebarGadgets.TheEasyWay_28E/image_thumb.png" width=330 border=0 mce_src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/Creating.NETSidebarGadgets.TheEasyWay_28E/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Download the application, try it out and let me know if it works/doesn't work for you.&lt;/P&gt;
&lt;P&gt;Here's the link: &lt;A href="http://www.schmidt6.com/blogfiles/NetSBHostCreator.exe" mce_href="http://www.schmidt6.com/blogfiles/NetSBHostCreator.exe"&gt;NetSBHostCreator.exe&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;UPDATE: There is a problem with UAC. I think I have a working solution but I need to test a little more to make sure everything works fine. I'll post an updated solution soon followed closely by source code.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3908804" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>Fourth of July Vista Sidebar</title><link>http://blogs.msdn.com/markhsch/archive/2007/07/03/fourth-of-july-vista-sidebar.aspx</link><pubDate>Wed, 04 Jul 2007 00:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3676704</guid><dc:creator>markhsch</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/3676704.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=3676704</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=3676704</wfw:comment><description>&lt;P&gt;I found a screensaver that plays nicely with my Vista ScreenSaver Sidebar gadget. Just in time for the 4th of July!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;First, go get the ScreenSaver gadget and install it to your sidebar: &lt;A href="http://gallery.live.com/liveItemDetail.aspx?li=e321409b-231a-4da0-905c-0580c732223e&amp;amp;bt=1&amp;amp;pl=1"&gt;http://gallery.live.com/liveItemDetail.aspx?li=e321409b-231a-4da0-905c-0580c732223e&amp;amp;bt=1&amp;amp;pl=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Next, go grab the SkyRocket ScreenSaver and install it to your C:\Windows\System32 directory: &lt;A href="http://www.fileplanet.com/164987/160000/fileinfo/Skyrocket-Screensaver-%5BFREEWARE%5D"&gt;http://www.fileplanet.com/164987/160000/fileinfo/Skyrocket-Screensaver-%5BFREEWARE%5D&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Open the configuration options for the Sidebar gadget and select SkyRocket. Here's a screenshot for ya:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/photos/markhsch/images/3676655/original.aspx" target=_blank&gt;&lt;IMG src="http://blogs.msdn.com/photos/markhsch/images/3676655/original.aspx" border=0&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3676704" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>.NET based Sidebar gadget problem solved!</title><link>http://blogs.msdn.com/markhsch/archive/2007/06/26/activex-based-sidebar-gadget-problem-solved.aspx</link><pubDate>Tue, 26 Jun 2007 19:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3548444</guid><dc:creator>markhsch</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/3548444.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=3548444</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=3548444</wfw:comment><description>&lt;P&gt;Ok, I just ran a test with some new code that creates an .NETbased sidebar gadget and I was able to get&amp;nbsp;the&amp;nbsp;dll&amp;nbsp;unloaded from the sidebar process so it can uninstall successfully! This is good news for all the people that can't seem to get around this issue (and there's a few of you). I'll get going on a solution and post the results here. If you want to be emailed when its ready, just ping me and I'll add you to a list.&lt;/P&gt;
&lt;P&gt;Want a hint as to how I solved it? Take a look at this post's tags :-)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3548444" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/C_2F00_C_2B002B00_/default.aspx">C/C++</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>ScreenSaver Gadger hits 20000 downloads</title><link>http://blogs.msdn.com/markhsch/archive/2007/06/25/screensaver-gadger-hits-20000-downloads.aspx</link><pubDate>Tue, 26 Jun 2007 08:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3537057</guid><dc:creator>markhsch</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/3537057.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=3537057</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=3537057</wfw:comment><description>&lt;P&gt;It's a milestone. My ScreenSaver Vista Sidebar gadget has hit 20000 downloads. Some people have commented that it would be nice to double click it and have it launch the screensaver. The good news is, I have a version that does exactly that (can even lock your workstation should you choose). The bad news...I can't update the gallery with a new build. Why? I'll tell you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The gadget uses C# and therefore utilizes COM interop. However, I can't find a way to unload the dll when a user right clicks in the "Add Gadget" window and selects "Uninstall". Triden is keeping hold of my dll even though it isn't visible anymore. If anyone has some hints to force an unload, or to capture the uninstall event so I can at least inform the user or restart sidebar, I'd love to hear it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;For now you can grab the 1.0 version at:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://gallery.live.com/liveItemDetail.aspx?li=e321409b-231a-4da0-905c-0580c732223e&amp;amp;bt=1&amp;amp;pl=1"&gt;http://gallery.live.com/liveItemDetail.aspx?li=e321409b-231a-4da0-905c-0580c732223e&amp;amp;bt=1&amp;amp;pl=1&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3537057" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>My Screen Saver Vista Sidebar Gadget</title><link>http://blogs.msdn.com/markhsch/archive/2007/02/28/my-screen-saver-vista-sidebar-gadget.aspx</link><pubDate>Wed, 28 Feb 2007 22:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1775276</guid><dc:creator>markhsch</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/1775276.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=1775276</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=1775276</wfw:comment><description>&lt;p&gt;&amp;nbsp;For some reason, I'm drawn to creating things that are just cool while not altogether useful (see my Animated Activity Designer post, though one could argue that it may in fact be useful). To that end, I decided to create a Vista Sidebar gadget that displays a screen saver of your choosing. Vista has some good screen savers that it shipped with and I've embedded screen savers before (in fact, I show how to do it in one of my books).&lt;/p&gt; &lt;p&gt;So go ahead and grab it from the Windows Live Gallery (link below). If enough people clamor and beg, I will post the source code. Here's a quick rundown of what I did:&lt;/p&gt; &lt;p&gt;1. Create a .NET User Control&lt;br&gt;2. Embed a screen saver in the user control whenever the ScreenSaverPath property is set (and the control is visible)&lt;br&gt;3. Create the HTML page for the sidebar (sidebar controls use Javascript and HTML in case you didn't know already)&lt;br&gt;4. Embed the UserControl in the HTML page (using COM interop naturally)&lt;br&gt;5. Create a settings page that also uses COM Interop. The settings page calls a .NET component that I wrote that simply returns a collection of screen saver paths on the local system.&lt;br&gt;6. Create the installation in Javascript. I had to get some help for this one. Basically, I do what regasm does by using the WSHShell object to set registry entries. I found some code on the Internet to help.&lt;/p&gt; &lt;p&gt;Here's a screenshot of it in action using the Ribbons screensaver:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/MyScreenSaverVistaSidebarGadget_9F6F/ssavergadget%5B1%5D.jpg" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://blogs.msdn.com/blogfiles/markhsch/WindowsLiveWriter/MyScreenSaverVistaSidebarGadget_9F6F/ssavergadget.jpg" width="215" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Here's the link:&lt;/p&gt; &lt;p&gt;&lt;a href="http://gallery.live.com/liveItemDetail.aspx?li=e321409b-231a-4da0-905c-0580c732223e&amp;amp;l=1"&gt;Screen Saver Vista Sidebar Gadget&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1775276" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>Stop Motion Animation using Windows Movie Maker</title><link>http://blogs.msdn.com/markhsch/archive/2007/01/26/stop-motion-animation-using-windows-movie-maker.aspx</link><pubDate>Fri, 26 Jan 2007 20:59:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1537575</guid><dc:creator>markhsch</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/1537575.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=1537575</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=1537575</wfw:comment><description>&lt;p&gt;So I got bored a few nights ago and decided to see if I can do&amp;nbsp;some stop motion animation using my wife's Nikon D70 and Windows Movie Maker. After I imported all the pictures I took of my kids (somewhere around 100)&amp;nbsp;into Windows Movie Maker, I went into options and changed the default time to display pictures&amp;nbsp;in the movie when I drag and drop them. The default is 5 seconds and I changed it to 0.25 seconds. I then did a CTRL-A to select all my pictures and dropped them all on the timeline. I then added a beginning title, transition and end credits. It was topped off with a little music. The whole movie making process took around 5 minutes. So without further ado, here's the link:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=HH6cHkQlOsQ"&gt;The Amazing Crazy Race&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1537575" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item><item><title>WPF Post-it Board source updated</title><link>http://blogs.msdn.com/markhsch/archive/2006/10/05/WPF-Post_2D00_it-Board-source-updated.aspx</link><pubDate>Fri, 06 Oct 2006 00:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:794659</guid><dc:creator>markhsch</dc:creator><slash:comments>139</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/794659.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=794659</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=794659</wfw:comment><description>&lt;P&gt;Ok, first off let me say that I really really don't try to just create a blog entry that simply links to someone elses blog entry. Most of what I blog about comes straight out of my head and usually involves the use of an IDE and source code. However, the &lt;A href="http://xamlxaml.com/2006/10/05/postitboard-update-for-net-30-rc1/" target=_blank mce_href="http://xamlxaml.com/2006/10/05/postitboard-update-for-net-30-rc1/"&gt;PostIt Board&lt;/A&gt; project created by &lt;A href="http://xamlxaml.com/about/" mce_href="http://xamlxaml.com/about/"&gt;Michael G. Emmons&lt;/A&gt; is just too cool to not say anything.&lt;/P&gt;
&lt;P&gt;Written using WPF, it interfaces with Flickr and allows you to do a search and display the results as small thumbnails on a post it board interface (see picture below). The source is included. Here are some things I had to do to get it to run and to make the canvas movable.&lt;/P&gt;
&lt;P&gt;1. Open the solution and delete the FlickrFX.snk.pfx file from the FlickrFX project (note that when you open the project it will ask for a password to open that file. Simply hit cancel and then go and delete it).&lt;/P&gt;
&lt;P&gt;2. The code to move the window is commented out. When I uncomment it I can move the window but clicking on a picture causes the picture to move off screen. Here's the code to fix this so you can move the window as well as move any image.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;override&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;void&lt;/SPAN&gt; OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
    IInputElement iie &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: courier new"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;this&lt;/SPAN&gt;.InputHitTest(e.GetPosition(&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;this&lt;/SPAN&gt;));
    &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;if&lt;/SPAN&gt; (iie is System.Windows.Controls.Canvas)
    {
        &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;base&lt;/SPAN&gt;.OnMouseLeftButtonDown(e);
        &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: courier new"&gt;this&lt;/SPAN&gt;.DragMove();
    }
} &lt;/PRE&gt;
&lt;P&gt;&lt;IMG height=297 src="http://blogs.msdn.com/photos/markhsch/images/794655/640x457.aspx" width=454 mce_src="http://blogs.msdn.com/photos/markhsch/images/794655/640x457.aspx"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=794659" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Avalon/default.aspx">Avalon</category></item><item><title>Windows workflow foundation animated activity designer source</title><link>http://blogs.msdn.com/markhsch/archive/2006/09/22/Windows-workflow-foundation-animated-activity-designer-source.aspx</link><pubDate>Fri, 22 Sep 2006 23:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:766886</guid><dc:creator>markhsch</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/markhsch/comments/766886.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markhsch/commentrss.aspx?PostID=766886</wfw:commentRss><wfw:comment>http://blogs.msdn.com/markhsch/rsscomments.aspx?PostID=766886</wfw:comment><description>&lt;P&gt;As I mentioned in my last post, I have uploaded the Animated Activity Designer for use in your own project. A common question I can anticipate being asked is "Why?". So, here's why I created it and my reason as to why you may want to use something like this.&lt;/P&gt;
&lt;P&gt;First off, the reason I wanted to try to created animated activities within the Windows Workflow designer was merely to see if it was possible. I knew that I could override OnPaint so I pretty much already knew it was going to be possible (otherwise I probably wouldn't have gone down the path). The second reason is simply because as a guy that loves cool eye candy in UI's, I just had to do it.&lt;/P&gt;
&lt;P&gt;So why would you ever want to create an animated activity? Let's say you create an application that hosts the Windows Workflow Designer. Let's also assume that this application is used by your customers. You present them with the designer surface and within a Toolbox like panel, you have your set of custom activities they can use.&amp;nbsp;If pictures are worth a thousand words, then an animation with 10 frames is worth 10,000&amp;nbsp;words.&lt;/P&gt;
&lt;P&gt;The actual code for this is really simple which is also why it only took a couple of hours to get it up and running. Since it is so easy, I won't waste your time explaining it (but feel free to ping me if you have any questions).&lt;/P&gt;
&lt;P&gt;Download the code right here: &lt;A href="http://www.schmidt6.com/blogfiles/WF/AnimatedActivityDesigner.zip" target=_blank mce_href="http://www.schmidt6.com/blogfiles/WF/AnimatedActivityDesigner.zip"&gt;AnimatedActivityDesigner.zip&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To see it in action, open the solution in Visual Studio, build it and then open&amp;nbsp;workflow1.cs in the designer.&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;To see the video better, right click and select Zoom -&amp;gt; Full Screen&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;
&lt;OBJECT id=VIDEO style="LEFT: 0px; POSITION: relative; TOP: 0px" type=application/x-oleobject height=240 width=320 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6&gt;&lt;PARAM NAME="URL" VALUE="http://www.schmidt6.com/blogfiles/WF/AAD.wmv"&gt;&lt;PARAM NAME="rate" VALUE="1"&gt;&lt;PARAM NAME="balance" VALUE="0"&gt;&lt;PARAM NAME="currentPosition" VALUE="4.956"&gt;&lt;PARAM NAME="defaultFrame" VALUE=""&gt;&lt;PARAM NAME="playCount" VALUE="9999"&gt;&lt;PARAM NAME="autoStart" VALUE="-1"&gt;&lt;PARAM NAME="currentMarker" VALUE="0"&gt;&lt;PARAM NAME="invokeURLs" VALUE="-1"&gt;&lt;PARAM NAME="baseURL" VALUE=""&gt;&lt;PARAM NAME="volume" VALUE="50"&gt;&lt;PARAM NAME="mute" VALUE="0"&gt;&lt;PARAM NAME="uiMode" VALUE="none"&gt;&lt;PARAM NAME="stretchToFit" VALUE="-1"&gt;&lt;PARAM NAME="windowlessVideo" VALUE="0"&gt;&lt;PARAM NAME="enabled" VALUE="-1"&gt;&lt;PARAM NAME="enableContextMenu" VALUE="-1"&gt;&lt;PARAM NAME="fullScreen" VALUE="0"&gt;&lt;PARAM NAME="SAMIStyle" VALUE=""&gt;&lt;PARAM NAME="SAMILang" VALUE=""&gt;&lt;PARAM NAME="SAMIFilename" VALUE=""&gt;&lt;PARAM NAME="captioningID" VALUE=""&gt;&lt;PARAM NAME="enableErrorDialogs" VALUE="0"&gt;&lt;PARAM NAME="_cx" VALUE="8467"&gt;&lt;PARAM NAME="_cy" VALUE="6350"&gt;&lt;/OBJECT&gt;&lt;/P&gt;
&lt;P&gt;P.S. The activities you see in the project and in the video are simply placeholders. They do not actually do anything.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=766886" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markhsch/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Windows+Workflow+Foundation/default.aspx">Windows Workflow Foundation</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/markhsch/archive/tags/Cool+Stuff/default.aspx">Cool Stuff</category></item></channel></rss>