<?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: Single instance applications in Windows CE</title>
	<atom:link href="http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/feed" rel="self" type="application/rss+xml" />
	<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce</link>
	<description>Defragmenting a .NET programmers brain</description>
	<lastBuildDate>Wed, 08 Sep 2010 17:04:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: domingo</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-3837</link>
		<dc:creator>domingo</dc:creator>
		<pubDate>Fri, 09 Jul 2010 21:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-3837</guid>
		<description>I work in VB for Windows Mobile. I translated your code and this is what I have:
Dim Sistema As uso
Dim System.Windows.Forms As uso
Dim System.Runtime.InteropServices As uso
Dim System.Reflection As uso
Dim de As espacioDim Bitmatic As nombres
 Dim clase As estáticoDim 
    ( DllImport (&quot; coredll.dll &quot;, SetLastError = verdadero)) público estático externo CreateMutex IntPtr ( IntPtr Attr , bool Propios, cadena Nombre )
    ( DllImport (&quot; coredll.dll &quot;, SetLastError = verdadero)) público estático externo bool ReleaseMutex ( hMutex IntPtr )
    Const ERROR_ALREADY_EXISTS As largo = 183
    Function estático(Formulario As frm) As públicoEjecutar As vacío
     Dim name As cadena = Assembly.GetExecutingAssembly (). getName () . Nombre
     Dim mutexHandle As IntPtr = CreateMutex ( IntPtr.Zero , verdadero, Nombre)
     Dim error As largo = Marshal.GetLastWin32Error ()
     Dim (Error As siDim ERROR_ALREADY_EXISTS As Not  = ) Application.Run (frm )
     ReleaseMutex ( mutexHandle )

 End Function
************************************************
It does not work. Please can you tell me am I doing wrong?</description>
		<content:encoded><![CDATA[<p>I work in VB for Windows Mobile. I translated your code and this is what I have:<br />
Dim Sistema As uso<br />
Dim System.Windows.Forms As uso<br />
Dim System.Runtime.InteropServices As uso<br />
Dim System.Reflection As uso<br />
Dim de As espacioDim Bitmatic As nombres<br />
 Dim clase As estáticoDim<br />
    ( DllImport (&#8221; coredll.dll &#8220;, SetLastError = verdadero)) público estático externo CreateMutex IntPtr ( IntPtr Attr , bool Propios, cadena Nombre )<br />
    ( DllImport (&#8221; coredll.dll &#8220;, SetLastError = verdadero)) público estático externo bool ReleaseMutex ( hMutex IntPtr )<br />
    Const ERROR_ALREADY_EXISTS As largo = 183<br />
    Function estático(Formulario As frm) As públicoEjecutar As vacío<br />
     Dim name As cadena = Assembly.GetExecutingAssembly (). getName () . Nombre<br />
     Dim mutexHandle As IntPtr = CreateMutex ( IntPtr.Zero , verdadero, Nombre)<br />
     Dim error As largo = Marshal.GetLastWin32Error ()<br />
     Dim (Error As siDim ERROR_ALREADY_EXISTS As Not  = ) Application.Run (frm )<br />
     ReleaseMutex ( mutexHandle )</p>
<p> End Function<br />
************************************************<br />
It does not work. Please can you tell me am I doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alden</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-2255</link>
		<dc:creator>Alden</dc:creator>
		<pubDate>Mon, 24 May 2010 12:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-2255</guid>
		<description>It works perfect.Thanks a lot!</description>
		<content:encoded><![CDATA[<p>It works perfect.Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-2181</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 19 May 2010 15:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-2181</guid>
		<description>This worked great!  Thanks.

Do you know of a way to set focus back to the running app instead of just exiting (if the application is minimized for example).</description>
		<content:encoded><![CDATA[<p>This worked great!  Thanks.</p>
<p>Do you know of a way to set focus back to the running app instead of just exiting (if the application is minimized for example).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mary</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-1975</link>
		<dc:creator>Mary</dc:creator>
		<pubDate>Thu, 06 May 2010 09:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-1975</guid>
		<description>Very useful. I am going to try this now. IF there is any problem, I will contact you.</description>
		<content:encoded><![CDATA[<p>Very useful. I am going to try this now. IF there is any problem, I will contact you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-1293</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Fri, 12 Mar 2010 13:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-1293</guid>
		<description>I was heading down the route of adding and deleting values to the Win32 API atom table and checking all references for any atoms that exist are still running. This is a much simpler and more elegant solution!

Saved me a lot of time, thanks!</description>
		<content:encoded><![CDATA[<p>I was heading down the route of adding and deleting values to the Win32 API atom table and checking all references for any atoms that exist are still running. This is a much simpler and more elegant solution!</p>
<p>Saved me a lot of time, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakob</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-32</link>
		<dc:creator>Jakob</dc:creator>
		<pubDate>Thu, 03 Sep 2009 10:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-32</guid>
		<description>Hi Jan,

The creation of the mutex is thread-safe.

Also, according to Microsoft:
&quot;The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.&quot;
This means that abnormal program termination should release the mutex. :-)</description>
		<content:encoded><![CDATA[<p>Hi Jan,</p>
<p>The creation of the mutex is thread-safe.</p>
<p>Also, according to Microsoft:<br />
&#8220;The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.&#8221;<br />
This means that abnormal program termination should release the mutex. <img src='http://bitmatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-31</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Thu, 03 Sep 2009 10:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-31</guid>
		<description>The solution do not have any concurrency problem, if the creation of the mutex is thread safe.

It is also a smart solution, if the mutex is destroyed, when the single instance application exits abnormally.

Regards
JRO</description>
		<content:encoded><![CDATA[<p>The solution do not have any concurrency problem, if the creation of the mutex is thread safe.</p>
<p>It is also a smart solution, if the mutex is destroyed, when the single instance application exits abnormally.</p>
<p>Regards<br />
JRO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moose</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-33</link>
		<dc:creator>Moose</dc:creator>
		<pubDate>Wed, 19 Aug 2009 23:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-33</guid>
		<description>Much needed.  Thanks!</description>
		<content:encoded><![CDATA[<p>Much needed.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakob</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-30</link>
		<dc:creator>Jakob</dc:creator>
		<pubDate>Thu, 23 Jul 2009 18:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-30</guid>
		<description>That is a very good question Pete.

I guess you could use FindWindow and SetForegroundWindow to do it, but I don&#039;t have any code available that does it.

Maybe this should be the subject of my next blog post :-)</description>
		<content:encoded><![CDATA[<p>That is a very good question Pete.</p>
<p>I guess you could use FindWindow and SetForegroundWindow to do it, but I don&#8217;t have any code available that does it.</p>
<p>Maybe this should be the subject of my next blog post <img src='http://bitmatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://bitmatic.com/compact-framework/single-instance-applications-in-windows-ce/comment-page-1#comment-29</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Thu, 23 Jul 2009 15:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://bitmatic.com/?p=370#comment-29</guid>
		<description>This worked great!  Thanks.

Do you know of a way to set focus back to the running app instead of just exiting (if the application is minimized for example).</description>
		<content:encoded><![CDATA[<p>This worked great!  Thanks.</p>
<p>Do you know of a way to set focus back to the running app instead of just exiting (if the application is minimized for example).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
