<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gaurav &#187; windows</title>
	<atom:link href="http://allyourcodearebelongto.me/blog/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://allyourcodearebelongto.me/blog</link>
	<description>All About Everything</description>
	<lastBuildDate>Sun, 23 Nov 2008 19:44:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>10 of my favorite softwares</title>
		<link>http://allyourcodearebelongto.me/blog/2007/10/09/10-of-my-favorite-softwares/</link>
		<comments>http://allyourcodearebelongto.me/blog/2007/10/09/10-of-my-favorite-softwares/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 17:05:50 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://techblogging.wordpress.com/2007/10/09/10-of-my-favorite-softwares/</guid>
		<description><![CDATA[I like to explore softwares. I usually install a lot of softwares on my system. I thought that I should make a list of my favorite softwares and share it with everybody. All of there softwares are either open-source or free.
1. Autohotkey(FOSS): It manages your hotkeys globally and allows you to create complex actions based [...]]]></description>
			<content:encoded><![CDATA[<p>I like to explore softwares. I usually install a lot of softwares on my system. I thought that I should make a list of my favorite softwares and share it with everybody. All of there softwares are either open-source or free.</p>
<p>1. <a href="http://www.autohotkey.com/" target="_blank">Autohotkey</a>(FOSS): It manages your hotkeys globally and allows you to create complex actions based on the keys pressed. Its actually got its own scripting language which is rather easy to learn. Just write a script in a file with extension <em>.ahk </em>and double click the file to execute it.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image1.png"><img style="border-width:0;" height="295" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb1.png" width="504" border="0"></a></p>
<p>With AutoHotKey you can:</p>
<ul>
<li>manage processes, windows and control both keyboard and mouse.
<li>create macros saving you precious keystrokes.
<li>re-map keys and buttons on your keyboard and mouse. </li>
</ul>
<p>I have been using AutoHotKey for quite a while now and I use it to manage my code snippets, have consistent hotkeys across applications and creating macros like googling the selected text in any application. The following is the AutoHotKey script for it:</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> #g::</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> Send ^c</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> Run http://www.google.co.<span style="color:#0000ff;">in</span>/search?hl=en&amp;q=%clipboard%</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> return</pre>
</div>
</div>
<p>So by using this script whenever I press Ctrl+G the script will open a browser and search the selected text in google. Nice isn&#8217;t it?</p>
<p><span id="more-10"></span></p>
<p>2. <a href="http://www.ccleaner.com/" target="_blank">CCleaner</a>(FREE): CCleaner is a simple system cleanup tool that removes temporary files, empty folders, redundant registries and application log files. It recognizes a lot of softwares on the system and removes their temporary and log files too. Its really simple to use, just right click on the recycle bin and select <em>Run CCleaner. </em>Some advanced options are revealed when the application is run from the start menu. Usually it just takes few seconds to clean up the system and makes the system speedier by removing useless stuff.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image2.png"><img style="border-width:0;" height="358" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb2.png" width="504" border="0"></a></p>
<p>3. <a href="http://sourceforge.net/projects/console/" target="_blank">Console2</a>(FOSS): Console is a Windows console window enhancement. Currently in beta but still packs a punch.</p>
<p>Features include:</p>
<ul>
<li>Tabbed interface
<li>Customizable background
<li>Custom tabs </li>
</ul>
<p>Each tab open a different process. I normally have tabs for powershell, ruby and irb. Each of there tabs are bound to a different hotkey.</p>
<p>I think Microsoft should include Console2 with default once it comes out of beta because normal console just sucks.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image3.png"><img style="border-width:0;" height="348" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb3.png" width="504" border="0"></a></p>
<p>4. <a href="http://www.foxitsoftware.com/pdf/rd_intro.php" target="_blank">Foxit PDF Reader</a>(FREE): Foxit is one PDF reader that is actually fast. Opens up just as fast as notepad and I am yet to come across a pdf that it doesn&#8217;t render correctly. Its got a real small install size (~1.5 MB) and the whole application is contained inside a single exe, so no messing around with the system. Its got the same feature set as Adobe reader although searching seems a bit better in Adobe reader, but speed matters to me the most.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image4.png"><img style="border-width:0;" height="352" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb4.png" width="504" border="0"></a></p>
<p>5. <a href="http://www.flashget.com/en/download.htm" target="_blank">FlashGet</a>(FREE): Flashget is a download manager that has only recently become free. It makes multiple connections to the server download the same file thus speeding up the download. Its interface is simple to use and the download options are really easy to configure. It also supports other protocols like Bit-Torrent and e-Mule.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/capture.jpg"><img style="border-width:0;" height="304" alt="Capture" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/capture-thumb.jpg" width="504" border="0"></a></p>
<p>6. <a href="http://www.imgburn.com/" target="_blank">ImgBurn</a>(Free): Image Burn software is used for burning CDs and DVDs. It can also be used to creating ISOs from CDs and DVDs. The best part about is software it is really easy to use, lightweight ~1.5 MB and of course FREE.</p>
<p>Unlike the most famous software (~ 1 GB size) in this category ImgBurn doesn&#8217;t bring your system to a drag when using it and also doesn&#8217;t mess around with your settings.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image5.png"><img style="border-width:0;" height="339" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb5.png" width="504" border="0"></a></p>
<p>7. <a href="http://sourceforge.net/projects/guliverkli/" target="_blank">Media Player Classic</a>(FOSS): MPC is a compact media player that mimics the look and feel of Window Media Player 6.4. I don&#8217;t install it as a standalone software but as a part of <a href="http://www.k-litecodecpack.com/" target="_blank">K-lite codec pack</a> which allows me to play encoded video files. Its got a really simple look and feel but has a fast interface and nice default hotkeys. One of its features that I like is ability to change the aspect ratio of the video to anything.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image6.png"><img style="border-width:0;" height="352" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb6.png" width="504" border="0"></a></p>
<p>8. <a href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx" target="_blank">Microsoft Virtual PC</a>(FREE): It is a virtualization suite from Microsoft which is optimized for windows based systems. Although other virtualization softwares are available that run Linux much better as a guest OS but Microsoft Virtual PC is better if you want to run a windows OS as the guest. Virtualized OS runs almost as fast as natively and its great for testing softwares that only run in older versions of windows like IE6. I usually need to run IE6 to test web-pages and a virtual machine is the only way possible to run IE6 alongside IE7.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/capture1.jpg"><img style="border-width:0;" height="369" alt="Capture" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/capture-thumb1.jpg" width="504" border="0"></a></p>
<p>9. <a href="http://msdn2.microsoft.com/hi-in/express/default.aspx" target="_blank">Microsoft Visual studio express editions</a>(Free): Primarily I am a Ruby on Rails developer but I also love to program in C#. Microsoft has a free edition of Visual Studio for hobbyists like me. Its a bit limited in features as compared to Visual Studio. You can only program only in one language at a time, but that is good enough for me. Its fast, feature rich and Free, what more can I want :)</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image7.png"><img style="border-width:0;" height="379" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb7.png" width="504" border="0"></a></p>
<p>10. <a href="http://www.getpaint.net/" target="_blank">Paint.NET</a>(FOSS): An easy to use image editing software. This is one of the most famous open source software for windows. It is meant to be a free alternate to MS-Paint that comes bundled with windows but it has a feature set that rivals to other expensive image editing softwares.</p>
<p>Paint.NET has a really small installation size, runs fast, supports for layers and supports a wide variety of image formats.</p>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image8.png"><img style="border-width:0;" height="385" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb8.png" width="504" border="0"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://allyourcodearebelongto.me/blog/2007/10/09/10-of-my-favorite-softwares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a User Interface in Ruby using WPF</title>
		<link>http://allyourcodearebelongto.me/blog/2007/10/09/creating-a-user-interface-in-ruby-using-wpf/</link>
		<comments>http://allyourcodearebelongto.me/blog/2007/10/09/creating-a-user-interface-in-ruby-using-wpf/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 11:41:23 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[win32ole]]></category>

		<guid isPermaLink="false">http://techblogging.wordpress.com/2007/10/09/creating-a-user-interface-in-ruby-using-wpf/</guid>
		<description><![CDATA[Let me first explain what is WPF?
WPF is the graphical subsystem if the .NET 3.0 framework and it is there to take the place of window forms which we used with earlier versions of .NET
So what&#8217;s so great about WPF?
Actually WPF is has its roots in DirectX API so you can easily create 2D and [...]]]></description>
			<content:encoded><![CDATA[<p>Let me first explain what is WPF?</p>
<p>WPF is the graphical subsystem if the .NET 3.0 framework and it is there to take the place of window forms which we used with earlier versions of .NET</p>
<h5>So what&#8217;s so great about WPF?</h5>
<p>Actually WPF is has its roots in DirectX API so you can easily create 2D and 3D interfaces in it without putting ant load on the processor. Also it is vector based and stores the information for the generating the UI in separate XAML files. So we have logical separation of a control from its appearance.</p>
<p>Further details: <a title="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation" href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation" target="_blank">http://en.wikipedia.org/wiki/Windows_Presentation_Foundation</a></p>
<p>The following are the requirements for running this example:</p>
<ul>
<li>rubyclr gem. Use <strong>gem install rubyclr -y</strong>
<li>.NET framework 3.0 </li>
</ul>
<p>In this example I will creating a creating a textarea along with a button, trapping the events on the button and logging it inside the textarea .</p>
<p>Here is the code for the xaml file. Store this file with filename ui.xaml. This file contains the UI for the application.</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Window</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> <span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="LayoutRoot"</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Button</span> <span style="color:#ff0000;">Margin</span><span style="color:#0000ff;">="8,0,8,5.723"</span> <span style="color:#ff0000;">VerticalAlignment</span><span style="color:#0000ff;">="Bottom"</span> <span style="color:#ff0000;">Content</span><span style="color:#0000ff;">="Button"</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">="the_button"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Margin</span><span style="color:#0000ff;">="8,8,8,38"</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">="the_text_box"</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Window</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
</div>
<div>&nbsp;</div>
<p>Next I will be creating the codebehind file in ruby. Here in this file we have all the application logic. Save this file as logic.rb.</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> # load the libraries</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> require <span style="color:#008000;">'rubygems'</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> require <span style="color:#008000;">'wpf'</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> # load the xaml file</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> window = XamlReader.Load(System::IO::File.open_read(<span style="color:#008000;">'ui.xaml'))</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span> # <span style="color:#0000ff;">get</span> the controls</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span> button = window.find_name(<span style="color:#008000;">'the_button')</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span> txt_box = window.find_name(<span style="color:#008000;">'the_text_box')</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span> # trap the mouse enter <span style="color:#0000ff;">event</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span> button.mouse_enter <span style="color:#0000ff;">do</span> |sender, args|</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span> txt_box.text += <span style="color:#006080;">"MOUSE ENTERED\n"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span> <span style="color:#0000ff;">end</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span> # trap the mouse leave <span style="color:#0000ff;">event</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span> button.mouse_leave <span style="color:#0000ff;">do</span> |sender, args|</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span> txt_box.text += <span style="color:#006080;">"MOUSE LEFT\n"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span> <span style="color:#0000ff;">end</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span> # trap the mouse click <span style="color:#0000ff;">event</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span> button.click <span style="color:#0000ff;">do</span> |sender, args|</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span> txt_box.text += <span style="color:#006080;">"MOUSE CLICKED\n"</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span> <span style="color:#0000ff;">end</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span> # run the application (most important)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span> Application.<span style="color:#0000ff;">new</span>.run(window)</pre>
</div>
</div>
<p>The code given above explains itself.</p>
<p>We are first loading the ui.xaml file and then finding the two controls in the lines 8, 9.</p>
<p>Then the three event handlers are declared in lines 11, 14, 19. So whenever the mouse events are fired the corresponding event if traced into the textbox.</p>
<h2>And here is the output.</h2>
<p><a href="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image.png"><img style="border-width:0;" height="349" alt="image" src="http://allyourcodearebelongto.me/blog/wp-content/uploads/2007/10/image-thumb.png" width="540" border="0"></a></p>
<div class="wlWriterSmartContent" id="38ca0925-19ba-445d-831b-fb8a30569fe5" style="display:inline;float:none;margin:0;padding:0;">del.icio.us Tags: <a href="http://del.icio.us/popular/ruby" rel="tag">ruby</a>,<a href="http://del.icio.us/popular/user%20interface" rel="tag">user interface</a>,<a href="http://del.icio.us/popular/windows" rel="tag">windows</a>,<a href="http://del.icio.us/popular/wpf" rel="tag">wpf</a>,<a href="http://del.icio.us/popular/xaml" rel="tag">xaml</a></div>
]]></content:encoded>
			<wfw:commentRss>http://allyourcodearebelongto.me/blog/2007/10/09/creating-a-user-interface-in-ruby-using-wpf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automating Powerpoint with ruby</title>
		<link>http://allyourcodearebelongto.me/blog/2007/10/09/automating-powerpoint-with-ruby/</link>
		<comments>http://allyourcodearebelongto.me/blog/2007/10/09/automating-powerpoint-with-ruby/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 10:50:27 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[win32ole]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[automation]]></category>

		<guid isPermaLink="false">http://techblogging.wordpress.com/2007/10/09/automating-powerpoint-with-ruby/</guid>
		<description><![CDATA[We know that ruby is a language of few words. We can express a lot of things in a relatively easy manner.
I was trying to export few slides in my powerpoint presentation to an image format using ruby.I could not find any documentation for it anywhere except for a few basic things. But when I [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">We know that ruby is a language of few words. We can express a lot of things in a relatively easy manner.</p>
<p align="justify">I was trying to export few slides in my powerpoint presentation to an image format using ruby.I could not find any documentation for it anywhere except for a few basic things. But when I tried it by hit and trial I found out it to be surprisingly easy. It required just a few lines.</p>
<p>Here is what you have to do:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> require ‘win32ole’</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> # open powerpoint</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> ppt = WIN32OLE.<span style="color:#0000ff;">new</span>(‘Powerpoint.Application’)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> # make sure it <span style="color:#0000ff;">is</span> visible</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> ppt.Visible = <span style="color:#0000ff;">true</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span> # open the presentation <span style="color:#0000ff;">to</span> be exported</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span> pre = ppt.Presentations.Open(“d:\\imp_file.pptx”)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span> # export the file</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span> pre.Slides(1).Export(“d:\\exp_file.png”,“png”)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span> # close powerpoint, will close all the currently open files</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span> ppt.Quit()</pre>
</div>
</div>
<p>You can always use RMagick to further process this image.</p>
<p>The <tt>Win32OLE</tt> extension library (actually spelled in lowercase, <tt>win32ole</tt>) provides an interface to Windows OLE automation. Your Ruby code can act as a client for any OLE automation server such as Microsoft Word, Outlook, and Internet Explorer and many other softwares.</p>
<p>So in the above code we are making a object is Powerpoint application, then opening a file and saving the first slide in the &#8220;png&#8221; format.</p>
]]></content:encoded>
			<wfw:commentRss>http://allyourcodearebelongto.me/blog/2007/10/09/automating-powerpoint-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

