<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Technical Journal</title>
	<atom:link href="http://andocs.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andocs.wordpress.com</link>
	<description>Programming, software technologies, operating systems, IT</description>
	<lastBuildDate>Sat, 21 Nov 2009 08:42:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='andocs.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ba386d6a3cbddefc366eb77ffe4f6861?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Technical Journal</title>
		<link>http://andocs.wordpress.com</link>
	</image>
			<item>
		<title>Unit Testing</title>
		<link>http://andocs.wordpress.com/2009/05/12/unit-testing/</link>
		<comments>http://andocs.wordpress.com/2009/05/12/unit-testing/#comments</comments>
		<pubDate>Tue, 12 May 2009 16:29:49 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=61</guid>
		<description><![CDATA[Software testing is a very important stage of software development; the better the software product is tested the higher the quality of your work gets.
This post is just opening a series of small entries in which I will try to get the best out of software testing techniques and make use of them in
further development [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=61&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Software testing is a very important stage of software development; the better the software product is tested the higher the quality of your work gets.<br />
This post is just opening a series of small entries in which I will try to get the best out of software testing techniques and make use of them in<br />
further development processes.<br />
I&#8217;ve started browsing the web and reading books. Up until now, I&#8217;ve found a nice book on unit testing (<code><a href="http://www.amazon.com/gp/product/0131495054?ie=UTF8&amp;tag=technjourn-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0131495054">xUnit Test Patterns: Refactoring Test Code (Addison-Wesley Signature Series)</a><img src="http://www.assoc-amazon.com/e/ir?t=technjourn-20&amp;l=as2&amp;o=1&amp;a=0131495054" width="1" height="1" border="0" alt="" style="border:none!important;margin:0!important;" /></code>  ), which sheds some light on the topic. I plan on using NUnit to perform my unit testing, which is fairly easy to use and it&#8217;s free.<br />
Of course, unit testing is not all there is to software testing, but this is where I&#8217;ll start. More on this to follow.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=61&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2009/05/12/unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=technjourn-20&#38;l=as2&#38;o=1&#38;a=0131495054" medium="image" />
	</item>
		<item>
		<title>Enum to List</title>
		<link>http://andocs.wordpress.com/2009/04/24/enum-to-list/</link>
		<comments>http://andocs.wordpress.com/2009/04/24/enum-to-list/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 09:23:40 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Windows CE]]></category>
		<category><![CDATA[C# enum to list]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[generic list]]></category>
		<category><![CDATA[System.Reflection]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=49</guid>
		<description><![CDATA[I&#8217;ve found this method useful lately so I thought I should add it here where everyone can see it.
It is meant to be used with the .NET Compact Framework. In the full framework this would have been much easier -
without reflection.
What the method does is that it adds the enum&#8217;s fields to a generic list [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=49&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve found this method useful lately so I thought I should add it here where everyone can see it.<br />
It is meant to be used with the .NET Compact Framework. In the full framework this would have been much easier -<br />
without reflection.<br />
What the method does is that it adds the enum&#8217;s fields to a generic list of the same type T as the enum.</p>
<p>		public static List EnumToList( )<br />
		{<br />
			Type enumType = typeof( T );</p>
<p>			if( enumType.BaseType != typeof( Enum ) )<br />
			{<br />
				throw new ArgumentException( &#8220;Not an enum type!&#8221; );<br />
			}</p>
<p>			List enumFieldList = new List( );</p>
<p>			FieldInfo[ ] enumFields = typeof( T ).GetFields( );</p>
<p>			foreach( FieldInfo fieldInfo in enumFields )<br />
			{<br />
				if( !fieldInfo.IsSpecialName )<br />
				{<br />
					enumFieldList.Add( (T) Enum.Parse( enumType, fieldInfo.Name, false ) );<br />
				}<br />
			}</p>
<p>			return enumFieldList;<br />
		}</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=49&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2009/04/24/enum-to-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>Zeitgeist</title>
		<link>http://andocs.wordpress.com/2009/04/12/zeitgeist/</link>
		<comments>http://andocs.wordpress.com/2009/04/12/zeitgeist/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 11:08:24 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Zeitgeist]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=42</guid>
		<description><![CDATA[This movie contains some thinghs that I&#8217;ve already aknowledged during time and others I just found out. I think we should see all sides of our social existence and not just the one we are being served. I am not saying that everything here is the truth, but it certainly looks like the truth. The zeitgeist [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=42&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This movie contains some thinghs that I&#8217;ve already aknowledged during time and others I just found out. I think we should see all sides of our social existence and not just the one we are being served. I am not saying that everything here is the truth, but it certainly looks like the truth. The <a href="http://en.wikipedia.org/wiki/Zeitgeist">zeitgeist</a> does not look like a heaven for the ordinary people. </p>
<p><a href="http://video.google.com/videoplay?docid=-594683847743189197">http://video.google.com/videoplay?docid=-594683847743189197</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=42&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2009/04/12/zeitgeist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows CE Full Screen applications</title>
		<link>http://andocs.wordpress.com/2009/04/12/windows-ce-full-screen-applications/</link>
		<comments>http://andocs.wordpress.com/2009/04/12/windows-ce-full-screen-applications/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 07:04:29 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Windows CE]]></category>
		<category><![CDATA[.NET CF]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[FindWindowW]]></category>
		<category><![CDATA[Full Screen]]></category>
		<category><![CDATA[interop]]></category>
		<category><![CDATA[ShowWindow]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=30</guid>
		<description><![CDATA[The first task I had to do when I started developing my first Windows CE application was to make my main program window appear in full screen mode. After some research I came across a small article posted on Code Project. It describes a method of showing a window in full screen mode using standard [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=30&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-indent:.5in;margin:0;"><span style="font-size:small;font-family:Times New Roman;">The first task I had to do when I started developing my first Windows CE application was to make my main program window appear in full screen mode. After some research I came across a small </span><a href="http://www.codeproject.com/KB/mobile/Windows_CE_Fullscreen.aspx"><span style="font-size:small;font-family:Times New Roman;">article</span></a><span style="font-size:small;font-family:Times New Roman;"> posted on Code Project. It describes a method of showing a window in full screen mode using standard window management calls which is what I was looking for. I completed the source with proper definitions of system calls and structures. I provide this source code along with a basic test application. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            The usual method of doing this would have been to use <strong>SHFullScreen</strong>, but I was not able to use this function as my OS Design was not to contain <strong><em>aygshell.dll</em></strong>, the library from which this function was part of. </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            I am developing under .NET Compact Framework 2.0. </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            First, I had to define some useful enums containing constants of the Windows API. Here are some of them, for the rest please see the attached project as this post would grow unreasonably if I pasted them here. </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      [<span style="color:#2b91af;">Flags</span>( )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      <span style="color:blue;">internal</span> <span style="color:blue;">enum</span> <span style="color:#2b91af;">FullScreenFlags</span> : <span style="color:blue;">int</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            SwHide = 0,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            ShowTaskbar = 0&#215;1,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HideTaskbar = 0&#215;2,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            ShowSipButton = 0&#215;4,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HideSipButton = 0&#215;8,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            SwRestore = 9,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            ShowStartIcon = 0&#215;10,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HideStartIcon = 0&#215;20</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      <span style="color:blue;">internal</span> <span style="color:blue;">enum</span> <span style="color:#2b91af;">Hwnd</span> : <span style="color:blue;">int</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HWND_TOP = 0,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HWND_BOTTOM = 1,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HWND_TOPMOST = -1,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            HWND_NOTOPMOST = -2</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            A very useful thing to do is to check </span></span><a href="http://www.pinvoke.net/"><span style="font-size:small;color:#0000ff;font-family:Times New Roman;">www.pinvoke.net</span></a><span style="font-size:small;font-family:Times New Roman;"> and retrieve the values of certain constants that you would make use of in various situations. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            Next, I had to implement a static class that imports my needed functions from <strong><em>coredll.dll</em></strong>. This dll is very useful to get acustomed with because in it you will find system calls that you are very likely to need in your development process under .NET CF. So, here is what you need:</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Coredll</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> The function retrieves the handle to the top-level </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> window whose class name and window name match </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> the specified strings. This function does not search child windows.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;lpClass&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;lpWindow&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;&lt;/returns&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:#2b91af;">IntPtr</span> FindWindowW( <span style="color:blue;">string</span> lpClass, <span style="color:blue;">string</span> lpWindow );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> ShowWindow( <span style="color:#2b91af;">IntPtr</span> hwnd, <span style="color:blue;">int</span> state );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SetWindowPos( <span style="color:#2b91af;">IntPtr</span> hwnd, <span style="color:#2b91af;">IntPtr</span> hwndAfter,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                                                                              <span style="color:blue;">int</span> xPos, <span style="color:blue;">int</span> yPos, <span style="color:blue;">int</span> cX, <span style="color:blue;">int</span> cY, <span style="color:blue;">int</span> wFlage );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">int</span> GetSystemMetrics( <span style="color:blue;">int</span> smIndex );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:blue;">return</span>: <span style="color:#2b91af;">MarshalAs</span>( <span style="color:#2b91af;">UnmanagedType</span>.Bool )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SystemParametersInfo( <span style="color:#2b91af;">Spi</span> uiAction, <span style="color:blue;">uint</span> uiParam, <span style="color:#2b91af;">IntPtr</span> pvParam, <span style="color:#2b91af;">Spif</span> fWinIni );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:blue;">return</span>: <span style="color:#2b91af;">MarshalAs</span>( <span style="color:#2b91af;">UnmanagedType</span>.Bool )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SystemParametersInfo( <span style="color:#2b91af;">Spi</span> uiAction, <span style="color:blue;">uint</span> uiParam, <span style="color:#2b91af;">String</span> pvParam, <span style="color:#2b91af;">Spif</span> fWinIni );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:blue;">return</span>: <span style="color:#2b91af;">MarshalAs</span>( <span style="color:#2b91af;">UnmanagedType</span>.Bool )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SystemParametersInfo( <span style="color:#2b91af;">Spi</span> uiAction, <span style="color:blue;">uint</span> uiParam, <span style="color:blue;">ref</span> <span style="color:#2b91af;">AnimationInfo</span> pvParam, <span style="color:#2b91af;">Spif</span> fWinIni );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, EntryPoint = <span style="color:#a31515;">"SystemParametersInfo"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SystemParametersInfoGet( <span style="color:blue;">uint</span> action, <span style="color:blue;">uint</span> param, <span style="color:blue;">ref</span> <span style="color:blue;">uint</span> vparam, <span style="color:blue;">uint</span> init );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"coredll.dll"</span>, EntryPoint = <span style="color:#a31515;">"SystemParametersInfo"</span>, SetLastError = <span style="color:blue;">true</span> )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">bool</span> SystemParametersInfoSet( <span style="color:blue;">uint</span> action, <span style="color:blue;">uint</span> param, <span style="color:blue;">uint</span> vparam, <span style="color:blue;">uint</span> init );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> to find whether you are running on a Smartphone or a Pocket PC</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;uiAction&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;uiParam&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;pvParam&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;fWinIni&#8221;&gt;&lt;/param&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;&lt;/returns&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            [<span style="color:#2b91af;">DllImport</span>( <span style="color:#a31515;">"Coredll.dll"</span>, EntryPoint = <span style="color:#a31515;">"SystemParametersInfoW"</span>, CharSet = <span style="color:#2b91af;">CharSet</span>.Unicode )]</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">int</span> SystemParametersInfo4Strings( <span style="color:blue;">uint</span> uiAction, <span style="color:blue;">uint</span> uiParam, System.Text.<span style="color:#2b91af;">StringBuilder</span> pvParam, <span style="color:blue;">uint</span> fWinIni );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">      }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">            </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            Now, to put things toghether here are the two methods needed to enter full screen mode and end it:</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">void</span> StartFullScreen( <span style="color:#2b91af;">Control</span> control )</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWndInputPanel = <span style="color:#2b91af;">Coredll</span>.FindWindowW( <span style="color:#a31515;">&#8220;SipWndClass&#8221;</span> , <span style="color:blue;">null</span> );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWndSipButton = <span style="color:#2b91af;">Coredll</span>.FindWindowW( <span style="color:#a31515;">&#8220;MS_SIPBUTTON&#8221;</span>, <span style="color:blue;">null</span> );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( hWndInputPanel != <span style="color:blue;">null</span> ) <span style="color:#2b91af;">Coredll</span>.ShowWindow( hWndInputPanel, SW_HIDE );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWndTaskBar = <span style="color:#2b91af;">Coredll</span>.FindWindowW( <span style="color:#a31515;">&#8220;HHTaskBar&#8221;</span>, <span style="color:blue;">null</span> );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWnd = control.Handle;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( hWndTaskBar != <span style="color:blue;">null</span> ) <span style="color:#2b91af;">Coredll</span>.ShowWindow( hWndTaskBar, (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Sw</span>.SW_HIDE );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( hWndInputPanel != <span style="color:blue;">null</span> ) <span style="color:#2b91af;">Coredll</span>.ShowWindow( hWndInputPanel, (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Sw</span>.SW_HIDE );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( hWndSipButton != <span style="color:blue;">null</span> ) <span style="color:#2b91af;">Coredll</span>.ShowWindow( hWndSipButton, (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Sw</span>.SW_HIDE );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">Coredll</span>.SetWindowPos(</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        hWnd, (<span style="color:#2b91af;">IntPtr</span>) ( (<span style="color:blue;">int</span>)<span style="color:#2b91af;">Hwnd</span>.HWND_TOPMOST ), 0, 0,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        <span style="color:#2b91af;">Coredll</span>.GetSystemMetrics( (<span style="color:blue;">int</span>) <span style="color:#2b91af;">SystemMetric</span>.SM_CXSCREEN ),</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        <span style="color:#2b91af;">Coredll</span>.GetSystemMetrics( (<span style="color:blue;">int</span>) <span style="color:#2b91af;">SystemMetric</span>.SM_CYSCREEN ),</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Swp</span>.SWP_SHOWWINDOW );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            <span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">void</span> StopFullScreen( <span style="color:#2b91af;">Control</span> control )</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//IntPtr hWndInputPanel = Coredll.FindWindowW( &#8220;SipWndClass&#8221; , null );</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWndSipButton = <span style="color:#2b91af;">Coredll</span>.FindWindowW( <span style="color:#a31515;">&#8220;MS_SIPBUTTON&#8221;</span>, <span style="color:blue;">null</span> );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWndTaskBar = <span style="color:#2b91af;">Coredll</span>.FindWindowW( <span style="color:#a31515;">&#8220;HHTaskBar&#8221;</span>, <span style="color:blue;">null</span> );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> hWnd = control.Handle;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">Rect</span> rtDesktop = <span style="color:blue;">new</span> <span style="color:#2b91af;">Rect</span>( );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( hWndTaskBar != <span style="color:blue;">null</span> )</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        <span style="color:#2b91af;">Coredll</span>.ShowWindow( hWndTaskBar, (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Sw</span>.SW_SHOW );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//Never forcibly show the input panel</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//if( hWndSipButton != null )</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//{</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//    Coredll.ShowWindow( hWndSipButton, Sw.SW_SHOW );</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:green;">//}</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:green;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">IntPtr</span> rectPtr = <span style="color:#2b91af;">Marshal</span>.AllocHGlobal( <span style="color:#2b91af;">Marshal</span>.SizeOf( rtDesktop ) );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:blue;">if</span>( <span style="color:#2b91af;">Coredll</span>.SystemParametersInfo( <span style="color:#2b91af;">Spi</span>.SPI_GETWORKAREA, 0, rectPtr, <span style="color:#2b91af;">Spif</span>.None ) )<span style="color:green;"> )</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        <span style="color:#2b91af;">Rect</span> rect = (<span style="color:#2b91af;">Rect</span>) <span style="color:#2b91af;">Marshal</span>.PtrToStructure( rectPtr, <span style="color:blue;">typeof</span>( <span style="color:#2b91af;">Rect</span> ) );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                        <span style="color:#2b91af;">Coredll</span>.SetWindowPos( hWnd, (<span style="color:#2b91af;">IntPtr</span>) ( (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Hwnd</span>.HWND_TOPMOST ), 0, 0, rect.right &#8211; rect.left, rect.bottom &#8211; rect.top, (<span style="color:blue;">int</span>) <span style="color:#2b91af;">Swp</span>.SWP_SHOWWINDOW );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">                  <span style="color:#2b91af;">Marshal</span>.FreeHGlobal( rectPtr );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">            }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            The first method, StartFullScreen, hides the SIP( Standard Input Panel ), the SIP button bar and the task bar leaving the entire screen to be filled by the application window. The application window’s size is set to the size of the entire screen in <em>SetWindowPos</em><strong>. </strong>It’s that simple!</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">            When you want to exit full screen mode, you need to show the task bar, get the size of the client work area, specified with Spi.SPI_GETWORKAREA and then calculated the new size of the window( it would appear as a maximized window on your screen ). </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">You can download a sample project form 4shared: </span></span><span style="font-size:small;"><span style="font-family:Times New Roman;"><a href="http://www.4shared.com/file/156469684/4a4e4592/FullScreen.html" target="_blank">Source code here</a>.</span></span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=30&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2009/04/12/windows-ce-full-screen-applications/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ UNREFERENCED_PARAMETER</title>
		<link>http://andocs.wordpress.com/2009/04/07/c-unreferenced_parameter/</link>
		<comments>http://andocs.wordpress.com/2009/04/07/c-unreferenced_parameter/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:33:14 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[unreferenced_parameter]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=24</guid>
		<description><![CDATA[I am currently developing a driver for one of our custom made devices under Windows CE and I came across this macro -
UNREFERENCED_PARAMETER in one of the driver examples I took as reference for developing my own. The definition itself does not say much:
#define  UNREFERENCED_PARAMETER(P) (P)
All it does is to layout the parameter or expression it has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=24&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am currently developing a driver for one of our custom made devices under Windows CE and I came across this macro -</p>
<p>UNREFERENCED_PARAMETER in one of the driver examples I took as reference for developing my own. The definition itself does not say much:</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">#define<span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"> </span></span></span></span></span></span></span></span></span><span style="font-size:x-small;color:#0000ff;"></span></span><span style="font-size:x-small;"> UNREFERENCED_PARAMETER(P) (P)</span></p>
<p><span style="font-size:x-small;">All it does is to layout the parameter or expression it has been passed. After some browsing on the internet I&#8217;ve found this post by Paul DiLascia:</span></p>
<p><span style="font-size:x-small;"><a href="http://msdn.microsoft.com/en-us/magazine/cc163805.aspx">http://msdn.microsoft.com/en-us/magazine/cc163805.aspx</a> which I think greatly explains what is meant by compiling with Warning Level 4 &#8211; it made me a believer anyway.</span></p>
<p><span style="font-size:x-small;">Indeed, an unreferenced parameter would cause an error when compiling using level 4 and this is where UNREFERENCED_PARAMETER comes in handy. </span></p>
<p><span style="font-size:x-small;">For instance you have a function like this:</span></p>
<p><span style="font-size:x-small;">void foo( int arg1, float arg2 )</span></p>
<p><span style="font-size:x-small;">{</span></p>
<p><span style="font-size:x-small;">     UNREFERENCED_PARAMETER( arg1 );</span></p>
<p><span style="font-size:x-small;">}</span></p>
<p><span style="font-size:x-small;">Since you won&#8217;t be using arg1 and also you will compile with level 4, you just fool the compiler by passing arg1 as parameter to a macro that just adds the line:</span></p>
<p><span style="font-size:x-small;">arg1; </span></p>
<p><span style="font-size:x-small;">to your code. And since it is not used the compiler does not generate code for it and no efficiency or space is lost.</span></p>
<p><span style="font-size:x-small;">I will not repeat here stuff written in that post, just thought I&#8217;d mention it as a great post on C++ I&#8217;ve found. </span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=24&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2009/04/07/c-unreferenced_parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>Install an application for all users</title>
		<link>http://andocs.wordpress.com/2008/02/19/install-an-application-for-all-users/</link>
		<comments>http://andocs.wordpress.com/2008/02/19/install-an-application-for-all-users/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 22:02:58 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/?p=20</guid>
		<description><![CDATA[In this article I present techniques based on Visual Studio 2005 Deployment, C#, Windows Registry. 
I have recently encountered one of those errors you should expect but you don&#8217;t. I have an application for which I have created an installer project, under Visual Studio 2005. The application works fine after installation for the administrative role user [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=20&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this article I present techniques based on Visual Studio 2005 Deployment, C#, Windows Registry. </p>
<p>I have recently encountered one of those errors you should expect but you don&#8217;t. I have an application for which I have created an installer project, under Visual Studio 2005. The application works fine after installation for the administrative role user that installed it, but when switching to a less priviledge user on the same computer the install/ repair program starts for that user prompting for the installation kit path. As an aditional detail, the setup kit creates the application registry keys it requires under HKEY_CURRENT_USER key. And this is the flaw&#8230;</p>
<p>When creating registry entries for an application that might be used by more than one user, each of which having different access rights on the computer, we should place the registry key under the &#8220;user/ machine hive&#8221; node in the Registry view of the deployment project. This way we ensure that the keys get into the right place when the application is first installed. According to Microsoft&#8217;s definition, the keys placed under user/ machine hive will be placed either under HKEY_CURRENT_USER when the application is insalled only for one user and under HKEY_LOCAL_MACHINE when the application is intalled for all users. Here is a screenshot :</p>
<p> <a title="Visual Studio Registry View" href="http://andocs.files.wordpress.com/2008/02/registry.jpg"><img src="http://andocs.files.wordpress.com/2008/02/registry.thumbnail.jpg" alt="Visual Studio Registry View" /></a></p>
<p>The problem with keys under HKEY_LOCAL_MACHINE is that they are read only for restricted users, for example user belonging only to the &#8220;Users&#8221; group. It is though required to assign special permissions for those keys a user not only to read but also modify. The reason I needed this was to save some user settings in the registry, so when a less privileged user saves the settings, he/ she must also have proper permisions.</p>
<p>To solve my problem I&#8217;ve created a custom installer class implemented an event handler for the Commited event. In this handler, write access permissions are given to users belonging to the &#8220;Users&#8221; group.</p>
<p>I give bellow the implementation of my event handler.</p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;color:#008000;">// Event handler for &#8216;Committed&#8217; event.</span></span><span style="font-size:x-small;"> </span></p>
<p><span style="font-size:x-small;color:#0000ff;">private</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">void</span><span style="font-size:x-small;"> CustomInstaller_Committed( </span><span style="font-size:x-small;color:#0000ff;">object</span><span style="font-size:x-small;"> sender, </span><span style="font-size:x-small;color:#2b91af;">InstallEventArgs</span><span style="font-size:x-small;"> e )</span><span style="font-size:x-small;">{</span><span style="font-size:x-small;"> </span></p>
<div></div>
<p><span style="font-size:x-small;"></p>
<blockquote><p><span style="font-size:x-small;color:#2b91af;">RegistryKey</span><span style="font-size:x-small;"> hkCustom = </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;">;</span><span style="font-size:x-small;color:#2b91af;">RegistryKey</span><span style="font-size:x-small;"> hkTester = </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;">;</span><span style="font-size:x-small;"> </span></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;color:#008000;">// depending on the installation options, we will search for the application&#8217;s registry keys :</span></span></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;color:#008000;">// 1. &#8211; if installation is performed just for the current user, the keys will be under HKEY_CURRENT_USER</span></span><span style="font-size:x-small;"> </span></span></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;color:#008000;">// 2. &#8211; else if the installation is performed for all users, the keys will be under HKEY_LOCAL_MACHINE</span></span></span></p></blockquote>
<div></div>
<p></span><span style="font-size:x-small;"></p>
<blockquote><p>hkCustom = <span style="font-size:x-small;color:#2b91af;">Registry</span><span style="font-size:x-small;">.CurrentUser.OpenSubKey( </span><span style="font-size:x-small;color:#a31515;">&#8220;Software&#8221;</span><span style="font-size:x-small;"> ).OpenSubKey( </span><span style="font-size:x-small;color:#a31515;">&#8220;CustomInstallerTester&#8221;</span><span style="font-size:x-small;"> );</span><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkCustom != </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> )</span><span style="font-size:x-small;">{</span><span style="font-size:x-small;"> </span></p>
<p><span style="font-size:x-small;">hkTester = hkCustom.OpenSubKey( <span style="font-size:x-small;color:#a31515;">&#8220;Tester99&#8243;</span><span style="font-size:x-small;">, </span><span style="font-size:x-small;color:#2b91af;">RegistryKeyPermissionCheck</span><span style="font-size:x-small;">.ReadWriteSubTree </span><span style="font-size:x-small;color:#008000;">/*required*/</span><span style="font-size:x-small;"> );</span><span style="font-size:x-small;">}</span></span></p>
<p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkTester == </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> )</span><span style="font-size:x-small;">{</span><span style="font-size:x-small;"> </span></p>
<div></div>
<p><span style="font-size:x-small;"></p>
<blockquote><p>hkCustom = <span style="font-size:x-small;color:#2b91af;">Registry</span><span style="font-size:x-small;">.LocalMachine.OpenSubKey( </span><span style="font-size:x-small;color:#a31515;">&#8220;Software&#8221;</span><span style="font-size:x-small;"> ).OpenSubKey( </span><span style="font-size:x-small;color:#a31515;">&#8220;CustomInstallerTester&#8221;</span><span style="font-size:x-small;"> );</span></p>
<p><span style="font-size:x-small;">}</span></p></blockquote>
<p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkCustom != </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> )</span><span style="font-size:x-small;">{</span></p>
<div></div>
<p></span><span style="font-size:x-small;"></p>
<blockquote><p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkTester == </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> )</span><span style="font-size:x-small;">{</span></p>
<div></div>
<p><span style="font-size:x-small;"></p>
<blockquote>
<blockquote><p>hkTester = hkCustom.OpenSubKey( <span style="font-size:x-small;color:#a31515;">&#8220;Tester99&#8243;</span><span style="font-size:x-small;">, </span><span style="font-size:x-small;color:#2b91af;">RegistryKeyPermissionCheck</span><span style="font-size:x-small;">.ReadWriteSubTree </span><span style="font-size:x-small;color:#008000;">/*required*/</span><span style="font-size:x-small;"> );</span><span style="font-size:x-small;">}</span><span style="font-size:x-small;">}</span></p></blockquote>
</blockquote>
<p> </p>
<p></span></p></blockquote>
<p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkTester != </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> )</span><span style="font-size:x-small;">{</span></p>
<div></div>
<p></span><span style="font-size:x-small;"></p>
<blockquote><p>System.Security.AccessControl.<span style="font-size:x-small;color:#2b91af;">RegistrySecurity</span><span style="font-size:x-small;"> regSec = </span><span style="font-size:x-small;color:#0000ff;">new</span><span style="font-size:x-small;"> System.Security.AccessControl.</span><span style="font-size:x-small;color:#2b91af;">RegistrySecurity</span><span style="font-size:x-small;">( );</span><span style="font-size:x-small;"><span style="font-size:x-small;color:#008000;">// grant write permissions to the users group :</span></span></p>
<p><span style="font-size:x-small;">regSec.AddAccessRule( </span><span style="font-size:x-small;color:#0000ff;">new</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#2b91af;">RegistryAccessRule</span><span style="font-size:x-small;">( </span><span style="font-size:x-small;color:#a31515;">&#8220;users&#8221;</span><span style="font-size:x-small;">,</span><span style="font-size:x-small;"> </span></p>
<div></div>
<p><span style="font-size:x-small;"></p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p><span style="font-size:x-small;color:#2b91af;">RegistryRights</span><span style="font-size:x-small;">.ReadKey | </span><span style="font-size:x-small;color:#2b91af;">RegistryRights</span><span style="font-size:x-small;">.WriteKey | </span><span style="font-size:x-small;color:#2b91af;">RegistryRights</span><span style="font-size:x-small;">.Delete,</span></p>
<p><span style="font-size:x-small;color:#2b91af;">InheritanceFlags</span><span style="font-size:x-small;">.ContainerInherit,</span><span style="font-size:x-small;"><span style="font-size:x-small;color:#2b91af;">PropagationFlags</span><span style="font-size:x-small;">.None,</span></span></p>
<p><span style="font-size:x-small;color:#2b91af;">AccessControlType</span><span style="font-size:x-small;">.Allow</span><span style="font-size:x-small;">) );</span><span style="font-size:x-small;">hkTester.SetAccessControl( regSec );</span><span style="font-size:x-small;">}</span></p></blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p> </p>
<p></span></p></blockquote>
<p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkTester != </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> ) { hkTester.Close( ); }</span></p>
<p><span style="font-size:x-small;color:#0000ff;">if</span><span style="font-size:x-small;">( hkCustom != </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;"> ) { hkCustom.Close( ); }</span></p>
<p> </p>
<p></span></p></blockquote>
<p>}</p>
<p><font size="2"> </p>
<p></font></span> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/andocs.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/andocs.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=20&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2008/02/19/install-an-application-for-all-users/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>

		<media:content url="http://andocs.files.wordpress.com/2008/02/registry.thumbnail.jpg" medium="image">
			<media:title type="html">Visual Studio Registry View</media:title>
		</media:content>
	</item>
		<item>
		<title>Vista usb driver installation issues</title>
		<link>http://andocs.wordpress.com/2007/11/13/vista-usb-driver-installation-issues/</link>
		<comments>http://andocs.wordpress.com/2007/11/13/vista-usb-driver-installation-issues/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 10:28:04 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/2007/11/13/vista-usb-driver-installation-issues/</guid>
		<description><![CDATA[Recently, I&#8217;ve made a fresh install of Windows Vista on my Dell laptop. My troubles started when I tried to plug in a usb device that I needed to program.
Vista found my device, displayed it&#8217;s name in the Device Manager and started to install the driver for it. The installation seemed to go fine when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=19&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently, I&#8217;ve made a fresh install of Windows Vista on my Dell laptop. My troubles started when I tried to plug in a usb device that I needed to program.</p>
<p>Vista found my device, displayed it&#8217;s name in the Device Manager and started to install the driver for it. The installation seemed to go fine when it suddenly finished with an error message :</p>
<p>&#8220;Windows encounterd a problem installing the driver software for your device&#8221; &#8230; &#8220;Could not find the file specified.&#8221;.</p>
<p>I was astonished&#8230; I tried reinstalling the driver several times by manually specifying the path to my driver. I KNEW it was there.</p>
<p>The solution came by inspecting the log file : C:\Windows\inf\setupapi.dev.log. In the last entry I&#8217;ve found that Vista was not searching for the driver in the proper location, meaning C:\Windows\system32\drivers, but in a new location that I suspect, comes from a bug in the driver path formation. Vista was expecting the driver files ( .sys ) in C:\Windows\inf\system32\drivers.</p>
<p>So, what was left to do was to copy my .sys file in the folder Vista expects it to be and it all turned out fine. Now my device is installed and ready to use <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I need to point out that the expected folder did not exist, so I had to create it myself. As Microsoft so obsessively suggests, &#8220;make sure you have administrator privileges for this action&#8221;.</p>
<p>You may find another strange location Vista wants your driver to be, so I think a good point to start is by first analysing the setupapi.dev.log file I just mentioned.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/andocs.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/andocs.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=19&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2007/11/13/vista-usb-driver-installation-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>Choosing the default playback device in Xp</title>
		<link>http://andocs.wordpress.com/2007/08/21/choosing-the-default-playback-device-in-xp/</link>
		<comments>http://andocs.wordpress.com/2007/08/21/choosing-the-default-playback-device-in-xp/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 08:51:00 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/2007/08/21/choosing-the-default-playback-device-in-xp/</guid>
		<description><![CDATA[The theme of this post is one I have been fascinated for the last few days. The situation arises when you have more than one audio device attached to your computer. One might be the default audio device for your system while the other might be a USB audio device( like another audio usb board [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=15&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The theme of this post is one I have been fascinated for the last few days. The situation arises when you have more than one audio device attached to your computer. One might be the default audio device for your system while the other might be a USB audio device( like another audio usb board or a usb headset ). In the application I am working on, the user is required to record an audio note through an iMic usb system and in order to listen to that note, the default system playback device must be used. ( I will not waste the time explaining why, it is not relevant ). This configuration applies in other circumstances as well and I thought it would be usefull to post an entry about it.</p>
<p>As you are probably aware, when inserting a new usb audio device into your computer&#8217;s usb port, the default playback and recording device is set to the new usb device. You can do something about that too, but only if you write a custom driver for the usb devices such that they are not set as defaults upon insertion.</p>
<p>There is no clean way to change the playback and recording devices programatically. And there seems to be NO way in Vista.  You must set the default playback and recording devices manually from Control Panel/ Sounds and Audio Devices. And this is a &#8220;feature&#8221; of the operating system, not a bug.</p>
<p>Oh, well&#8230; I&#8217;ve found a solution for this problem in XP. The basic idea is that you must modify a registry key and then restart explorer.exe. My implementation is in C#, but this is not language dependent.</p>
<p><strong>The Registry : </strong></p>
<p>I assume you are familiar with the Audio setting control panel, and I will jump to presenting the registry entries you must change.</p>
<p>First, you must open the registry editor and browse to the following key :</p>
<p>HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper\</p>
<p><a href="http://andocs.files.wordpress.com/2007/08/sound_mapper.jpg" title="sound mapper keys"><img src="http://andocs.files.wordpress.com/2007/08/sound_mapper.jpg" alt="sound mapper keys" /></a></p>
<p>This is how the registry keys under Sound Mapper look like in my case. As you can see, the UserPlayback and UserRecord keys are filled with the system&#8217;s default audio device. The Playback and Record keys represent the current playback and recording devices.</p>
<p><strong>Implementation : </strong></p>
<p>Bellow, I give the two methods I use  to get and set the audio playback devices:</p>
<p>public string GetDefaultDevice( )<br />
{</p>
<blockquote><p> RegistryKey soundMapper        = null;</p></blockquote>
<blockquote><p> soundMapper = Registry.CurrentUser.OpenSubKey(&#8220;Software&#8221;).OpenSubKey(&#8220;Microsoft&#8221; ).OpenSubKey(                                        &#8220;Multimedia&#8221; ).OpenSubKey( &#8220;Sound Mapper&#8221;, true );</p></blockquote>
<blockquote><p>if ( soundMapper != null )</p></blockquote>
<blockquote><p> {</p></blockquote>
<blockquote>
<blockquote><p> string userPlayback= Convert.ToString(soundMapper.GetValue(&#8220;UserPlayback&#8221;, string.Empty));</p>
<p>return userPlayback;</p></blockquote>
<p>}</p></blockquote>
<blockquote><p> return string.Empty;</p></blockquote>
<p>}</p>
<p>/// &lt;summary&gt;<br />
/// Sets the audio device with the provided description as the default playback device.<br />
/// USE WITH CARE. THE DEVICE YOU MAY BE TRYING TO SET AS DEFAULT</p>
<p>///MAY NOT EXIST IN YOUR HARDAWARE CONFIGURATION</p>
<p>///&lt;/summary&gt;<br />
/// &lt;param name=&#8221;deviceDescription&#8221;&gt;Audio device description to be written to registry.&lt;/param&gt;</p>
<p>public void SetDefaultDevice( string deviceDescription )<br />
{</p>
<blockquote><p>RegistryKey soundMapper        = null;</p></blockquote>
<blockquote><p> soundMapper = Registry.CurrentUser.OpenSubKey(&#8220;Software&#8221;).OpenSubKey(&#8220;Microsoft&#8221; ).OpenSubKey( &#8220;Multimedia&#8221; ).OpenSubKey( &#8220;Sound Mapper&#8221;, true );</p></blockquote>
<blockquote><p>if ( soundMapper != null )</p></blockquote>
<blockquote><p> {</p></blockquote>
<blockquote>
<blockquote><p> string playbackDev = Convert.ToString( soundMapper.GetValue( &#8220;Playback&#8221;, string.Empty ) );</p></blockquote>
</blockquote>
<blockquote>
<blockquote><p> if ( playbackDev != string.Empty )</p></blockquote>
</blockquote>
<blockquote>
<blockquote><p> {</p></blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote><p> if ( playbackDev != deviceDescription )</p></blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote><p> {</p></blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> soundMapper.SetValue( &#8220;Playback&#8221;, deviceDescription, RegistryValueKind.String );</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> soundMapper.Flush();</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> soundMapper.Close( );</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> // restart explorer.exe :</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> // 1. kill explorer</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> foreach(Process p in Process.GetProcessesByName(&#8220;explorer&#8221;))</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> {</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> try<br />
{</p>
<blockquote><p> p.Kill( );</p></blockquote>
<p>}</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> catch ( Exception ex )<br />
{<br />
System.Diagnostics.Debug.WriteLine( ex.Message + &#8220;\n&#8221; + ex.StackTrace );<br />
}</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> }</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p> // 2. the OS restarts explorer automatically</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><p>return;</p></blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote><p> }</p></blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote><p> }</p></blockquote>
</blockquote>
<blockquote><p> soundMapper.Close( );</p></blockquote>
<blockquote><p> }</p></blockquote>
<p>}</p>
<p>Note that these two can be used together, when you want to set the playback device as the default device :</p>
<p>string defaultDevice = GetDefaultDevice( );</p>
<p>SetDefaultDevice( defaultDevice );</p>
<p>However, you can use the SetDefaultDevice method to set the Playback device to any device you want, as long as it exists. You must know the device description string in order to do that. This string is the one presented in the Audio settings control panel and should be an exact match in your code.</p>
<p>You can list the audio devices yourself, from inside your code, if you are willing to use the  DirectX library.</p>
<p>Note that in SetDefaultDevice, I have killed all explorer processes in the system. Windows will restart explorer automatically, so you don&#8217;t have to worry about that.</p>
<p>If you are using forms, do not make the registry chages inside the Load event handler but in the constructor. Otherwise, the changes will not be seen until the next time you restart your application.</p>
<p>So, I hope this will be of any help to you. And if you find another solution to this issue, I will be glad to hear about it. Thanks.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/andocs.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/andocs.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=15&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2007/08/21/choosing-the-default-playback-device-in-xp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>

		<media:content url="http://andocs.files.wordpress.com/2007/08/sound_mapper.jpg" medium="image">
			<media:title type="html">sound mapper keys</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET NumericUpDown crash workaround</title>
		<link>http://andocs.wordpress.com/2007/07/30/numericupdown-throws-an-unexpected-error-in-net-framework/</link>
		<comments>http://andocs.wordpress.com/2007/07/30/numericupdown-throws-an-unexpected-error-in-net-framework/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 07:56:35 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/2007/07/30/numericupdown-throws-an-unexpected-error-in-net-framework/</guid>
		<description><![CDATA[I encountered the following problem when trying to handle a NumericUpDown_ValueChanged event :
In the event handler, the code was very similar to this template :
if( someVal &#62; numericUpDown.Minimum &#38;&#38; someVal &#60; numericUpDown.Maximum )
{
// do something here
}
else
{
MessageBox.Show( &#8220;Some message&#8221; );
}
When the user holds the mouse pressed on one of the control arrows and the MessageBox is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=14&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I encountered the following problem when trying to handle a NumericUpDown_ValueChanged event :</p>
<p>In the event handler, the code was very similar to this template :</p>
<p>if( someVal &gt; numericUpDown.Minimum &amp;&amp; someVal &lt; numericUpDown.Maximum )</p>
<p>{</p>
<blockquote><p>// do something here</p></blockquote>
<p>}</p>
<p>else</p>
<p>{</p>
<blockquote><p>MessageBox.Show( &#8220;Some message&#8221; );</p></blockquote>
<p>}</p>
<p>When the user holds the mouse pressed on one of the control arrows and the MessageBox is to be shown, I get an exception that is more than unexpected.</p>
<p>Here is the complete stack trace :</p>
<p>System.Transactions Critical: 0 : &lt;TraceRecord xmlns=&#8221;http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord&#8221;<br />
Severity=&#8221;Critical&#8221;&gt;<br />
&lt;TraceIdentifier&gt;http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled&lt;/TraceIdentifier&gt;<br />
&lt;Description&gt;Unhandled exception&lt;/Description&gt;<br />
&lt;AppDomain&gt;YOUR_PROJECT_NAME.vshost.exe&lt;/AppDomain&gt;&lt;Exception&gt;<br />
&lt;ExceptionType&gt;System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;<br />
&lt;Message&gt;Object reference not set to an instance of an object.&lt;/Message&gt;<br />
&lt;StackTrace&gt;   at System.Windows.Forms.UpDownBase.UpDownButtons.TimerHandler(Object source, EventArgs args)</p>
<p>at System.Windows.Forms.Timer.OnTick(EventArgs e)<br />
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&amp; m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.Run(Form mainForm)<br />
at</p>
<p>&#8230; your line of code &#8230;</p>
<p>at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()&lt;/StackTrace&gt;&lt;ExceptionString&gt;System.NullReferenceException: Object reference not set to an instance of an object.<br />
at System.Windows.Forms.UpDownBase.UpDownButtons.TimerHandler(Object source, EventArgs args)<br />
at System.Windows.Forms.Timer.OnTick(EventArgs e)<br />
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&amp; m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.Run(Form mainForm)<br />
at</p>
<p>&#8230; your line of code &#8230;</p>
<p>at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()&lt;/ExceptionString&gt;&lt;/Exception&gt;&lt;/TraceRecord&gt;<br />
A first chance exception of type &#8216;System.Threading.ThreadAbortException&#8217; occurred in mscorlib.dll</p>
<p>As I was to find out digging some Microsoft forums, this is a known, documented issue of the<br />
Microsoft .NET framework. ( <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=251486&amp;wa=wsignin1.0" target="_blank">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=251486&amp;wa=wsignin1.0</a> ).</p>
<p>The workaround is available on this forum and it was of real help to me :</p>
<p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1554539&amp;SiteID=1" target="_blank">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1554539&amp;SiteID=1</a>.</p>
<p>Basically, &#8220;the control does not expect to get a message while it is executing an event handler. The workaround delays your response and lets the control finish its event handling. &#8220;</p>
<p>This is a sample( skeleton ) of my code, that uses a delegate instead of the MethodInvoker on the Microsoft forum example :</p>
<p>private delegate void CallMethodParam2( double x, bool y );</p>
<p>private void NumericUpDown_ValueChanged(object sender, EventArgs e)<br />
{</p>
<blockquote><p> if ( (someVal &gt;= numericUpDown.Minimum ) &amp;&amp;    ( someVal &lt;= numericUpDown.Maximum ) )<br />
{</p></blockquote>
<blockquote>
<blockquote><p>// some code</p></blockquote>
<p>}<br />
else<br />
{</p>
<blockquote><p> // Cancel changes<br />
this.ShowError( someVal );</p></blockquote>
<p>}</p></blockquote>
<p>}</p>
<p>private void ShowError( double someVal )<br />
{</p>
<blockquote><p>bool bLess = true;</p></blockquote>
<blockquote><p> double val = 0;</p></blockquote>
<blockquote><p> if ( someVal&lt;= numericUpDown.Minimum )<br />
{</p>
<blockquote><p> bLess = true;</p></blockquote>
<blockquote><p> val = numericUpDown.Minimum ;</p></blockquote>
<p>}<br />
else if ( someVal &gt;= numericUpDown.Maximum)<br />
{</p>
<blockquote><p> bLess = false;</p></blockquote>
<blockquote><p> val = numericUpDown.Maximum;</p></blockquote>
<p>}<br />
this.BeginInvoke( new CallMethodParam2( this.ShowError ), new object[ ] { val, bLess } );</p></blockquote>
<p>}<br />
private void ShowError( double dist, bool bLess )<br />
{</p>
<blockquote><p> string text = &#8220;Distance &#8220;+ ( ( bLess ) ? &#8220;less&#8221; : &#8220;greater&#8221; ) + &#8221; than &#8221; + dist.ToString( ) +&#8221; not allowed!&#8221;;</p></blockquote>
<blockquote><p> MessageBox.Show( text, &#8220;Error&#8221;, MessageBoxButtons.OK, MessageBoxIcon.Error );</p></blockquote>
<p>}</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/andocs.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/andocs.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=14&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2007/07/30/numericupdown-throws-an-unexpected-error-in-net-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
		<item>
		<title>Canceling the Load Form event in .NET</title>
		<link>http://andocs.wordpress.com/2007/07/20/canceling-the-load-form-event-in-net/</link>
		<comments>http://andocs.wordpress.com/2007/07/20/canceling-the-load-form-event-in-net/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 07:58:15 +0000</pubDate>
		<dc:creator>andocs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://andocs.wordpress.com/2007/07/20/canceling-the-load-form-event-in-net/</guid>
		<description><![CDATA[I was trying to find a way not to load a form when some error condition occured.
Briefly, the whole cancel logic should be placed in the constructor of the form and an exception should be thrown whenever canceling is necessary. The Show or ShowDialog methods must be included in the same try-catch block as the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=13&subd=andocs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was trying to find a way not to load a form when some error condition occured.</p>
<p>Briefly, the whole cancel logic should be placed in the constructor of the form and an exception should be thrown whenever canceling is necessary. The Show or ShowDialog methods must be included in the same try-catch block as the constructor.</p>
<p>Thus, when the exception is thrown, no form is displayed. There is no reliable way of canceling the Load event from within the Load event handler : if you call Close( ), you get an exception of the type : &#8220;Cannot acces a disposed object&#8221; on the Show or ShowDialog form methods.</p>
<p>See the following discussion also :</p>
<p><a href="http://discuss.fogcreek.com/dotnetquestions/default.asp?cmd=show&amp;ixPost=1286" target="_blank">http://discuss.fogcreek.com/dotnetquestions/default.asp?cmd=show&amp;ixPost=1286</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/andocs.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/andocs.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andocs.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andocs.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andocs.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andocs.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andocs.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andocs.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andocs.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andocs.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andocs.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andocs.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andocs.wordpress.com&blog=572055&post=13&subd=andocs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andocs.wordpress.com/2007/07/20/canceling-the-load-form-event-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/de73973b2513516523788bdfaad6b080?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andocs</media:title>
		</media:content>
	</item>
	</channel>
</rss>