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

<channel>
	<title>Akbar&#039;s Blog</title>
	<atom:link href="http://blog.syedgakbar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.syedgakbar.com</link>
	<description>Software development is fun</description>
	<lastBuildDate>Tue, 16 Apr 2013 15:43:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Android &#8211; Application Theme Based on Platform Version</title>
		<link>http://blog.syedgakbar.com/2013/04/16/android-application-theme-based-on-platform-version/</link>
		<comments>http://blog.syedgakbar.com/2013/04/16/android-application-theme-based-on-platform-version/#comments</comments>
		<pubDate>Tue, 16 Apr 2013 15:43:18 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=836</guid>
		<description><![CDATA[When testing my Jack Sparrow Compass application on the Jelly Bean 4.2, I realized that all its Users Interface (or overall theme) was still of the Gingerbread (on which I had developed this application). Even though that interface doesn&#8217;t look that bad on Jelly Bean, it&#8217;s not consistent with other application interface, and I would [...]]]></description>
			<content:encoded><![CDATA[<p>When testing my <a href="http://www.syedgakbar.com/products/compass/">Jack Sparrow Compass</a> application on the Jelly Bean 4.2, I realized that all its Users Interface (or overall theme) was still of the Gingerbread (on which I had developed this application). Even though that interface doesn&#8217;t look that bad on Jelly Bean, it&#8217;s not consistent with other application interface, and I would like to keep it consistent with new platforms, but would still like to keep the compatibility with old Android versions.  </p>
<p>After few tries and tricks, I was successful, and I&#8217;m going to share that here for easy future reference. To best understand the problem, let&#8217;s begin from start. Here is how my application was appearing on Jelly Bean 4.2:</p>
<p><a href="http://blog.syedgakbar.com/wp-content/uploads/2013/03/1.png"><img src="http://blog.syedgakbar.com/wp-content/uploads/2013/03/1-180x300.png" alt="" title="Pick Target Location - Old Theme" width="180" height="300" class="alignnone size-medium wp-image-839" /></a> <a href="http://blog.syedgakbar.com/wp-content/uploads/2013/03/2.png"><img src="http://blog.syedgakbar.com/wp-content/uploads/2013/03/2-180x300.png" alt="" title="My Location - Old Theme" width="180" height="300" class="alignnone size-medium wp-image-840" /></a></p>
<p>But if I look at other native application of the Jelly Bean, they have quite different theme and styles as shown below:</p>
<p><img alt="" src="http://developer.android.com/images/ui/dialogs.png" title="Android Dialog Theme" class="alignnone" width="440" height="242" /></p>
<p>So, I wanted to look my application dialog similar to above one on Jelly Bean or higher version, but still appear the same on the old version. The trick lies in the styles XML files in corresponding Android version folder. So, I create my custom theme styles (in res/values/styles.xml):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MainTheme&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Light.NoTitleBar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Here I&#8217;m defining the MainTheme for my application and inheriting it from the Android built-in &#8220;Theme.Light.NoTitleBar&#8221;. This is the style I plan to apply to my main Activity in the Application manifest file by adding following attribute:android:theme=&#8221;@style/MainTheme&#8221; </p>
<p><strong>Note: </strong> I&#8217;m using the &#8220;Theme.Light.NoTitleBar&#8221; as the parent style because I don&#8217;t want a default TitleBar in my application. If you want one, please choose the &#8220;Theme.Light&#8221;.</p>
<p>This is not all you want, but the magic comes by adding the correct style based on higher version styles. For this you create res/values-v11/styles.xml (for Android 3.0+) and res/values-v14/styles.xml (for Android 4.1) files under corresponding values-XX folders. </p>
<p>So here is the XML file I created under res/values-v11/styles.xml:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MainTheme&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Holo.Light.NoActionBar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And here is the XML file I created under res/values-v14/styles.xml:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MainTheme&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.DeviceDefault.Light.NoActionBar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you can see I&#8217;m using the different parent style per Android version, and this does the magic. Now if you run your applicaiton on Android 2.2 or 2.3 it will use the default theme &#8220;Theme.Light.NoTitleBar&#8221;. If you run it on Android 3.0+ version, it will use Theme.Holo.Light.NoActionBar style, and similarly for Android 4.1, it will use Theme.DeviceDefault.Light.NoActionBar. </p>
<p><strong>Note: </strong> To use the higher version styles, you must set your Android target version to the higher version i.e. &#8220;4.1&#8243;. Otherwise you will get the resource/style not found error.</p>
<p>Now if I run the application on 4.1, it will use the native theme on all the UI components as shown below:</p>
<p><a href="http://blog.syedgakbar.com/wp-content/uploads/2013/03/3.png"><img src="http://blog.syedgakbar.com/wp-content/uploads/2013/03/3-180x300.png" alt="" title="Pick Target Location - New Theme" width="180" height="300" class="alignnone size-medium wp-image-841" /></a>   <a href="http://blog.syedgakbar.com/wp-content/uploads/2013/03/5.png"><img src="http://blog.syedgakbar.com/wp-content/uploads/2013/03/5-180x300.png" alt="" title="My Location Dialog - New Theme" width="180" height="300" class="alignnone size-medium wp-image-843" /></a></p>
<p>It was a bit tricky to grasp in start, but once you get used to this theme concept model based on version folder, you will see how powerful this is when designing applications for future versions but still maintaining backward comparability with older versions. If you want to read more, I highly recommend you to check official &#8220;Themes and Styles&#8221; guidelines on Android website:<br />
<a href="http://developer.android.com/guide/topics/ui/themes.html">http://developer.android.com/guide/topics/ui/themes.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/04/16/android-application-theme-based-on-platform-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS 7 and URL Rewerite</title>
		<link>http://blog.syedgakbar.com/2013/03/10/iis-7-and-url-rewerite/</link>
		<comments>http://blog.syedgakbar.com/2013/03/10/iis-7-and-url-rewerite/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 09:49:49 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[IIS]]></category>
		<category><![CDATA[URL Rewrite]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=830</guid>
		<description><![CDATA[I have been using IIS 6 (and some older versions) for a long time for many of the clients website. One of the biggest feature I miss is the URL Rewrite component. Apache support this module for so long, and it&#8217;s must have for friend URLs. Fortunately, due to powerfull ISAPI support, there are already [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using IIS 6 (and some older versions) for a long time for many of the clients website. One of the biggest feature I miss is the URL Rewrite component. Apache support this module for so long, and it&#8217;s must have for friend URLs. </p>
<p>Fortunately, due to powerfull ISAPI support, there are already many powerful 3rd Party applications available which provides really good URL Rewrite support. I would like to mention two of these:<br />
<a href="www.isapirewrite.com" target="_blank">www.isapirewrite.com</a><br />
<a href="www.urlrewriter.net" target="_blank">www.urlrewriter.net</a></p>
<p>However, I recently needed to use the similar function on one of client website which is running on IIS 7, and before trying any of these 3rd Party tools, I decided to search and see if IIS 7.0 support and Viola! It does. The URL Rewrite module in IIS 7 is not only as powerful as you would expect it to be (supporting most of the Apache counterpart URL rewrite module), but its integration in the IIS Manager is a big plus. You can easily add and test rules them using the visual interface. Here is a very good beginner tutorial:<br />
<a href="http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module" target="_blank">http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module</a></p>
<p>For some of the geeky fans, who still like the type this instead of wasting time in UI dialog, these  rewrite rules are stored in your website web.config file, so you can view, add or edit these directly there too. Here is a sample of how these rules appear in the web.config file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Rewrite to article.aspx&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;^article/([0-9]+)/([_0-9a-z-]+)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;article.aspx?id={R:1}&amp;amp;title={R:2}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>You still have to type more than you have to do for something similar in Apache and other 3rd Party URL rewrite tools, but this is because of the XML syntax, and there price you have to pay for better (debatable) data format.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/03/10/iis-7-and-url-rewerite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jelly Bean 4.2.2 On Nexus One</title>
		<link>http://blog.syedgakbar.com/2013/03/06/jelly-bean-4-2-2-on-nexus-one/</link>
		<comments>http://blog.syedgakbar.com/2013/03/06/jelly-bean-4-2-2-on-nexus-one/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 09:36:47 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Camera]]></category>
		<category><![CDATA[Custom ROM]]></category>
		<category><![CDATA[Jelly Bean]]></category>
		<category><![CDATA[Link2SD]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=812</guid>
		<description><![CDATA[I have been using the Jelly Bean 4.2.2 &#8211; v4.7 for few days now, and I must say that it&#8217;s working great so far. I covered all the installation steps and tricks in the previous article: Installing Jelly Beans on Nexus One However, with time, I learned something more about this ROM, and applied few [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using the <a href="http://forum.xda-developers.com/showthread.php?t=2096747&#038;nocache=1">Jelly Bean 4.2.2 &#8211; v4.7</a> for few days now, and I must say that it&#8217;s working great so far. I covered all the installation steps and tricks in the previous article:<br />
<a href="http://blog.syedgakbar.com/2013/01/27/installing-jelly-beans-on-nexus-one/" title="Installing Jelly Beans on Nexus One">Installing Jelly Beans on Nexus One</a></p>
<p>However, with time, I learned something more about this ROM, and applied few more tricks to get a very smooth running Jelly Bean on my Nexus One (haven&#8217;t had a single crash since last 4 days). I thought to share these with others using the same (or similar ROMs) and see if this helps you guys too. So, here these are:</p>
<p><strong>1: Custom Camera Application</strong><br />
The Camera in this ROM works, but it&#8217;s just functional i.e. the picture quality is very bad. I know the N1 camera quality is great, because I have used this a lot in Gingerbread and loved the quality. Fortunately, there are some workarounds available. The simplest is to use 3rd Party camera application from the Google Play store. The one I&#8217;m using and highly recommend are:<br />
<a href="https://play.google.com/store/apps/details?id=slide.cameraZoom&#038;feature=search_result" target="_blank">Camera ZOOM FX </a><br />
<a href="https://play.google.com/store/apps/details?id=com.almalence.hdr&#038;feature=search_result">HDR Camera</a></p>
<p>You will get way good quality pictures with these applications than the stock camera application. </p>
<p><strong>2: Use SD Card Booster</strong><br />
I recommend installing some SD Card Booster form the Google App Store. There are many, but I tried the following and it works well for me:</p>
<p>https://play.google.com/store/apps/details?id=com.sdincrease.it</p>
<p>For my SD-Card, I got best performance with 1024 size. You can try few values on your system, and see which one works well for you. Once configured properly, you should get some good speed in running applications and playing movies from the SD-Card. </p>
<p><strong>3: Install/Update Google Search</strong><br />
Go to Google Play store, search for &#8220;Google Search&#8221; and it will let you install or update the Google Search version. With this, you can use the voice search and input using the keyboard. It still needs the Internet (no offline version available yet) but still it&#8217;s better than nothing.</p>
<p><strong>4: Integrate Link2SD </strong><br />
If you are using the Jelly Bean or any other custom ROM which provides the ROOT access, then I think this is the must have application for you. You can download <a href="https://play.google.com/store/apps/details?id=com.buak.Link2SD&#038;feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5idWFrLkxpbmsyU0QiXQ..">Link2SD</a> this from Google PlyStore.  The configuration is simple, and there are many tutorials on how to setup this. So, I will not go into that detail. However, I would recommend one thing special, and that&#8217;s if you are using this ROM, partition your SD-Ext as FAT32 (instead of Ext2, Ext3 or Ext4). Though the linux paritions like EXT3 or EXT4 works, I had lot of permission issues using these. But FAT32 worked very well for me. If you are using Windows, you can use the MiniTool Partition tool to format your SD-Card. Again, there are many online tutorial on how to do that, so will not go in these details.</p>
<p><strong>Note: </strong> Link2SD can&#8217;t work be juxtaposed with A2SD or similar scripts. So, if you want to use this, don&#8217;t use built-in A2SD or any other SD-Ext manager application. </p>
<p><strong>5: Keep Dalvik Cache in Internal Memory</strong><br />
If you have low access speed SD-Card, then you may find it better to keep the Dalvik Cache in the internal memory. Doing this I have found the application to be more responsive and speedy. I&#8217;m not a guru on Android architecture, so may be there are some shortfalls of this, but so far this (keeping Dalvik Cahce in internal memory) has been working great for me. So, other thing I did different for <a href="http://forum.xda-developers.com/showthread.php?t=2096747&#038;nocache=1">Jelly Bean 4.2.1</a>, is to keep the Dalvik Cache in internal memory. If you followed that ROM steps, for A2SD install, you need to do this in terminal:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># su </span>
<span style="color: #666666; font-style: italic;"># a2sd install</span>
N 
N
Y</pre></td></tr></table></div>

<p>This means that you may have to keep cleaning up the Dalvik Cache from time to time. But fortunately you can do this from Recovery (I&#8217;m using CynogenMod Recovery). When you do this, system will build the cache again on next start-up. It should work well if you have comparatively low number of applications.</p>
<p><strong>Note: </strong>If you want to use the A2SD, then you must have the Ext2 or Ext4 as second partition. Having the Fat32 as second partition works well with Link2SD, but doesn&#8217;t work with A2SD (and it doesn&#8217;t complain about this either). It simply will not move the cache.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/03/06/jelly-bean-4-2-2-on-nexus-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net Cookieless Session and Absolute URLs</title>
		<link>http://blog.syedgakbar.com/2013/02/18/asp-net-cookieless-session-and-absolute-urls/</link>
		<comments>http://blog.syedgakbar.com/2013/02/18/asp-net-cookieless-session-and-absolute-urls/#comments</comments>
		<pubDate>Mon, 18 Feb 2013 10:17:40 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Cookieless]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=793</guid>
		<description><![CDATA[For one of our ASP.Net websites, we have been using the Cookies mode to &#8220;AutoDetect&#8221; (by adding cookieless=&#8221;AutoDetect&#8221; in sessionState tag in web.config). This has worked well for years in serving the website correctly to users with all types of securities (even who don&#8217;t allow the web cookies). When the cookies are disabled by the [...]]]></description>
			<content:encoded><![CDATA[<p>For one of our ASP.Net websites, we have been using the Cookies mode to &#8220;AutoDetect&#8221; (by adding cookieless=&#8221;AutoDetect&#8221; in sessionState tag in web.config). This has worked well for years in serving the website correctly to users with all types of securities (even who don&#8217;t allow the web cookies).</p>
<p>When the cookies are disabled by the user security policies, then ASP.Net auto detect this and adds the session info in the URL of the each request, something like::<br />
~/(X(1)S(cp53yq30mtagv555unhr0t45))/system/index.aspx</p>
<p>The cryptic path &#8220;(X(1)S(cp53yq30mtagv555unhr0t45))&#8221; in the URL is actually used to indicate the session ID. ASP.Net auto manage the addition and removal of this session info, and in the ASP.Net codebehind, you don&#8217;t need to worry about this. Even you don&#8217;t get this URL with session info with Request.URL or any other property.</p>
<p>The only limitation is that this breaks when you try to redirect from ASP.Net to an absolute URL e.g. &#8220;/system/index.asp&#8221;. We normally don&#8217;t use any absolute URL in our application, but there are few places where the absolute path is used (mostly to handle protocol changes), and we discovered that it was causing mysterious automatic log-out for some users (which were not allowing cookies).</p>
<p>The fix, fortunately, was very simple. The ASP.Net naively provides a method which add the current session ID to the URL if using the Cookieless mode. The method is HttpResponse.ApplyAppPathModifier and you can apply this by simply calling and passing required absolute URL:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">string</span> redirectUrl <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #9900cc;">ApplyAppPathModifier</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;/system/index.aspx&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>The beauty of this method is that it auto detects the session mode and only appends session info, if required. If want to know more about Cookieless session in general, I would suggestion this MSDN article:<br />
<a href="http://msdn.microsoft.com/en-us/library/aa479314.aspx">http://msdn.microsoft.com/en-us/library/aa479314.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/02/18/asp-net-cookieless-session-and-absolute-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Link2SD and Read-only file system Error</title>
		<link>http://blog.syedgakbar.com/2013/02/11/link2sd-and-read-only-file-system-error/</link>
		<comments>http://blog.syedgakbar.com/2013/02/11/link2sd-and-read-only-file-system-error/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 08:51:30 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Link2SD]]></category>
		<category><![CDATA[Permissions]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=781</guid>
		<description><![CDATA[I have been using Link2SD for few days now (on my Rooted NexusOne) and I simply loves this application. It solves all the issues of low internal memory for the custom applications. However from time to time, the SD-Ext partition used by Link2SD gets corrupt. Now I&#8217;m not very sure whom to blame for this [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using Link2SD for few days now (on my Rooted NexusOne) and I simply loves this application. It solves all the issues of low internal memory for the custom applications. </p>
<p>However from time to time, the SD-Ext partition used by Link2SD gets corrupt. Now I&#8217;m not very sure whom to blame for this i.e. Android Kernal, Link2SD or anything application which writes files here. But anyway, I found a simple fix for any such problems, and that&#8217;s if you get the read-only file system error when installing or updating the SD-Ext in the Link2SD, you can quickly repair this from the ADB Shell. If you have never used this before, here is quick reference and guide:</p>
<p>http://developer.android.com/tools/help/adb.html</p>
<p>Once you have this tool. But the phone into recovery mode, and then run the ADB shell from your command prompt:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">adb Shell</pre></td></tr></table></div>

<p>Once you see the shell prompt, you can check and fix your sd-ext partition by typing following command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">e2fsck <span style="color: #660033;">-fpDC0</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span>mmcblk0p2</pre></td></tr></table></div>

<p>If fixing is successful, re boot back into phone and try using the Link2SD again. </p>
<p class="update">
<strong>Update:</strong> A quick tip on this (based on my personal experience). If you are using Link2SD and your frequently get the file system error on your SD-Ext partition, then one trick which worked well for me is to change the SD-Ext partition format from the Ext3 or Ext4 to FAT32. This should get rid of most of the file system errors happen during transfer of files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/02/11/link2sd-and-read-only-file-system-error/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Android: CyanogenMod Recovery Partition Gets Overwritten During Next Boot</title>
		<link>http://blog.syedgakbar.com/2013/02/06/android-cyanogenmod-recovery-partition-gets-overwritten-during-next-boot/</link>
		<comments>http://blog.syedgakbar.com/2013/02/06/android-cyanogenmod-recovery-partition-gets-overwritten-during-next-boot/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 16:19:00 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[CyanogenMod]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=777</guid>
		<description><![CDATA[I have been using the CyanogenMod Recovery partition to install custom ROMs, but with my stock Android 2.3.6 ROM, I was having an issue where the Recovery partition is getting restored with stock one with very next boot. This issue is also mentioned in notes for CM Recovery installation (http://wiki.cyanogenmod.org/w/Install_CM_for_passion): Note: Some ROMs overwrite recovery [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using the CyanogenMod Recovery partition to install custom ROMs, but with my stock Android 2.3.6 ROM, I was having an issue where the Recovery partition is getting restored with stock one with very next boot. This issue is also mentioned in notes for CM Recovery installation (<a href="http://wiki.cyanogenmod.org/w/Install_CM_for_passion">http://wiki.cyanogenmod.org/w/Install_CM_for_passion</a>):</p>
<blockquote><p><span style="color: #ff0000;">Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.</span></p></blockquote>
<p>Though it was not a show-stopper as it gets fixed once I install the custom ROM, but what if you plan to use this recovery, but keep using the stock ROM. Fortunately, the solution for this is simple too. As mentioned above in the warning note, the Stock 2.3.6 ROM tries to restore the Recovery during the boot. The recovery backup is stored at the following path in System:<br />
/system/recovery-from-boot.p</p>
<p>So, all you have to do to get rid of this automatic recovery overwrite is to delete this recovery backup file, and Android system will no longer overwrite. your custom recovery image. You can delete this file easily using ES File Explorer. If you have never used ES File Explorer, here is quick tutorial to do this:</p>
<p>1. Open ES File Explorer File Manager.<br />
2. Select the menu button on your device and click on Settings.<br />
3. Check the Up to Root option, then also check the Root Explorer option. When the prompt appears for root privileges, press the 4. Allow/Grant button.<br />
5. Check the Mount File System option as well.<br />
6. Go to the Root folder of your Android file-system i.e. &#8220;/&#8221; path.<br />
7. Go to the &#8220;system&#8221; folder and long-tap on the recovery-from-boot.p file, and then delete it. </p>
<p>I hope you find this of help.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/02/06/android-cyanogenmod-recovery-partition-gets-overwritten-during-next-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: Installing System Images using flashboot</title>
		<link>http://blog.syedgakbar.com/2013/02/01/android-installing-system-images-using-flashboot/</link>
		<comments>http://blog.syedgakbar.com/2013/02/01/android-installing-system-images-using-flashboot/#comments</comments>
		<pubDate>Fri, 01 Feb 2013 16:33:50 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Boot]]></category>
		<category><![CDATA[Fastboot]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=750</guid>
		<description><![CDATA[In my previous article, Installing Jelly Bean on Nexus One, I discussed how I was able to install Jelly Bean on my NexusOne using couple of tools and helper applications. However, after a couple of days of exploring it, I decided to try to downgrade it back to Gingerbread (mainly because of the Camera issues). [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous article, <a href="http://blog.syedgakbar.com/2013/01/27/installing-jelly-beans-on-nexus-one/">Installing Jelly Bean on Nexus One</a>, I discussed how I was able to install Jelly Bean on my NexusOne using couple of tools and helper applications.</p>
<p>However, after a couple of days of exploring it, I decided to try to downgrade it back to Gingerbread (mainly because of the Camera issues). This step was even more simple than installing the Jelly Bean on my nexus one. The good thing was that I took the full backup of my Gingerbread before upgrading to the Jelly Bean (using ROM Manager). This backup folder had flash-able images of the system, boot and recovery partitions. So all I had to do to revert back the original version was to run couple of commands in the bootloader mode.</p>
<p>Here are the exact commands (for your info, and my future reference):</p>
<p><strong>1. </strong> First you need to boot into bootloader mode. You can do this from key combination of your phone (for Nexus-One, it&#8217;s Power+Trackball down), or you can reboot into bootloader mode using the following adb command:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">adb reboot-bootloader</pre></td></tr></table></div>

<p><strong>2. </strong>Wait for your cell to reboot in bootloader mode, and once you see it, test it by running following command:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">fastboot devices</pre></td></tr></table></div>

<p>If the above command lists your device, then you are good to go forward. Otherwise wait for few more second and/or check USB cable connection.</p>
<p><strong>3. </strong>Once the fastboot mode is detecting the device, you can flash your Image and System flashable images using following commands:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">fastboot flash boot boot.<span style="color: #007788;">img</span>
fastboot flash <span style="color: #0000dd;">system</span> <span style="color: #0000dd;">system</span>.<span style="color: #007788;">img</span></pre></td></tr></table></div>

<p><strong>4. </strong>The next step is to simply clear your cache and user-data to avoid any problem with previous ROM data.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">fastboot erase userdata
fastboot erase cache</pre></td></tr></table></div>

<p><strong>5. </strong>And at last, simply reboot your phone:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">fastboot reboot</pre></td></tr></table></div>

<p>If everything went well, you should be able to see your previous version without any problems. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/02/01/android-installing-system-images-using-flashboot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Jelly Bean on Nexus One</title>
		<link>http://blog.syedgakbar.com/2013/01/27/installing-jelly-beans-on-nexus-one/</link>
		<comments>http://blog.syedgakbar.com/2013/01/27/installing-jelly-beans-on-nexus-one/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 07:34:09 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Custom Recovery]]></category>
		<category><![CDATA[Custom ROM]]></category>
		<category><![CDATA[Jelly Bean]]></category>
		<category><![CDATA[Rooting]]></category>
		<category><![CDATA[Unlocking]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=751</guid>
		<description><![CDATA[I have my Nexus One for more than a year. Although its stock OS (Gingerbread) is quite outdated, I still overall love it. But I must admit that it&#8217;s quite outdated OS now. So, I decided to upgrade this to Android Jelly Bean with hope to learn a lot during this process. First of all, [...]]]></description>
			<content:encoded><![CDATA[<p>I have my Nexus One for more than a year. Although its stock OS (Gingerbread) is quite outdated, I still overall love it. But I must admit that it&#8217;s quite outdated OS now. So, I decided to upgrade this to Android Jelly Bean with hope to learn a lot during this process.</p>
<p>First of all, please note that this is not a guide to how to install Jelly Bean on Nexus One. If you are looking for one, search on the web, and you will find dozens (if not hundreds). FYI, I read many, but referenced the following two mostly:<br />
<a href="http://marian.schedenig.name/2012/07/22/installing-android-4-ics-on-the-google-nexus-one/" target="_blank" >http://marian.schedenig.name/2012/07/22/installing-android-4-ics-on-the-google-nexus-one/</a><br />
<a href="http://c2med.blogspot.com/2012/07/how-to-install-ics-nexus-one.html" target="_blank" >http://c2med.blogspot.com/2012/07/how-to-install-ics-nexus-one.html</a></p>
<p>Here are the mains steps I used:</p>
<p><strong>1. Unlocking your Phone</strong><br />
It&#8217;s basically unlocking your phone bootloader. this is required because if your bootloader is locked, you can’t replace your recovery image, you can’t flash a custom ROM, and you can’t edit your system files. So we have to do this before the fun start. Here is a quick guide on how to do this (just follow the &#8220;Unlocking the device&#8221; section):<br />
<a href="http://wiki.cyanogenmod.org/w/Install_CM_for_passion" target="_blank" >http://wiki.cyanogenmod.org/w/Install_CM_for_passion</a></p>
<p><span style="color: #ff0000;">Note: Unlocking the bootloader on a Nexus device will automatically wipe all device data.</span></p>
<p><strong>2. Rooting your Phone</strong><br />
Once you have unlocked the Phone, the next step is Root it. Rooting is the process of allowing you to run your device with root-level permissions i.e. allow Superuser permissions. This gives you as a user to perform all the permissions including deleting the files required to run the system. While you normally wouldn&#8217;t do this, you can still do this. The main reason for Rooting is to give you additional control while in the Android to setup the Custom ROMs.</p>
<p>For the rooting, you can use either install the CyanogenMod custom ROM for your device (as in the above link), or you can try some application which exploits the Android OS vulnerability to root it. I tried the <a href="http://shortfuse.org/"  target="_blank" >OneClickSuper</a> application, and it worked for me. So you can try it as a simple alternative too. This application interface is quite straightforward, but if you have any confusion, there are plenty of tutorials available.</p>
<p><strong>3. Install Custom Recovery</strong><br />
Recovery refers to the dedicated, bootable partition that has the recovery console installed. This is used to detect and load the Android OS from the main partition. Plus this also has supports some basic commands/options to restore your system in case of any problem. The stock recovery is pretty basic, and don&#8217;t have much options. Specially the stock recovery doesn&#8217;t allow you to do the installation of the custom ROMs and do backup/restore.</p>
<p>For installing custom recovery, there are two possible ways. If you like Geeky style, then you can do this manually by following this tutorial (follow the &#8220;Installing recovery using fastboot&#8221; section):<br />
<a href="http://wiki.cyanogenmod.org/w/Install_CM_for_passion"  target="_blank" >http://wiki.cyanogenmod.org/w/Install_CM_for_passion</a></p>
<p>There is also a simple way, that I followed, and that&#8217;s to install the CyanogenMod Recovery using ROM Manager. Here is very simple tutorial on this:<br />
<a href="http://tech2.in.com/how-to/smartphones/how-to-root-and-install-custom-recovery-on-any-android-phone/280442" target="_blank">http://tech2.in.com/how-to/smartphones/how-to-root-and-install-custom-recovery-on-any-android-phone/280442</a></p>
<p><strong>4. Partition you SD Card</strong><br />
The next step is to reparation your SD Card so that the applications can be installed on your SD Card. This way you can leave more RAM for the system applications. I think this is required (but not very sure) to install large size ROMs like Jelly Bean. Anyway, as this was simple process, I decided to do this anyway.</p>
<p>For this, again there are two ways. First is geeky way and it&#8217;s to use the 4EXTRecovery to install custom recovery and use it to partition the SD-Card. Here is a good tutorial on this:<br />
<a href="http://www.roms-au.com/howtos/ext3/" target="_blank">http://www.roms-au.com/howtos/ext3/</a></p>
<p>Another, simple one is to create this partition using ROM Manager. Again, as I have the ROM Manager installed, so I use this option. Here is a tutorial for this:<br />
<a href="http://theultralinx.com/2011/10/how-to-partition-your-sd-card-with-rom-manager.html" target="_blank">http://theultralinx.com/2011/10/how-to-partition-your-sd-card-with-rom-manager.html</a></p>
<p><span style="color: #ff0000;"><strong>Warning:</strong> After doing the above step, I got the famous Android boot failure (Android with Exclamation sign). To fix this, I booted in to Recovery mode, and Cleared the User-Data. This fixed my problem.</span></p>
<p><strong>5. Partition your Internal Memory (HBoot)</strong><br />
To Install the Jelly Beans or ICS, you need to first resize the internal memory (called HBoot). This is because the new ROM size for the JB or ICS is so big that it will not fit on the default partition created for the Gingerbread on Nexus One. Different ROMs require the different HBoot size. I was planning to use <a href="http://forum.xda-developers.com/showthread.php?t=2096747">CM10.1 VJ Jelly Bean 4.2.1</a> and this requires 250 HBoot. So next step is to re-size the partition. This can be done by <a href="http://forum.xda-developers.com/showthread.php?t=1270589">BlackRose</a>.</p>
<p><span style="color: #ff0000;"><strong>Warning:</strong> In case after the above step you can&#8217;t load into recovery. You can fix this by flashing your recovery image again from the fastboot mode.</span></p>
<p><strong>6. Install your Custom ROM</strong><br />
Once all the above is done, you are ready to install your custom ROM. For this download it, and place it on your SD-Card. If you forgot to do this (like I did) before formatting and erasing your system. You can mount the SD Card from the Recovery too (if you are using CyanogenMod recovery. Once you are in the recovery mode, do &#8220;wipe data/factory reset&#8221; and also wipe all paritions except the sd-card. Then select update from SD-Card, select the new ROM ZIP file. This should start the installer. Cross your fingers while it finish the installation and do the booting. </p>
<p><strong>7. Results</strong><br />
If everything went well, then you will see your new Android OS. I&#8217;m using Jelly Bean and it&#8217;s really great. There are still few (but minor) display issues, but overall it&#8217;s fully functional. The best thing is that as soon as I signed in with Google Account, all my contacts and applications were restored. So, the system is back in running state in an hour or so.</p>
<p><strong>8. Bonus</strong><br />
I like the new Jelly Beans OS and overall functions. However, I didn&#8217;t find the booting animation that cute (sorry CyanogenMod designer). Fortunately, there is simple way to change that too. Here is the one I tried:<br />
<a href="http://forum.xda-developers.com/showpost.php?p=28025789&#038;postcount=1" target="_blank">http://forum.xda-developers.com/showpost.php?p=28025789&#038;postcount=1</a></p>
<p>The setup is simple. Just download the flashable version of the animation. Place it on SD-Card. Boot to Recovery mode, and simply flash the new animation. Enjoy the new elegant animation.</p>
<p><strong>Conclusion</strong><br />
If you try this, please do a very thorough reading of all the above articles (and any other articles you can find on web) before trying any of this. The key is to make sure you know what you are doing. If you are not sure, read more or post questions to experts (I&#8217;m not expert). Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/01/27/installing-jelly-beans-on-nexus-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Desktop ListView Handle</title>
		<link>http://blog.syedgakbar.com/2013/01/19/windows-desktop-listview-handle/</link>
		<comments>http://blog.syedgakbar.com/2013/01/19/windows-desktop-listview-handle/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 09:39:41 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[Visual C++]]></category>
		<category><![CDATA[Win32 API]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Handle]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=742</guid>
		<description><![CDATA[I have been using a utility function in my TaskbarExt application for years to get the current Desktop ListView window handle (SysListView32 to be exact) to show/hide the icons depending on user preferences. This has worked well for years, but recently I enabled the Windows Desktop wallpaper rotation, and I noticed that this function randomly [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using a utility function in my <a href="http://www.syedgakbar.com/products/TaskbarExt/">TaskbarExt</a> application for years to get the current Desktop ListView window handle (SysListView32 to be exact) to show/hide the icons depending on user preferences.</p>
<p>This has worked well for years, but recently I enabled the Windows Desktop wallpaper rotation, and I noticed that this function randomly stops working. On debugging the issue, I found that when the wallpaper rotation is enabled, instead of loading the &#8220;SHELLDLL_DefView&#8221; window in the &#8220;Progman&#8221;, Windows was loading under the &#8220;WorkerW&#8221; window. BTW, the Spy++ Tool was great help in debugging all this.</p>
<p>Once I know what&#8217;s going on, the fix was quite easy. In case your are running into similar issues, here is the sample code which works for me:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">HWND GetDesktopListViewHWND<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  HWND hDesktopListView <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span>
  HWND hWorkerW <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span>
&nbsp;
  HWND hProgman <span style="color: #000080;">=</span> FindWindow<span style="color: #008000;">&#40;</span>_T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Progman&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  HWND hDesktopWnd <span style="color: #000080;">=</span> GetDesktopWindow<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
  <span style="color: #666666;">// If the main Program Manager window is found</span>
  <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>hProgman<span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
	<span style="color: #666666;">// Get and load the main List view window containing the icons (found using Spy++). </span>
    HWND hShellViewWin <span style="color: #000080;">=</span> FindWindowEx<span style="color: #008000;">&#40;</span>hProgman, <span style="color: #0000dd;">0</span>, _T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;SHELLDLL_DefView&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>hShellViewWin<span style="color: #008000;">&#41;</span>
      hDesktopListView <span style="color: #000080;">=</span> FindWindowEx<span style="color: #008000;">&#40;</span>hShellViewWin, <span style="color: #0000dd;">0</span>, _T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;SysListView32&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">else</span>
		<span style="color: #666666;">// When this fails (happens in Windows-7 when picture rotation is turned ON), then look for the WorkerW windows list to get the </span>
		<span style="color: #666666;">// correct desktop list handle.</span>
		<span style="color: #666666;">// As there can be multiple WorkerW windows, so iterate through all to get the correct one</span>
		<span style="color: #0000ff;">do</span>
		<span style="color: #008000;">&#123;</span>
			hWorkerW <span style="color: #000080;">=</span> FindWindowEx<span style="color: #008000;">&#40;</span> hDesktopWnd, hWorkerW, _T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;WorkerW&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000ff;">NULL</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
			hShellViewWin <span style="color: #000080;">=</span> FindWindowEx<span style="color: #008000;">&#40;</span>hWorkerW, <span style="color: #0000dd;">0</span>, _T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;SHELLDLL_DefView&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>hShellViewWin <span style="color: #000080;">==</span> <span style="color: #0000ff;">NULL</span> <span style="color: #000040;">&amp;&amp;</span> hWorkerW <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
		<span style="color: #666666;">// Get the ListView control</span>
		hDesktopListView <span style="color: #000080;">=</span> FindWindowEx<span style="color: #008000;">&#40;</span>hShellViewWin, <span style="color: #0000dd;">0</span>, _T<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;SysListView32&quot;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  <span style="color: #008000;">&#125;</span>
&nbsp;
  <span style="color: #0000ff;">return</span> hDesktopListView<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Hopefully the comments should explain what&#8217;s going on very well. But if you still have any questions or suggestions, please do share with me.</p>
<p>On a side note, any wallpaper with icons turned off looks so beautiful. So I would recommend give this a try. So, if you are a programmer, which you most probably are if are reading so far, then better go ahead and implement this yourself. It will be a nice little utility. If however, busy with some other stuff, you can try my <a href="http://www.syedgakbar.com/products/TaskbarExt/">TaskbarExt</a> application and get this in action quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/01/19/windows-desktop-listview-handle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net SecurityProtocol (for SSL Version Control)</title>
		<link>http://blog.syedgakbar.com/2013/01/03/asp-net-securityprotocol-for-ssl-version-control/</link>
		<comments>http://blog.syedgakbar.com/2013/01/03/asp-net-securityprotocol-for-ssl-version-control/#comments</comments>
		<pubDate>Thu, 03 Jan 2013 10:38:42 +0000</pubDate>
		<dc:creator>syedgakbar</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Version]]></category>

		<guid isPermaLink="false">http://blog.syedgakbar.com/?p=733</guid>
		<description><![CDATA[Recently, when working on an integration API written in ASP.Net which communicates with a web-services developed using PHP, the tech support requested to force all the secure communication (over HTTPS) to use only the SSL v3 version. This can be controlled in PHP CURL via single line of code as shown blow: 1 curl_setopt&#40;$curl, CURLOPT_SSLVERSION,3&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, when working on an integration API written in ASP.Net which communicates with a web-services developed using PHP, the tech support requested to force all the secure communication (over HTTPS) to use only the SSL v3 version. </p>
<p>This can be controlled in PHP CURL via single line of code as shown blow:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_SSLVERSION<span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>For more details on this, please check <a href="http://php.net/manual/en/function.curl-setopt.php">curl-setopt</a>. Doing this in the ASP.Net was a single line of code as well, but finding it was not that easy.  Here is the code which did the trick for me:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">try</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// Take back-up of current protocl and force use of only SSL3</span>
	SecurityProtocolType activeProtocol <span style="color: #008000;">=</span> ServicePointManager<span style="color: #008000;">.</span><span style="color: #0000FF;">SecurityProtocol</span><span style="color: #008000;">;</span>
	ServicePointManager<span style="color: #008000;">.</span><span style="color: #0000FF;">SecurityProtocol</span> <span style="color: #008000;">=</span> SecurityProtocolType<span style="color: #008000;">.</span><span style="color: #0000FF;">Ssl3</span><span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">// The ASP.Net communciation (using HttpWebRequest) goes here</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">finally</span> <span style="color: #008000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// Restore the orignal protocol</span>
	ServicePointManager<span style="color: #008000;">.</span><span style="color: #0000FF;">SecurityProtocol</span> <span style="color: #008000;">=</span> activeProtocol<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syedgakbar.com/2013/01/03/asp-net-securityprotocol-for-ssl-version-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
