<?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 : animation</title><link>http://blogs.msdn.com/markhsch/archive/tags/animation/default.aspx</link><description>Tags: animation</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><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>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>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>