<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Windows Mobile Tip: Creating shortcuts</title>
	<atom:link href="http://www.christec.co.nz/blog/archives/213/feed" rel="self" type="application/rss+xml" />
	<link>http://www.christec.co.nz/blog/archives/213</link>
	<description>Development for a mobile world - Making a quality platform one application at a time</description>
	<lastBuildDate>Fri, 12 Mar 2010 05:38:21 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Christopher Fairbairn</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-31682</link>
		<dc:creator>Christopher Fairbairn</dc:creator>
		<pubDate>Tue, 13 Oct 2009 23:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-31682</guid>
		<description>Hi Hema,

Try adding a line such as

BeginInvoke(new Action(() =&gt; Hide()));

At the end of your Form Load event handler (or even the constructor of your form, directly underneath the call to InitializeComponent).

The problem is the form load event handler is called part way through the OS attempting to make your window visible. Even if you request it to hide, your load event handler still returns to the code within the OS that then makes the window visible.

Using a code snippet such as the one I mentioned above essentially &quot;queues&quot; up the request to hide the window. Your form load event handler returns, the window is briefly made visible, and then the OS gets around to processing any outstanding window messages, and hence finds your request to hide it.

For a similiar reason another method you may see suggested is the use of a timer with a duration of 1 millisecond. The timer tick event triggers after the window is visible, and hence calling Hide() works as expected.

Depending upon what you are attempting to do it may even be better to start off with a console project, and only make the window visible when first required.

Hope this helps,
Christopher Fairbairn

Hope this helps,
Christopher Fairbairn</description>
		<content:encoded><![CDATA[<p>Hi Hema,</p>
<p>Try adding a line such as</p>
<p>BeginInvoke(new Action(() => Hide()));</p>
<p>At the end of your Form Load event handler (or even the constructor of your form, directly underneath the call to InitializeComponent).</p>
<p>The problem is the form load event handler is called part way through the OS attempting to make your window visible. Even if you request it to hide, your load event handler still returns to the code within the OS that then makes the window visible.</p>
<p>Using a code snippet such as the one I mentioned above essentially &#8220;queues&#8221; up the request to hide the window. Your form load event handler returns, the window is briefly made visible, and then the OS gets around to processing any outstanding window messages, and hence finds your request to hide it.</p>
<p>For a similiar reason another method you may see suggested is the use of a timer with a duration of 1 millisecond. The timer tick event triggers after the window is visible, and hence calling Hide() works as expected.</p>
<p>Depending upon what you are attempting to do it may even be better to start off with a console project, and only make the window visible when first required.</p>
<p>Hope this helps,<br />
Christopher Fairbairn</p>
<p>Hope this helps,<br />
Christopher Fairbairn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HemaLatha</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-30461</link>
		<dc:creator>HemaLatha</dc:creator>
		<pubDate>Mon, 14 Sep 2009 06:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-30461</guid>
		<description>Hello anybody can help me in this issue......I have created auto started windows mobile application.That should work as a back end process means we have written code in the form load but we don&#039;t want to show the screen to the user. i have tried form1.hide() and form1.windowsstate=formstate.minimized. But it&#039;s not orking.

If you have the solution it will be very helpful.

Regards,
Hema</description>
		<content:encoded><![CDATA[<p>Hello anybody can help me in this issue&#8230;&#8230;I have created auto started windows mobile application.That should work as a back end process means we have written code in the form load but we don&#8217;t want to show the screen to the user. i have tried form1.hide() and form1.windowsstate=formstate.minimized. But it&#8217;s not orking.</p>
<p>If you have the solution it will be very helpful.</p>
<p>Regards,<br />
Hema</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reg</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-17663</link>
		<dc:creator>reg</dc:creator>
		<pubDate>Thu, 27 Nov 2008 02:17:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-17663</guid>
		<description>I was wondering about making a shortcut to a webpage. I was able to do it before but I cant remember how I did it. For example I want to make a shortcut to youtube.

Thanks,
reg</description>
		<content:encoded><![CDATA[<p>I was wondering about making a shortcut to a webpage. I was able to do it before but I cant remember how I did it. For example I want to make a shortcut to youtube.</p>
<p>Thanks,<br />
reg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AD</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-15613</link>
		<dc:creator>AD</dc:creator>
		<pubDate>Sat, 18 Oct 2008 16:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-15613</guid>
		<description>Hi and thanx a million dude.

Keep up the good work.

Caio.</description>
		<content:encoded><![CDATA[<p>Hi and thanx a million dude.</p>
<p>Keep up the good work.</p>
<p>Caio.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Fairbairn</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-13613</link>
		<dc:creator>Christopher Fairbairn</dc:creator>
		<pubDate>Sat, 13 Sep 2008 00:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-13613</guid>
		<description>Hi Cliff,

I have not verified it, but have you tried calling &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa916021.aspx&quot; rel=&quot;nofollow&quot;&gt;DeleteFile&lt;/a&gt; (or it&#039;s managed equivalent &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx&quot; rel=&quot;nofollow&quot;&gt;File.Delete&lt;/a&gt;), passing in the path to the shortcut?

For example:

&lt;pre lang=&quot;csharp&quot;&gt;using System.IO;

File.Delete(@&quot;\windows\start menu\programs\my email.lnk&quot;);&lt;/pre&gt;

Shortcuts can be treated as if they were any other file on the filesystem.</description>
		<content:encoded><![CDATA[<p>Hi Cliff,</p>
<p>I have not verified it, but have you tried calling <a href="http://msdn.microsoft.com/en-us/library/aa916021.aspx" rel="nofollow">DeleteFile</a> (or it&#8217;s managed equivalent <a href="http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx" rel="nofollow">File.Delete</a>), passing in the path to the shortcut?</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
&nbsp;
File.<span style="color: #0000FF;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;\windows\start menu\programs\my email.lnk&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Shortcuts can be treated as if they were any other file on the filesystem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cliff Corbett</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-13100</link>
		<dc:creator>Cliff Corbett</dc:creator>
		<pubDate>Thu, 11 Sep 2008 19:22:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-13100</guid>
		<description>How about a programatic method for removing a shortcut?</description>
		<content:encoded><![CDATA[<p>How about a programatic method for removing a shortcut?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.christec.co.nz/blog/archives/213/comment-page-1#comment-10839</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 14 Aug 2008 00:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.christec.co.nz/blog/archives/213#comment-10839</guid>
		<description>Visual Studio Deployment project cant create a shortcut which includes command line arguments. And if you instead craft your own .lnk file it wont let you deploy it. When you try to add it nothing happens. For some reason it rejects the file extension.

The only remaining option is to create it in code using a CE Setup dll. which can&#039;t be managed code. So you can&#039;t use System.Runtime.InteropServices.

Well done Microsoft for completely shafting us again.</description>
		<content:encoded><![CDATA[<p>Visual Studio Deployment project cant create a shortcut which includes command line arguments. And if you instead craft your own .lnk file it wont let you deploy it. When you try to add it nothing happens. For some reason it rejects the file extension.</p>
<p>The only remaining option is to create it in code using a CE Setup dll. which can&#8217;t be managed code. So you can&#8217;t use System.Runtime.InteropServices.</p>
<p>Well done Microsoft for completely shafting us again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

