<?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>Windows CE Programming &#187; windows mobile</title>
	<atom:link href="http://www.hjgode.de/wp/tag/windows-mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hjgode.de/wp</link>
	<description>Windows Mobile Development and usage</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:53:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<!--CodeProjectFeeder channel--><category>CodeProject</category><generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mobile Developement &#8211; RDP AutoLogin extended (version 4)</title>
		<link>http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-developement-rdp-autologin-extended-version-4</link>
		<comments>http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 13:53:56 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[windows mobile]]></category>
		<category><![CDATA[Windows Mobile 6]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1299</guid>
		<description><![CDATA[Hello on the wish of the one or other user I extended the RDP AutoLogin code and we now reached level 4. The new code simply has only one extension, it supports the color depth selection. Also the color depth and other settings are visible on the dialog of Remote Desktop Mobile, the settings itself [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>on the wish of the one or other user I extended the RDP AutoLogin code and we now reached level 4.</p>
<p>The new code simply has only one extension, it supports the color depth selection. Also the color depth and other settings are visible on the dialog of Remote Desktop Mobile, the settings itself are done via the Default.rdp file. But you are right, RDP_AutoLogin also controls some of the dialog items directly.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="text" style="font-family:monospace;"><ol><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1">Domain:s:</div></li><li class="li1"><div class="de1">ColorDepthID:i:3</div></li><li class="li1"><div class="de1">ScreenStyle:i:0</div></li><li class="li1"><div class="de1">DesktopWidth:i:640</div></li><li class="li1"><div class="de1">DesktopHeight:i:480</div></li><li class="li1"><div class="de1">UserName:s:rdesktop</div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1">ServerName:s:192.168.128.5</div></li><li class="li1"><div class="de1">SavePassword:i:1</div></li><li class="li1"><div class="de1">...</div></li></ol></pre></div></div>
<p>The color depth setting supports two modes, 8 Bit with 256b colors (ColorDepthID:i:1) and 16 Bit with ~65000 colors (ColorDepthID:i:3).</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="reg" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="geshi_registry_header">REGEDIT4</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="br0">&#91;</span><span class="kw3">HKEY_LOCAL_MACHINE</span>\Software\RDP_autologin<span class="br0">&#93;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;FitToScreen&quot;</span><span class="sy0">=</span><span class="st0">&quot;1&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;FullScreen&quot;</span><span class="sy0">=</span><span class="st0">&quot;1&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Status&quot;</span><span class="sy0">=</span><span class="st0">&quot;connecting...&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Save Password&quot;</span><span class="sy0">=</span><span class="st0">&quot;1&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Domain&quot;</span><span class="sy0">=</span><span class="st0">&quot;&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Password&quot;</span><span class="sy0">=</span><span class="st0">&quot;Intermec+2004&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Username&quot;</span><span class="sy0">=</span><span class="st0">&quot;rdesktop&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;Computer&quot;</span><span class="sy0">=</span><span class="st0">&quot;192.168.0.130&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;DesktopWidth&quot;</span><span class="sy0">=</span>640</div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;DesktopHeight&quot;</span><span class="sy0">=</span>480</div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;startOnExit&quot;</span><span class="sy0">=</span><span class="st0">&quot;\\rdp_keepBusy.exe&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;execargs&quot;</span><span class="sy0">=</span><span class="st0">&quot;noRDPstart&quot;</span></div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;UseMouseClick&quot;</span><span class="sy0">=</span>&quot;0&quot;	//added with version 3 to switch between mouse and keyboard simulation</div></li><li class="li1"><div class="de1"><span class="geshi_variable">&quot;ColorDepth&quot;</span><span class="sy0">=</span>1		//added with version 4 to enable switching between 8 and 16 Bit colors</div></li></ol></pre></div></div>
<p>The code changes are small. Some code addition to read the value from the registry and some to write the rdp file:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw4">void</span> readReg<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1">        <span class="co1">//ColorDepth new with version 4</span></div></li><li class="li1"><div class="de1">        <span class="kw1">if</span><span class="br0">&#40;</span>RegReadDword<span class="br0">&#40;</span>L<span class="st0">&quot;ColorDepth&quot;</span>, <span class="sy3">&amp;</span>dwTemp<span class="br0">&#41;</span> <span class="sy1">==</span> 0<span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">            dwColorDepth<span class="sy1">=</span>dwTemp<span class="sy4">;</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="kw4">void</span> writeRDP<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1">			<span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span>wcsstr<span class="br0">&#40;</span>rdpLines<span class="br0">&#91;</span>c<span class="br0">&#93;</span>.<span class="me1">line</span>, L<span class="st0">&quot;ColorDepthID&quot;</span><span class="br0">&#41;</span><span class="sy3">!</span><span class="sy1">=</span><span class="kw2">NULL</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				wsprintf<span class="br0">&#40;</span>szTemp, rdpLines<span class="br0">&#91;</span>c<span class="br0">&#93;</span>.<span class="me1">line</span>, dwColorDepth<span class="br0">&#41;</span><span class="sy4">;</span>  <span class="co1">//3=HighColor(16Bit) or 1=(8Bit) color</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>Additionally I have added a new project to the solution to enable to set all the settings not only via the registry but using a GUI application. RDP_Autologin_Settings is born:</p>
<p><span id="more-1299"></span></p>
<p><a href="http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/clipboard01-2/" rel="attachment wp-att-1300"><img class="alignnone size-full wp-image-1300" title="Clipboard01" src="http://www.hjgode.de/wp/wp-content/uploads/2012/01/Clipboard01.gif" alt="" width="240" height="320" /></a>  <a href="http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/clipboard02-2/" rel="attachment wp-att-1301"><img class="alignnone size-full wp-image-1301" title="Clipboard02" src="http://www.hjgode.de/wp/wp-content/uploads/2012/01/Clipboard02.gif" alt="" width="240" height="320" /></a> <a href="http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/clipboard03/" rel="attachment wp-att-1302"><img class="alignnone size-full wp-image-1302" title="Clipboard03" src="http://www.hjgode.de/wp/wp-content/uploads/2012/01/Clipboard03.gif" alt="" width="240" height="320" /></a><a href="http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/clipboard04/" rel="attachment wp-att-1303"> <img class="alignnone size-full wp-image-1303" title="Clipboard04" src="http://www.hjgode.de/wp/wp-content/uploads/2012/01/Clipboard04.gif" alt="" width="240" height="320" /></a></p>
<p>As you see, there is also a small file browser integrated. The default OpenFile dialog of Compact Framework does not allow you to browse all directories, but only &#8220;\My Documents&#8221;.</p>
<p>RDP AutoLogin Settings Editor (exe): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=150" title="Downloaded 36 times">RDP AutoLogin Settings editor</a> -  (Hits: 36, size: 10.45 kB)<br />
source (Visual Studio 2008 WM5 SDK project): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=151" title="Downloaded 29 times">RDP AutoLogin Settings editor Source Code</a> -  (Hits: 29, size: 21.23 kB)</p>
<p>RDP_AutoLogin (exe): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=152" title="Downloaded 31 times">RDP AutoLogin Executable</a> -  (Hits: 31, size: 6.78 kB)<br />
source (Visual Studio 2008 WM5 SDK project): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=153" title="Downloaded 27 times">RDP AutoLogin Source Code</a> -  (Hits: 27, size: 56.85 kB)</p>
<p>RDP_KeepBusy (exe): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=155" title="Downloaded 24 times">RDP KeepBusy (executable)</a> -  (Hits: 24, size: 3.17 kB)<br />
RDP_KeepBusy (vs2008 WM5 SDK project): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=154" title="Downloaded 28 times">RDP KeepBusy Source Code</a> -  (Hits: 28, size: 12.92 kB)</p>
<p>Have fun</p>
<p>Josef</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F&amp;title=Mobile+Developement+%26%238211%3B+RDP+AutoLogin+extended+%28version+4%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F&amp;title=Mobile+Developement+%26%238211%3B+RDP+AutoLogin+extended+%28version+4%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F&amp;title=Mobile+Developement+%26%238211%3B+RDP+AutoLogin+extended+%28version+4%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F&amp;T=Mobile+Developement+%26%238211%3B+RDP+AutoLogin+extended+%28version+4%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2012%2F01%2F03%2Fmobile-developement-rdp-autologin-extended-version-4%2F&amp;t=Mobile+Developement+%26%238211%3B+RDP+AutoLogin+extended+%28version+4%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2012/01/03/mobile-developement-rdp-autologin-extended-version-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Mobile &#8211; tasker2 runs and stops applications periodically</title>
		<link>http://www.hjgode.de/wp/2011/12/23/windows-mobile-tasker2-runs-and-stops-applications-periodically/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-mobile-tasker2-runs-and-stops-applications-periodically</link>
		<comments>http://www.hjgode.de/wp/2011/12/23/windows-mobile-tasker2-runs-and-stops-applications-periodically/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 13:11:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[notification API]]></category>
		<category><![CDATA[periodically]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[tasker2]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1286</guid>
		<description><![CDATA[Tasker2 is a tool to launch or kill applications periodically using windows mobile scheduler. It was born to control the running of agent software on windows mobile at specified times. The problem with the agent software was that it does not open/close connections only on usage times but all the time and the device&#8217;s battery [...]]]></description>
			<content:encoded><![CDATA[<p>Tasker2 is a tool to launch or kill applications periodically using windows mobile scheduler. It was born to control the running of agent software on windows mobile at specified times. The problem with the agent software was that it does not open/close connections only on usage times but all the time and the device&#8217;s battery was drain very fast. We decided to write a helper that would launch and kill the agent to have it running only within a defined time frame.</p>
<h2>Background process</h2>
<p>We could have written a background process to run external tasks periodically. But the main disadvantage of timers and threads in background processes is that they do not run, if the device is in suspend mode.<br />
To ensure that tasks will be launched also if the device is sleeping, we decided to use the windows mobile scheduler. There are functions inside the notification API to create notifications that will run an application at a specified time. This is what we call a schedule.</p>
<h2>The scheduler (notification API)</h2>
<p>After a timed schedule has been done by the scheduler, the schedule is removed from the notification database. If you like to have a periodic schedule, you have to ensure that a new schedule is created inside your code.</p>
<h2>Pitfalls</h2>
<p>During development we found many pitfalls in conjunction with the windows mobile scheduler. This is why I decided to write this post.</p>
<h2>The tasks</h2>
<p>Tasker2 is a console application without any GUI but it will write a log with all you need to know. Tasker2 supports up to ten tasks. A task is defined using the registry. Every task has an entry for start and stop times, the application to control, an interval for the schedule and a flag for control if a task is only to be run on external power:</p>
<pre>REGEDIT4

[HKLM\Software\Tasker\Task1]
"active":DWORD=1
"exe":="\Windows\fexplore.exe"
"arg":="\My Documents"
"start":="1423"
"stop":="1523"
"interval":="2400"
"startOnAConly":DWORD=0;</pre>
<p><strong>active</strong>: if active is 0, tasker2 will not kill or start the process<br />
<strong>exe</strong>: name of the process executable to start or kill<br />
<strong>arg</strong>: arguments to be when launching the executable<br />
<strong>start</strong>: when to start the executable the next time<br />
<strong>stop</strong>: when to kill the process the next time<br />
<strong>interval</strong>: when a start or kill has been executed, tasker2 will create a new schedule using this interval. If the interval is &#8220;0010&#8243;, the start process will be scheduled for every 10 minutes.<br />
<strong>startOnAConly</strong>: if 1 and when a process has to be started, the process will only be started if the device is on external power</p>
<h2>The scheduler</h2>
<p>First, tasker2 is normally only launched one time manually and all future calls are made by the scheduler. Tasker2 will clear and schedule all planned tasks as defined in the registry if it is launched without arguments.</p>
<p><a href="http://www.hjgode.de/wp/2011/12/23/windows-mobile-tasker2-runs-and-stops-applications-periodically/notification-schedules/" rel="attachment wp-att-1287"><img class="alignnone size-full wp-image-1287" title="notification-schedules" src="http://www.hjgode.de/wp/wp-content/uploads/2011/12/notification-schedules.gif" alt="" width="320" height="240" /></a></p>
<p><span id="more-1286"></span>The scheduler is a task manager running all the time in windows mobile. If a timed schedule is reached, the scheduler will launch the specified application, see also <a href="http://www.hjgode.de/wp/2009/07/14/howto-run-an-application-periodically/">here</a> . This will also work if the device is in suspend mode (sleeps). The scheduler can also fire on special events like time or hardware changes (ON_RS232_CONNECT for example). See also my post <a href="http://www.hjgode.de/wp/2010/03/06/irunatevent/">here</a> [http://www.hjgode.de/wp/2010/03/06/irunatevent/].</p>
<h2>Theory of operation</h2>
<p>Tasker2 uses command line arguments to control itself. The scheduler launches tasker2 with the specified arguments and tasker2 will then run or kill the defined task.</p>
<p><a href="http://www.hjgode.de/wp/2011/12/23/windows-mobile-tasker2-runs-and-stops-applications-periodically/tasker-function/" rel="attachment wp-att-1288"><img class="alignnone size-full wp-image-1288" title="tasker-function" src="http://www.hjgode.de/wp/wp-content/uploads/2011/12/tasker-function.gif" alt="" width="800" height="502" /></a></p>
<h2>Delayed schedules (pitfall 1)</h2>
<p>If your device supports a real power down, the scheduler will not awake the device and is not able to launch the defined schedules. When the device is later powered on, it will schedule all past schedules at once. This is what we call a &#8216;delayed schedule&#8217; and a flooding of launches. Flooding in the mean of many schedules of tasker2 occurring at the same time for past tasks.<br />
To avoid concurrent changes to the registry and scheduler entries, tasker2 uses a mutex to ensure only one instance is continuing execution. Subsequent instances will wait for existing instances before they do there work.</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">//##################### dont run if already running #############################</span></div></li><li class="li1"><div class="de1">	nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Checking for Mutex (single instance allowed only)...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	hMutex<span class="sy1">=</span>CreateMutex<span class="br0">&#40;</span><span class="kw2">NULL</span>, TRUE, MY_MUTEX<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">if</span><span class="br0">&#40;</span>hMutex<span class="sy1">==</span><span class="kw2">NULL</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		<span class="co1">//this should never happen</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Error in CreateMutex! GetLastError()=%i<span class="es1">\n</span>&quot;</span>, GetLastError<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;-------- END -------<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">return</span> <span class="sy2">-</span><span class="nu0">99</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">	DWORD dwLast <span class="sy1">=</span> GetLastError<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">if</span><span class="br0">&#40;</span>dwLast<span class="sy1">==</span> ERROR_ALREADY_EXISTS<span class="br0">&#41;</span><span class="br0">&#123;</span><span class="co1">//mutex already exists, wait for mutex release</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>Attached to existing mutex<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;................ Waiting for mutex release......<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		WaitForSingleObject<span class="br0">&#40;</span> hMutex, INFINITE <span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;++++++++++++++++ Mutex released. +++++++++++++++<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>Created new mutex<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="co1">//##################### dont run if already running #############################</span></div></li></ol></pre></div></div>
<p>On a delayed, flooding schedule ALL pending tasks are scheduled and possibly a Time_Changed string is sent to the pending tasks. This flooding will be serialized as tasker2 waits for existing tasker2 instances.</p>
<h2>Time and time zone changes (pitfall 2)</h2>
<p>When the time is changed on the device, the scheduler will inform all timed tasks. Tasker2 must then recalculate new schedules based on current local time. The scheduler launches the defined applications with the TIME_CHANGED string as argument.</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span>wcsicmp<span class="br0">&#40;</span>argv<span class="br0">&#91;</span>1<span class="br0">&#93;</span>, APP_RUN_AFTER_TIME_CHANGE<span class="br0">&#41;</span><span class="sy1">==</span>0 <span class="sy3">||</span> wcsicmp<span class="br0">&#40;</span>argv<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, APP_RUN_AFTER_TZ_CHANGE<span class="br0">&#41;</span><span class="sy1">==</span><span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;got '%s' signaled<span class="es1">\n</span>&quot;</span>, argv<span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="co1">//better to reread the current time we work with, possibly we have been blocked</span></div></li><li class="li1"><div class="de1">				g_tmCurrentStartTime<span class="sy1">=</span>getLocalTime<span class="br0">&#40;</span><span class="sy3">&amp;</span>g_tmCurrentStartTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="co1">//now again check if we have a valid date</span></div></li><li class="li1"><div class="de1">				nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Checking for valid date/time...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="kw1">if</span><span class="br0">&#40;</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>g_tmCurrentStartTime.<span class="me1">tm_year</span><span class="sy2">+</span><span class="nu0">1900</span><span class="br0">&#41;</span><span class="sy2">*</span><span class="nu0">100</span> <span class="sy2">+</span> g_tmCurrentStartTime.<span class="me1">tm_mon</span><span class="sy2">+</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="sy1">&lt;</span> <span class="nu0">201111</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">					nclog<span class="br0">&#40;</span>L<span class="st0">&quot;scheduling event notifications<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="co1">//clear and renew all event notifications</span></div></li><li class="li1"><div class="de1">					<span class="co2">#ifndef TESTMODE</span></div></li><li class="li1"><div class="de1">						RunAppAtTimeChangeEvents<span class="br0">&#40;</span>szTaskerEXE<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="co2">#endif</span></div></li><li class="li1"><div class="de1">					nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Date/Time not valid!<span class="es1">\n</span>*********** END ************<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">return</span> <span class="nu12">0xBADCAB1E</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">				nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Date/Time after 11 2011. OK<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">			<span class="co1">//schedule all active tasks</span></div></li><li class="li1"><div class="de1">			<span class="kw4">int</span> iCount <span class="sy1">=</span> scheduleAllTasks<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Scheduled %i Tasks<span class="es1">\n</span>&quot;</span>, iCount<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>Additionally we found that the time changes may also occur during program launch or as tasker2 instances wait for another tasker2 instance. So tasker2 uses only one (in real two) calls to get the current time. This is essential, as tasker2 uses the current time to re-schedule tasks. The current time is called at the beginning, before tasker2 waits for the mutex. This is the time tasker2 was launched. If there has been a time_changed schedule, tasker2 will use another call to the current time, as it may have changed between the launch and the further execution of the code &#8211; after the mutex is released and the current instance is allowed to run.</p>
<h2>Delayed schedules II (pitfall 3)</h2>
<p>As only one instance of tasker2 is executing, it may happen, that the current time and the task time do not match exactly. Although the scheduler may do its best to launch tasker2 at the right time, the execution may be delayed in regards of the time the task is to be scheduled and the current time. This is another delayed schedule compared to the above flooding of schedules after a power down/up cycle.<br />
It may also happen that a lot of tasker2 instances are waiting for execution, you know that we can have up to ten tasks. This may also lead to &#8216;delayed&#8217; code execution, but should be in a small time frame of some minutes only.<br />
Therefor tasker2 supports a maximum allowed delay time to distinguish between allowed and flooding delayed calls.</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">//is this a delayed schedule?</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>checking for delayed schedule...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw4">int</span> iDeltaMinutes<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttStart<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttStop<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttCurr<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttStop <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttStart <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttCurr <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span>g_tmCurrentStartTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			<span class="co1">//difftime(timer1, timer0) returns the elapsed time in seconds, from timer0 to timer1</span></div></li><li class="li1"><div class="de1">			iDeltaMinutes <span class="sy1">=</span> <span class="kw3">difftime</span><span class="br0">&#40;</span>ttCurr, ttStop<span class="br0">&#41;</span><span class="sy2">/</span><span class="nu0">60</span><span class="sy4">;</span><span class="co1">// stDeltaMinutes(_Tasks[iTask].stStopTime, g_CurrentStartTime);</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;stStopTime = '%s', &quot;</span>, getLongStrFromTM<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			iDeltaMinutes <span class="sy1">=</span> <span class="kw3">difftime</span><span class="br0">&#40;</span>ttStart, ttCurr<span class="br0">&#41;</span><span class="sy2">/</span><span class="nu0">60</span><span class="sy4">;</span><span class="co1">// stDeltaMinutes(_Tasks[iTask].stStartTime, g_CurrentStartTime);</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;stStartTime = '%s', &quot;</span>, getLongStrFromTM<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li></ol></pre></div></div>
<h2>Adding a schedule</h2>
<p>I am using central functions in code to add or remove schedules. Here is a sample of how a schedule is added:</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#include &quot;notify.h&quot;</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co1">//--------------------------------------------------------------------</span></div></li><li class="li1"><div class="de1"><span class="co1">// Function name  : ScheduleRunApp</span></div></li><li class="li1"><div class="de1"><span class="co1">// Description    : add a schedule for exe with args at the time</span></div></li><li class="li1"><div class="de1"><span class="co1">// Argument       : LPCTSTR szExeName</span></div></li><li class="li1"><div class="de1"><span class="co1">// Argument       : LPCTSTR szArgs</span></div></li><li class="li1"><div class="de1"><span class="co1">// Argument       : struct tm tmTime</span></div></li><li class="li1"><div class="de1"><span class="co1">// Return type    : HRESULT, 0 for no error</span></div></li><li class="li1"><div class="de1"><span class="co1">//--------------------------------------------------------------------</span></div></li><li class="li1"><div class="de1">HRESULT ScheduleRunApp<span class="br0">&#40;</span>LPCTSTR szExeName, LPCTSTR szArgs, <span class="kw4">struct</span> <span class="kw4">tm</span> tmTime<span class="br0">&#41;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	HRESULT hr <span class="sy1">=</span> S_OK<span class="sy4">;</span></div></li><li class="li1"><div class="de1">	HANDLE hNotify <span class="sy1">=</span> <span class="kw2">NULL</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="co1">// set a CE_NOTIFICATION_TRIGGER</span></div></li><li class="li1"><div class="de1">	CE_NOTIFICATION_TRIGGER notifTrigger<span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="kw3">memset</span><span class="br0">&#40;</span><span class="sy3">&amp;</span>notifTrigger, 0, <span class="kw3">sizeof</span><span class="br0">&#40;</span>CE_NOTIFICATION_TRIGGER<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	notifTrigger.<span class="me1">dwSize</span> <span class="sy1">=</span> <span class="kw3">sizeof</span><span class="br0">&#40;</span>CE_NOTIFICATION_TRIGGER<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="co1">// calculate time</span></div></li><li class="li1"><div class="de1">	SYSTEMTIME st <span class="sy1">=</span> <span class="br0">&#123;</span>0<span class="br0">&#125;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="co1">//GetLocalTime(&amp;st); //v.2.28</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	st <span class="sy1">=</span> convertTM2SYSTEMTIME<span class="br0">&#40;</span><span class="sy3">&amp;</span>st, <span class="sy3">&amp;</span>tmTime<span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">//use provided new datetime</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	wsprintf<span class="br0">&#40;</span>str, L<span class="st0">&quot;Next run at: %02i.%02i.%02i %02i:%02i:%02i&quot;</span>,</div></li><li class="li1"><div class="de1">										st.<span class="me1">wDay</span>, st.<span class="me1">wMonth</span> , st.<span class="me1">wYear</span>,</div></li><li class="li1"><div class="de1">										st.<span class="me1">wHour</span> , st.<span class="me1">wMinute</span> , st.<span class="me1">wSecond</span> <span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>ScheduleRunApp: %s<span class="es1">\n</span>&quot;</span>, str<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	notifTrigger.<span class="me1">dwType</span> <span class="sy1">=</span> CNT_TIME<span class="sy4">;</span></div></li><li class="li1"><div class="de1">	notifTrigger.<span class="me1">stStartTime</span> <span class="sy1">=</span> st<span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="co1">// timer: execute an exe at specified time</span></div></li><li class="li1"><div class="de1">	notifTrigger.<span class="me1">lpszApplication</span> <span class="sy1">=</span> <span class="br0">&#40;</span>LPTSTR<span class="br0">&#41;</span>szExeName<span class="sy4">;</span></div></li><li class="li1"><div class="de1">	notifTrigger.<span class="me1">lpszArguments</span> <span class="sy1">=</span> <span class="br0">&#40;</span>LPTSTR<span class="br0">&#41;</span>szArgs<span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	hNotify <span class="sy1">=</span> CeSetUserNotificationEx<span class="br0">&#40;</span>0, <span class="sy3">&amp;</span>notifTrigger, <span class="kw2">NULL</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="co1">// NULL because we do not care the action</span></div></li><li class="li1"><div class="de1">	<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy3">!</span>hNotify<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		hr <span class="sy1">=</span> E_FAIL<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>ScheduleRunApp: CeSetUserNotificationEx FAILED...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		<span class="co1">// close the handle as we do not need to use it further</span></div></li><li class="li1"><div class="de1">		CloseHandle<span class="br0">&#40;</span>hNotify<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>ScheduleRunApp: CeSetUserNotificationEx succeeded...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">return</span> hr<span class="sy4">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<h2>The main code</h2>
<p>The main function is processStartStopCmd() beside createNextSchedule(). It does all the scheduling and time calculations.</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="coMULTI">/*	########################################################</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">		Process -s and -k comd line args</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">	########################################################</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">*/</span></div></li><li class="li1"><div class="de1"><span class="co1">//--------------------------------------------------------------------</span></div></li><li class="li1"><div class="de1"><span class="co1">// Function name  : processStartStopCmd</span></div></li><li class="li1"><div class="de1"><span class="co1">// Description    : calc new start/stop time, add schedules and start/kill application</span></div></li><li class="li1"><div class="de1"><span class="co1">// Argument       : TCHAR* argv[], the cmdLine array</span></div></li><li class="li1"><div class="de1"><span class="co1">// Return type    : int, 0 for no error</span></div></li><li class="li1"><div class="de1"><span class="co1">//--------------------------------------------------------------------</span></div></li><li class="li1"><div class="de1"><span class="kw4">int</span> processStartStopCmd<span class="br0">&#40;</span>TCHAR<span class="sy2">*</span> argv<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">	<span class="kw4">int</span> iReturn <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	BOOL bIsDelayedSchedule <span class="sy1">=</span> TRUE<span class="sy4">;</span> <span class="co1">//used to save a delayed schedule situation</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="kw2">enum</span> taskType<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		startTask <span class="sy1">=</span> 1,</div></li><li class="li1"><div class="de1">		stopTask <span class="sy1">=</span> 2</div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	taskType thisTaskType<span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="kw1">if</span><span class="br0">&#40;</span>wcsicmp<span class="br0">&#40;</span>argv<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, L<span class="st0">&quot;-k&quot;</span><span class="br0">&#41;</span><span class="sy1">==</span><span class="nu0">0</span><span class="br0">&#41;</span>	<span class="co1">//kill taskX app</span></div></li><li class="li1"><div class="de1">		thisTaskType<span class="sy1">=</span>stopTask<span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">else</span></div></li><li class="li1"><div class="de1">		thisTaskType<span class="sy1">=</span>startTask<span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">	<span class="kw4">int</span> iTask <span class="sy1">=</span> getTaskNumber<span class="br0">&#40;</span>argv<span class="br0">&#91;</span>2<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">if</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">iActive</span><span class="sy1">==</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">		<span class="co1">//create a new schedule cmd line for tasker</span></div></li><li class="li1"><div class="de1">		TCHAR strTaskCmdLine<span class="br0">&#91;</span>MAX_PATH<span class="br0">&#93;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">			wsprintf<span class="br0">&#40;</span>strTaskCmdLine, L<span class="st0">&quot;-k task%i&quot;</span>, iTask<span class="sy2">+</span>1<span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">//the cmdLine for tasker.exe for this task</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span></div></li><li class="li1"><div class="de1">			wsprintf<span class="br0">&#40;</span>strTaskCmdLine, L<span class="st0">&quot;-s task%i&quot;</span>, iTask<span class="sy2">+</span>1<span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">//the cmdLine for tasker.exe for this task	</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="co1">//clear all tasker schedules for taskX</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Clearing all schedules for Task%i with '%s'<span class="es1">\n</span>&quot;</span>, iTask<span class="sy2">+</span>1, strTaskCmdLine<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		notiClearRunApp<span class="br0">&#40;</span>szTaskerEXE, strTaskCmdLine<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw4">struct</span> <span class="kw4">tm</span> tmNewTime <span class="sy1">=</span> <span class="br0">&#123;</span>0<span class="br0">&#125;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw4">short</span> shHour	<span class="sy1">=</span>	_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stDiffTime</span>.<span class="me1">tm_hour</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw4">short</span> shMin		<span class="sy1">=</span>	_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stDiffTime</span>.<span class="me1">tm_min</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw4">short</span> shDays	<span class="sy1">=</span>	<span class="nu0">0</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>shHour<span class="sy1">&gt;=</span><span class="nu0">24</span><span class="br0">&#41;</span><span class="br0">&#123;</span>	<span class="co1">//hour interval value is one day or more</span></div></li><li class="li1"><div class="de1">			shDays <span class="sy1">=</span> <span class="br0">&#40;</span><span class="kw4">short</span><span class="br0">&#41;</span> <span class="br0">&#40;</span>shHour <span class="sy2">/</span> 24<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			shHour <span class="sy1">=</span> <span class="br0">&#40;</span><span class="kw4">short</span><span class="br0">&#41;</span> <span class="br0">&#40;</span>shHour <span class="sy2">%</span> 24<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span>				</div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="co1">//is this a delayed schedule?</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>checking for delayed schedule...<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw4">int</span> iDeltaMinutes<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttStart<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttStop<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		__time64_t ttCurr<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttStop <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttStart <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		ttCurr <span class="sy1">=</span> _mktime64<span class="br0">&#40;</span><span class="sy3">&amp;</span>g_tmCurrentStartTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			<span class="co1">//difftime(timer1, timer0) returns the elapsed time in seconds, from timer0 to timer1</span></div></li><li class="li1"><div class="de1">			iDeltaMinutes <span class="sy1">=</span> <span class="kw3">difftime</span><span class="br0">&#40;</span>ttCurr, ttStop<span class="br0">&#41;</span><span class="sy2">/</span><span class="nu0">60</span><span class="sy4">;</span><span class="co1">// stDeltaMinutes(_Tasks[iTask].stStopTime, g_CurrentStartTime);</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;stStopTime = '%s', &quot;</span>, getLongStrFromTM<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			iDeltaMinutes <span class="sy1">=</span> <span class="kw3">difftime</span><span class="br0">&#40;</span>ttStart, ttCurr<span class="br0">&#41;</span><span class="sy2">/</span><span class="nu0">60</span><span class="sy4">;</span><span class="co1">// stDeltaMinutes(_Tasks[iTask].stStartTime, g_CurrentStartTime);</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;stStartTime = '%s', &quot;</span>, getLongStrFromTM<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;current time = '%s'<span class="es1">\n</span>&quot;</span>, getLongStrFromTM<span class="br0">&#40;</span>g_tmCurrentStartTime<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;interval is: %id%02ih%02im<span class="es1">\n</span>&quot;</span>, shDays, shHour, shMin<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>delta is %i minutes<span class="es1">\n</span>&quot;</span>, iDeltaMinutes<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="co1">//started BEFORE scheduled time, iDelta is negative</span></div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>iDeltaMinutes<span class="sy1">&lt;</span>0<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				<span class="co1">//calculate new schedules or leave them as is?</span></div></li><li class="li1"><div class="de1">				<span class="co1">//tmNewTime=_Tasks[iTask].stStopTime;	//leave them as is</span></div></li><li class="li1"><div class="de1">				tmNewTime<span class="sy1">=</span>createNextSchedule<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span>, shDays,shHour,shMin<span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">//calc new schedule</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				<span class="co1">//tmNewTime=_Tasks[iTask].stStartTime;	//leave them as is</span></div></li><li class="li1"><div class="de1">				tmNewTime<span class="sy1">=</span>createNextSchedule<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span>, shDays,shHour,shMin<span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">//calc new schedule</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="co2">#ifndef TESTMODE</span></div></li><li class="li1"><div class="de1">			ScheduleRunApp<span class="br0">&#40;</span>szTaskerEXE, strTaskCmdLine, tmNewTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1"><span class="co2">#endif</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;*** re-scheduled future task *** <span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">return</span> <span class="nu0">0</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw4">int</span> iMaxDelay <span class="sy1">=</span> getMaxDelay<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>max allowed diff for delayed schedule recognition is plus %i<span class="es1">\n</span>&quot;</span>, iMaxDelay<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span> iDeltaMinutes <span class="sy1">&gt;</span> iMaxDelay <span class="br0">&#41;</span> <span class="co1">//is the time diff greater than 1 minute</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			bIsDelayedSchedule <span class="sy1">=</span> TRUE<span class="sy4">;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;*** delayed schedule *** recognized<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="co1">//this is a delayed schedule</span></div></li><li class="li1"><div class="de1">			DOUBLE dbTimeDiff <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">			<span class="co1">//it may happen that the schedule is far in the future</span></div></li><li class="li1"><div class="de1">			<span class="co1">//we calc the next schedule on base of the current time by using the saved start/stop time</span></div></li><li class="li1"><div class="de1">			<span class="co1">//is just greater than the current time</span></div></li><li class="li1"><div class="de1">			<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">				tmNewTime<span class="sy1">=</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">else</span></div></li><li class="li1"><div class="de1">				tmNewTime<span class="sy1">=</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">			tmNewTime <span class="sy1">=</span> createNextSchedule<span class="br0">&#40;</span>tmNewTime, shDays, shHour, shMin<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;*** NO delayed schedule *** recognized<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				tmNewTime <span class="sy1">=</span> createNextSchedule<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStopTime</span>, shDays, shHour, shMin<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				tmNewTime <span class="sy1">=</span> createNextSchedule<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">stStartTime</span>, shDays, shHour, shMin<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			bIsDelayedSchedule<span class="sy1">=</span>FALSE<span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="co1">//create a new kill or start schedule with new time</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Creating new schedule for '%s' in Task%i<span class="es1">\n</span>&quot;</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span>, iTask<span class="sy2">+</span>1<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1"><span class="co2">#ifndef TESTMODE</span></div></li><li class="li1"><div class="de1">		ScheduleRunApp<span class="br0">&#40;</span>szTaskerEXE, strTaskCmdLine, tmNewTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1"><span class="co2">#endif</span></div></li><li class="li1"><div class="de1">		<span class="co1">//save new changed stop/start ime</span></div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>stopTask<span class="br0">&#41;</span></div></li><li class="li1"><div class="de1">			regSetStopTime<span class="br0">&#40;</span>iTask, tmNewTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span></div></li><li class="li1"><div class="de1">			regSetStartTime<span class="br0">&#40;</span>iTask, tmNewTime<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">if</span><span class="br0">&#40;</span><span class="sy3">!</span>bIsDelayedSchedule<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Not a delayed schedule<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">if</span><span class="br0">&#40;</span>thisTaskType<span class="sy1">==</span>startTask<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">				<span class="kw1">if</span><span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">bStartOnAConly</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">if</span><span class="br0">&#40;</span>isACpowered<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">						nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Starting exe '%s' as on AC power<span class="es1">\n</span>&quot;</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">						runExe<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szArgs</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">						nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Skipping start of exe '%s' as not on AC power<span class="es1">\n</span>&quot;</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">				<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">				<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">					nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Starting exe '%s'<span class="es1">\n</span>&quot;</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					runExe<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szArgs</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			<span class="kw1">else</span><span class="br0">&#123;</span> <span class="co1">// a stop task</span></div></li><li class="li1"><div class="de1">				<span class="co1">//now kill the task's exe</span></div></li><li class="li1"><div class="de1">				nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Killing exe '%s'<span class="es1">\n</span>&quot;</span>, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				DWORD iKillRes <span class="sy1">=</span> killExe<span class="br0">&#40;</span>_Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">szExeName</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="kw1">switch</span> <span class="br0">&#40;</span>iKillRes<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">case</span> ERROR_NOT_FOUND<span class="sy4">:</span></div></li><li class="li1"><div class="de1">						nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>exe not running<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">						<span class="kw1">break</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">case</span> <span class="nu0">0</span><span class="sy4">:</span></div></li><li class="li1"><div class="de1">						nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>exe killed<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">						<span class="kw1">break</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">					<span class="kw1">default</span><span class="sy4">:</span></div></li><li class="li1"><div class="de1">						nclog<span class="br0">&#40;</span>L<span class="st0">&quot;unable to kill exe. GetLastError=%08x<span class="es1">\n</span>&quot;</span>, iKillRes<span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">						<span class="kw1">break</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">				<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">			<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">		<span class="kw1">else</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">			nclog<span class="br0">&#40;</span>L<span class="st0">&quot;Exec/Kill skipped as this is a delayed schedule<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">		<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">	<span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">	<span class="kw1">else</span></div></li><li class="li1"><div class="de1">		nclog<span class="br0">&#40;</span>L<span class="st0">&quot;<span class="es1">\t</span>task %i is inactive (0x%02x)<span class="es1">\n</span>&quot;</span>, iTask, _Tasks<span class="br0">&#91;</span>iTask<span class="br0">&#93;</span>.<span class="me1">iActive</span><span class="br0">&#41;</span><span class="sy4">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">		<span class="kw1">return</span> iReturn<span class="sy4">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<h2> Tasker2 control</h2>
<p>Although you normally dont need to run tasker2 manually, I have added some command line arguments:</p>
<p>&#8220;-c&#8221;    instructs tasker2.exe to remove all tasker2 schedules of the scheduler database<br />
&#8220;-r taskX&#8221;    deactivate processing of task with number X, sets the active flag to 0<br />
&#8220;-a taskX&#8221;    activate processing of task number X, sets the active flag to 1<br />
&#8220;-d&#8221;    dump a list of all active notifications of the windows mobile scheduler</p>
<p>Do not use -s taskX and -k taskX except for testing. The args &#8216;-s taskX&#8217; and &#8216;-k taskX&#8217; are only be used by the scheduler.</p>
<h2>Log file</h2>
<p>The log file will log all activities of tasker2 in the directory of tasker2.exe. It will grow until 1MB and then one log backup file is saved. So you may have two log files, one active and one backup of the previous log.</p>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="dos" style="font-family:monospace;"><ol><li class="li1"><div class="de1">0xfacbcab2: ++++++++++++++++ Tasker v300 started +++++++++++++++++++</div></li><li class="li1"><div class="de1">0xfacbcab2: Checking <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> Mutex <span class="br0">&#40;</span>single instance allowed only<span class="br0">&#41;</span>...</div></li><li class="li1"><div class="de1">0xfacbcab2: 	Created new mutex</div></li><li class="li1"><div class="de1">0xfacbcab2: ~~~ using actual localtime:</div></li><li class="li1"><div class="de1">0xfacbcab2: 	 23.12.2011, 12:28</div></li><li class="li1"><div class="de1">0xfacbcab2: CmdLine =</div></li><li class="li1"><div class="de1">0xfacbcab2: Checking <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> valid date/time...</div></li><li class="li1"><div class="de1">0xfacbcab2: Date/Time after 11 2011. OK</div></li><li class="li1"><div class="de1">0xfacbcab2: Clearing Event Notifications...0xfacbcab2: OK</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: ...</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3d00000f</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x33000025</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3800002a</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3b00001b</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3800002e</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3f00001e</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x37000016</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: CeClearUserNotification <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> handle: 0x3a000030</div></li><li class="li1"><div class="de1">0xfacbcab2: ClearRunApp<span class="br0">&#40;</span><span class="br0">&#41;</span>: returns 8</div></li><li class="li1"><div class="de1">0xfacbcab2: Cleared 8 Tasker schedules</div></li><li class="li1"><div class="de1">0xfacbcab2: scheduleAllTasks: ClearAllSchedules <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> 8 tasks</div></li><li class="li1"><div class="de1">0xfacbcab2: Clearing Event Notifications...0xfacbcab2: Clearing Event Notifications...0xfacbcab2: OK</div></li><li class="li1"><div class="de1">0xfacbcab2: Adding Time_Change Event Notification...0xfacbcab2: OK</div></li><li class="li1"><div class="de1">0xfacbcab2: Adding TZ_Change Event Notification...0xfacbcab2: OK</div></li><li class="li1"><div class="de1">0xfacbcab2: Creating new Start Task schedule <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> '\Windows\notes.exe' <a href="http://www.ss64.com/nt/in.html"><span class="kw1">in</span></a> Task1</div></li><li class="li1"><div class="de1">0xfacbcab2: 	calculating new schedule <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> '201112231300'...</div></li><li class="li1"><div class="de1">0xfacbcab2: 	interval is: 0d01h00m</div></li><li class="li1"><div class="de1">0xfacbcab2: 	schedule adjusted to '201112231300'</div></li><li class="li1"><div class="de1">0xfacbcab2: 	ScheduleRunApp: Next run at: 23.12.2011 13:00:56</div></li><li class="li1"><div class="de1">0xfacbcab2: 	ScheduleRunApp: CeSetUserNotificationEx succeeded...</div></li><li class="li1"><div class="de1">0xfacbcab2: Creating new Kill Task schedule <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> '\Windows\notes.exe' <a href="http://www.ss64.com/nt/in.html"><span class="kw1">in</span></a> Task1</div></li><li class="li1"><div class="de1">0xfacbcab2: 	calculating new schedule <a href="http://www.ss64.com/nt/for.html"><span class="kw1">for</span></a> '<span class="nu0">201112231300</span>'...</div></li><li class="li1"><div class="de1">0xfacbcab2: 	interval is: 0d01h00m</div></li><li class="li1"><div class="de1">0xfacbcab2: 	schedule adjusted to '<span class="nu0">201112231300</span>'</div></li><li class="li1"><div class="de1">0xfacbcab2: 	ScheduleRunApp: Next run at: 23.12.2011 <span class="nu0">13</span>:00:<span class="nu0">56</span></div></li><li class="li1"><div class="de1">0xfacbcab2: 	ScheduleRunApp: CeSetUserNotificationEx succeeded...</div></li><li class="li1"><div class="de1">...</div></li></ol></pre></div></div>
<p>The first entry in the log file is the current logging instance. As multiple instances may write randomly at the log, the instance number is needed to idetify which instance has written the current log line.</p>
<h2>Changes</h2>
<p>There are two variants of tasker2, one is using SYSTEMTIME and the other, new one uses time_t. I switched to time_t as it is more easy to do operations like add-one-day with time_t vars than with SYSTEMTIME.</p>
<p>The old variant (v234a) is available as a branch in the code repository: http://code.google.com/p/tasker2/source/browse/#svn%2Fbranch%2Fversion232%2FTasker</p>
<h2>Tests</h2>
<p>Fortunately I had great help by a tester of the software. Many thanks to Thomas B.</p>
<p>I built my only automatic test suite using batch files and a special build of tasker2.exe. If you uncomment the line //#define TESTMODE at the beginning of tasker2.cpp, the compiled app will be in test mode. That means it will not add or remove schedules to/from the windows mobile scheduler. There is another tool used in the test_run.bat that sets the date and time of the device remotely (ActiveSync or Windows Mobile Device Center connection).</p>
<p>The automatic test uses the great tools of itsutils and will set registry values, change date/time, launch tasker2, get the log and build a merged log with all essential data to check the function of tasker2:</p>
<p>http://code.google.com/p/tasker2/source/browse/#svn%2Ftrunk%2FTasker%2Ftest</p>
<p>Here is a snippet from the test_bat.bat:</p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="sy0">@</span><span class="kw1">echo</span> off</div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="co2">############## START ###############</span></div></li><li class="li1"><div class="de1"><span class="kw1">echo</span>  MAKE SHURE THE RADIOS ARE OFF TO</div></li><li class="li1"><div class="de1"><span class="kw1">echo</span>  AVOID AUTOMATIC <a href="http://www.php.net/time"><span class="kw3">TIME</span></a> SYNCS<span class="sy0">!</span></div></li><li class="li1"><div class="de1"><span class="kw1">echo</span> <span class="sy0">.</span></div></li><li class="li1"><div class="de1">PAUSE Press any <a href="http://www.php.net/key"><span class="kw3">key</span></a> to start</div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="co2">############## START ############### &gt;test_run.txt</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw1">echo</span> Importing test reg keys<span class="sy0">...</span></div></li><li class="li1"><div class="de1"><span class="kw1">echo</span> Importing test reg keys<span class="sy0">...</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">pregutl <span class="sy0">@</span>tasker2<span class="sy0">.</span>reg <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">pdel \tasker2<span class="sy0">.</span>exe<span class="sy0">.</span><a href="http://www.php.net/log"><span class="kw3">log</span></a><span class="sy0">.</span>txt <span class="sy0">&gt;</span>NUL</div></li><li class="li1"><div class="de1">pput <span class="sy0">-</span>f <span class="sy0">./</span>tasker2<span class="sy0">.</span>exe \tasker2<span class="sy0">.</span>exe</div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> TEST1<span class="sy0">...</span></div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> 	set <a href="http://www.php.net/time"><span class="kw3">time</span></a> manually to 01<span class="sy0">.</span>01<span class="sy0">.</span>2003 12<span class="sy0">:</span>00</div></li><li class="li1"><div class="de1"><span class="kw1">echo</span> 	run tasker2<span class="sy0">.</span>exe</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">++++++++++++++</span> TEST1 <span class="sy0">++++++++++++++++</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">pregutl HKLM\Software\Tasker  <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">-------------------------------------</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> set <a href="http://www.php.net/time"><span class="kw3">time</span></a> manually to 01<span class="sy0">.</span>01<span class="sy0">.</span>2003 12<span class="sy0">:</span>00 <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">-------------------------------------</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">prun \SetDateTime<span class="sy0">.</span>exe 200301011200</div></li><li class="li1"><div class="de1">CALL <span class="sy0">:</span>MYWAIT</div></li><li class="li1"><div class="de1">prun \tasker2<span class="sy0">.</span>exe</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="st0">&quot;############# Result:&quot;</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">pregutl HKLM\Software\Tasker <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">***************</span> <a href="http://www.php.net/log"><span class="kw3">LOG</span></a>  <span class="sy0">****************</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">pget <span class="sy0">-</span>f \tasker2<span class="sy0">.</span>exe<span class="sy0">.</span><a href="http://www.php.net/log"><span class="kw3">log</span></a><span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">type tasker2<span class="sy0">.</span>exe<span class="sy0">.</span><a href="http://www.php.net/log"><span class="kw3">log</span></a><span class="sy0">.</span>txt <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1">pdel \tasker2<span class="sy0">.</span>exe<span class="sy0">.</span><a href="http://www.php.net/log"><span class="kw3">log</span></a><span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">---------------</span>TEST1  <span class="sy0">---------------</span> <span class="sy0">&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li><li class="li1"><div class="de1"><span class="kw1">ECHO</span> <span class="sy0">.&gt;&gt;</span>test_run<span class="sy0">.</span>txt</div></li></ol></pre></div></div>
<h2>Downloads</h2>
<p>The full tasker2 source code is available at http://code.google.com/p/tasker2/source/browse</p>
<p>Tool to look at the scheduler database [NotificationList]: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=149" title="Downloaded 23 times">NotificationList</a> - A tool to list notifications (Hits: 23, size: 153.42 kB)</p>
<p>&nbsp;</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F&amp;title=Windows+Mobile+%26%238211%3B+tasker2+runs+and+stops+applications+periodically" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F&amp;title=Windows+Mobile+%26%238211%3B+tasker2+runs+and+stops+applications+periodically" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F&amp;title=Windows+Mobile+%26%238211%3B+tasker2+runs+and+stops+applications+periodically" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F&amp;T=Windows+Mobile+%26%238211%3B+tasker2+runs+and+stops+applications+periodically" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F23%2Fwindows-mobile-tasker2-runs-and-stops-applications-periodically%2F&amp;t=Windows+Mobile+%26%238211%3B+tasker2+runs+and+stops+applications+periodically" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/12/23/windows-mobile-tasker2-runs-and-stops-applications-periodically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Mobile &#8211; the no-go world of Function Keys</title>
		<link>http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-mobile-the-no-go-world-of-function-keys</link>
		<comments>http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 09:07:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Mobile Information]]></category>
		<category><![CDATA[AllKeys]]></category>
		<category><![CDATA[Function Key]]></category>
		<category><![CDATA[Internet Explorer Mobile]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[UnregisterFunc1]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1274</guid>
		<description><![CDATA[Hello I want to summarize the role of function keys in Windows Mobile, former Pocket PC, as I got several questions each week on how to use or enable Function keys in this or that application. Here is a simple information about how function keys work in Windows Mobile. As example you have a web [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p><span style="background-color: #c0c0c0;">I want to summarize the role of <span style="color: #ff0000;"><strong>function keys in Windows Mobile</strong></span>, former Pocket PC, as I got several questions each week on how to use or enable Function keys in this or that application.</span></p>
<p><span style="background-color: #c0c0c0;">Here is a simple information about <span style="color: #ff0000;">how function keys work in Windows Mobile</span>.</span></p>
<p><span id="more-1274"></span>As example you have a web application which shows F3 and F4 as shortcuts to previous/next page:</p>
<div id="attachment_1275" class="wp-caption alignnone" style="width: 250px"><a href="http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/test_not_ok-htm-in_ib_pie/" rel="attachment wp-att-1275"><img class="size-full wp-image-1275" title="SAP ITS Mobile screen Intermec Browser" src="http://www.hjgode.de/wp/wp-content/uploads/2011/12/test_not_ok.htm.in_IB_PIE.gif" alt="SAP ITS Mobile screen Intermec Browser" width="240" height="320" /></a><p class="wp-caption-text">SAP ITS Mobile screen Intermec Browser</p></div>
<p>Without some prepare this screen will not react on function keys! As the screen shows Intermec Browser (IB) with a SAP ITS Mobile form, you are able to define settings in IB to be able to really use the Function Keys.</p>
<p>Windows Mobile uses Function Key values for its own purpose. The usage can be retrieved by looking at winuserm.h of a Windows Mobile SDK:</p>
<div id="wpshdo_11" class="wp-synhighlighter-outer"><div id="wpshdt_11" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_11"></a><a id="wpshat_11" class="wp-synhighlighter-title" href="#codesyntax_11"  onClick="javascript:wpsh_toggleBlock(11)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_11" onClick="javascript:wpsh_code(11)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_11" onClick="javascript:wpsh_print(11)" title="Print code"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.hjgode.de/wp/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_11" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">//winuserm.h</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TSOFT1   VK_F1               // Softkey 1</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TSOFT2   VK_F2               // Softkey 2</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TTALK    VK_F3               // Talk</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TEND     VK_F4               // End</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TRECORD      VK_F10          // Record</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TFLIP        VK_F17          // Flip</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TPOWER       VK_F18          // Power</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TVOLUMEUP    VK_F6           // Volume Up</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TVOLUMEDOWN  VK_F7           // Volume Down</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TSPEAKERPHONE_TOGGLE VK_F16</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_END_ALL_DATA_CALLS   VK_F15</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TSTAR    VK_F8               // *</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_TPOUND   VK_F9               // #</span></div></li><li class="li1"><div class="de1">...</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_SYMBOL   VK_F11              // Symbol (SYM) key</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_REDKEY   VK_F19              // Sent by a keypad that has a special red function key</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_ROCKER   VK_F20              // Arrow keys came from a Rocker</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_DPAD     VK_F21              // Arrow keys came from a DPAD</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_ACTION   VK_F23              // Sent with VK_RETURN when doing Action on PPC rockers</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_VOICEDIAL  VK_F24            // Key used to kick off voice dial recognition</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_KEYLOCK    VK_F22            // Key used to lock the device</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_KEYUNLOCK  VK_F25             // Key used to unlock the key lock</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Chorded keys.  DONE is VK_RWIN + VK_F6 and MOJI is VK_RWIN + VK_F7</span></div></li><li class="li1"><div class="de1"><span class="co2">#define VK_DONE     VK_F6                 // &lt;OK/Close&gt; hotkey code</span></div></li><li class="li1"><div class="de1"><span class="co2">#define MOD_DONE    (MOD_WIN | MOD_KEYUP) // &lt;OK/Close&gt; hotkey modifiers</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co2">#define VK_MOJI     VK_F7                  // Key used to switch between FE language layouts</span></div></li><li class="li1"><div class="de1"><span class="co2">#define MOD_MOJI    (MOD_WIN | MOD_KEYUP)  //Modifiers so MOJI goes to the shell</span></div></li><li class="li1"><div class="de1">...</div></li></ol></pre></div></div>
<p>You see that many FunctionKey values are assigned to OS specific functions like Phone, END, Volume Up/Down etc.</p>
<p>So, you can normally not use Function Keys in your application to provide shortcuts to function calls. This is also true for client applications like Terminal Emulators (TE) like NaurTechTE and Intermec TE (ITE), browser based applications like Internet Explorer Mobile or Intermec Kiosk Mode Browser (IB), thin clients like Java client apps (ie. SAP ITS Mobile) or Remote Desktop client apps (ie Remote Desktop Mobile, zaDesktop).</p>
<p>Some of the kiosk mode apps provide a way to enable you to use Function Keys (see example at top). They can do so, as they use API calls like UnregisterFunc1 or AllKeys(TRUE) or GXOpenInput (deprecated!). These APIs instruct Windows Mobile OS to NOT catch and use Function Keys but handle them like &#8216;normal&#8217; keys.</p>
<p>If you are the coder of an application using CPP, CSharp (C#), VB.NET, CPP or JAVA, you can use the Microsoft API function AllKeys(TRUE) in your code and Windows Mobile will not tamper the function keys.</p>
<p>If you are not the coder you may use UnregisterFunc1 (see my post &#8220;<a title="Free up your function keys" href="http://www.hjgode.de/wp/2010/02/10/use-funckey-to-free-up-your-functionkeys-on-windows-mobile/">Freedom for Function Keys</a>&#8220;). But be warned, there are applications that even then will not process Function Keys or do not forward them. For example Internet Explorer Mobile (IEM) will NOT process Function Keys except for internal functions like help or full-screen. Another bad example is Remote Desktop Mobile (RDM). It does not support Function Keys, even if you un-register them before you launch RDM, Function Keys will NOT be processed or transmitted to the host application. An alternative to RDM with function key support is <a href="http://www.hjgode.de/wp/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/">rdesktopCE</a>.</p>
<p>When you use UnregisterFunc1, you can check the Function Keys using a tool like <a title="Keytest3AK" href="http://www.hjgode.de/wp/2009/05/11/keytest3ak-a-tool-to-look-at-keyboard-codes/">KeyTest3AK</a>. It will show the keydown and keyup values of keys and shows what happens if you use AllKeys():</p>
<p><a href="http://www.hjgode.de/wp/2009/05/11/keytest3ak-a-tool-to-look-at-keyboard-codes/screenshot_keytest3ak/" rel="attachment wp-att-615"><img class="alignnone size-full wp-image-615" title="screenshot_keytest3ak" src="http://www.hjgode.de/wp/wp-content/uploads/2009/05/screenshot_keytest3ak.gif" alt="" width="240" height="320" /></a></p>
<p><a href="http://www.hjgode.de/wp/?s=allkeys">More posts about AllKeys</a></p>
<p>&nbsp;</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F&amp;title=Windows+Mobile+%26%238211%3B+the+no-go+world+of+Function+Keys" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F&amp;title=Windows+Mobile+%26%238211%3B+the+no-go+world+of+Function+Keys" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F&amp;title=Windows+Mobile+%26%238211%3B+the+no-go+world+of+Function+Keys" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F&amp;T=Windows+Mobile+%26%238211%3B+the+no-go+world+of+Function+Keys" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F12%2F20%2Fwindows-mobile-the-no-go-world-of-function-keys%2F&amp;t=Windows+Mobile+%26%238211%3B+the+no-go+world+of+Function+Keys" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KeyToggleStart: Yet another usage for keyboard hook</title>
		<link>http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=keytogglestart-yet-another-usage-for-keyboard-hook</link>
		<comments>http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 10:56:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[function keys]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1204</guid>
		<description><![CDATA[Hello Windows Mobile Users recently the following was requested: How can I start an application by just hitting some keys in sequence? The answer: Just use a keyboard hook. So I started to code this hook tool based on my KeyToggleBoot2 code. There was not too much to change. The new tool is called KeyToggleStart [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Windows Mobile Users</p>
<p>recently the following was requested:</p>
<p>How can I start an application by just hitting some keys in sequence?</p>
<p>The answer: Just use a keyboard hook.</p>
<p>So I started to code this hook tool based on my KeyToggleBoot2 code. There was not too much to change. The new tool is called KeyToggleStart and it is configured by the registry:</p>
<pre>            REGEDIT4

            [HKEY_LOCAL_MACHINE\Software\Intermec\KeyToggleStart]
            "ForbiddenKeys"=hex:\
                  72 73 00
            ;max 10 keys!
            "KeySeq"="123"
            "Timeout"=dword:00000003
            "LEDid"=dword:00000001
            "Exe"="\\Windows\\iexplore.exe"
            "Arg"=""</pre>
<h2>Reg keys meaning:</h2>
<p><strong>Forbiddenkeys</strong> is just an addon feature: key codes entered in this list will not be processed any more by your Windows Mobile device. For example, to disable the use of the F3(VK_TTALK) and F4 (VK_TEND) keys you have to enter a binary list of 0&#215;72,0&#215;73,0&#215;00 (the zero is needed to terminate the list).</p>
<p><strong>KeySeq</strong> list the char sequence you want to use to start an application. For example if this is the string &#8220;123&#8243;, everytime you enter 123 in sequence within the given time, the application defined will be started.</p>
<p><strong>TimeOut</strong> is the time in seconds you have to enter the sequence. So do not use a long key sequence as &#8220;starteiexplorenow&#8221; and a short timeout (except you are a very fast type writer). The timeout is started with the first char matching and ends after the time or when you enter a non-matching char of the sequence.</p>
<p>With <strong>LEDid</strong> you can specify a LED index number. LED&#8217;s on Windows Mobile are controlled by an index number, each LED has one or more ID assigned to it. So, with LEDid you can control, which LED will lit, when the matching process is running. You can even find an ID to control a vibration motor, if your Windows Mobile device is equipped with one.</p>
<p>The <strong>Exe</strong> registry string value is used to specify which application will be started when the key sequence is matched.</p>
<p>If the application you want have to be started needs some arguments, you can enter these using the <strong>Arg</strong> registry value.</p>
<p>When you start the KeyToggleStart tool, you will not see any window except for a notification symbol on your Start/Home screen of the device.</p>
<p><a href="http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/keytogglestart/" rel="attachment wp-att-1205"><img class="alignnone size-medium wp-image-1205" title="KeyToggleStart" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/KeyToggleStart-225x300.png" alt="" width="225" height="300" /></a></p>
<p>If you tap this icon (redirection sign) you have the chance to end the hook tool.</p>
<p><span id="more-1204"></span>The code itself is nothing special. Only the sequence matching code is a little bit special. As the chars in the sequence do not match keystrokes in a ont-to-one manner, I have to check the shift state of the keyboard and if the current char of the seqeunce is a char needing a shift. For example: the asterisk char (&#8220;*&#8221;) is a combination of the &#8220;8&#8243; key plus the Shift key. So, if you have the &#8220;*&#8221; in the char sequence, the code has to check for the &#8220;8&#8243; key and if the keyboard is in shift state:</p>
<pre lang="cpp">// The command below tells the OS that this EXE has an export function so we can use the global hook without a DLL
__declspec(dllexport) LRESULT CALLBACK g_LLKeyboardHookCallback(
   int nCode,      // The hook code
   WPARAM wParam,  // The window message (WM_KEYUP, WM_KEYDOWN, etc.)
   LPARAM lParam   // A pointer to a struct with information about the pressed key
)
{
    /*    typedef struct {
        DWORD vkCode;
        DWORD scanCode;
        DWORD flags;
        DWORD time;
        ULONG_PTR dwExtraInfo;
    } KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;*/

    // Get out of hooks ASAP; no modal dialogs or CPU-intensive processes!
    // UI code really should be elsewhere, but this is just a test/prototype app
    // In my limited testing, HC_ACTION is the only value nCode is ever set to in CE
    static int iActOn = HC_ACTION;
    static bool isShifted=false;

#ifdef DEBUG
    static TCHAR str[MAX_PATH];
#endif

    PKBDLLHOOKSTRUCT pkbhData = (PKBDLLHOOKSTRUCT)lParam;
    //DWORD vKey;
    if (nCode == iActOn)
    {
        //only process unflagged keys
        if (pkbhData-&gt;flags != 0x00)
            return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
        //check vkCode against forbidden key list
        if(pForbiddenKeyList!=NULL)
        {
            BOOL bForbidden=false;
            int j=0;
            do{
                if(pForbiddenKeyList[j]==(BYTE)pkbhData-&gt;vkCode)
                {
                    bForbidden=true;
                    DEBUGMSG(1, (L"suppressing forbidden key: 0x%0x\n",pkbhData-&gt;vkCode));
                    continue;
                }
                j++;
            }while(!bForbidden &amp;&amp; pForbiddenKeyList[j]!=0x00);
            if(bForbidden){
                return true;
            }
        }

        SHORT sShifted = GetAsyncKeyState(VK_SHIFT);
        if((sShifted &amp; 0x800) == 0x800)
            isShifted = true;
        else
            isShifted = false;

        //check and toggle for Shft Key
        //do not process shift key
        if (pkbhData-&gt;vkCode == VK_SHIFT){
            DEBUGMSG(1, (L"Ignoring VK_SHIFT\n"));
            return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
        }

        //################################################################
        //check if the actual key is a match key including the shift state
        if ((byte)pkbhData-&gt;vkCode == (byte)szVKeySeq[iMatched]){
            DEBUGMSG(1 , (L"==== char match\n"));
            if (bCharShiftSeq[iMatched] == isShifted){
                DEBUGMSG(1 , (L"==== shift match\n"));
            }
            else{
                DEBUGMSG(1 , (L"==== shift not match\n"));
            }
        }

        if( wParam == WM_KEYUP ){
            DEBUGMSG(1, (L"---&gt; szVKeySeq[iMatched] = 0x%02x\n", (byte)szVKeySeq[iMatched]));

            if ( ((byte)pkbhData-&gt;vkCode == (byte)szVKeySeq[iMatched]) &amp;&amp; (isShifted == bCharShiftSeq[iMatched]) ) {

                //the first match?
                if(iMatched==0){
                    //start the timer and lit the LED
                    LedOn(LEDid,1);
                    tID=SetTimer(NULL, 0, matchTimeout, (TIMERPROC)Timer2Proc);
                }
                iMatched++;

                DEBUGMSG(1, (L"iMatched is now=%i\n", iMatched));
                //are all keys matched
                if (iMatched == iKeyCount){
                    //show modeless dialog
                    DEBUGMSG(1, (L"FULL MATCH, starting ...\n"));
                    PostMessage(g_hWnd, WM_SHOWMYDIALOG, 0, 0);
                    //reset match pos and stop timer
                    DEBUGMSG(1, (L"FULL MATCH: Reset matching\n"));
                    LedOn(LEDid,0);
                    iMatched=0; //reset match pos
                    KillTimer(NULL, tID);
                    //return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
                }
                //return -1; //do not forward key?
            }
            else
            {
                KillTimer(NULL, tID);
                LedOn(LEDid,0);
                iMatched=0; //reset match pos
                DEBUGMSG(1, (L"FULL MATCH missed. Reseting matching\n"));
            }
        } //if wParam == WM_KEY..
    }
    return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
}</pre>
<p>Enjoy the code</p>
<p>Download VS2008 Source code for Windows Mobile 6.5.3 SDK<br />
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=143" title="Downloaded 92 times">KeyToggleStart</a> -  (Hits: 92, size: 30.06 kB)</p>
<p>Download KeyToggleStart executable (Windows Mobile 6)<br />
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=144" title="Downloaded 78 times">KeyToggleStart WM6 Executable</a> -  (Hits: 78, size: 12.38 kB)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F&amp;title=KeyToggleStart%3A+Yet+another+usage+for+keyboard+hook" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F&amp;title=KeyToggleStart%3A+Yet+another+usage+for+keyboard+hook" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F&amp;title=KeyToggleStart%3A+Yet+another+usage+for+keyboard+hook" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F&amp;T=KeyToggleStart%3A+Yet+another+usage+for+keyboard+hook" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F09%2F08%2Fkeytogglestart-yet-another-usage-for-keyboard-hook%2F&amp;t=KeyToggleStart%3A+Yet+another+usage+for+keyboard+hook" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WM 6.5: Remote Desktop Client disconnects after 10 minutes</title>
		<link>http://www.hjgode.de/wp/2011/07/04/wm-6-5-remote-desktop-client-disconnects-after-10-minutes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wm-6-5-remote-desktop-client-disconnects-after-10-minutes</link>
		<comments>http://www.hjgode.de/wp/2011/07/04/wm-6-5-remote-desktop-client-disconnects-after-10-minutes/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 12:15:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[10 minutes]]></category>
		<category><![CDATA[disconnect]]></category>
		<category><![CDATA[idle time]]></category>
		<category><![CDATA[RDM]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[windows embedded handheld]]></category>
		<category><![CDATA[windows mobile]]></category>
		<category><![CDATA[wpctsc.exe]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1157</guid>
		<description><![CDATA[Hi as MS does not change it, the Remote Desktop Mobile application still disconnects a session after 10 minutes idle time. Although there is a solution for Windows Mobile 6.1 (http://www.hjgode.de/wp/2009/09/18/wm6-1-remote-desktop-client-disconnects-after-10-minutes/) based on the posting of Rafael (MS Support), this will not work with Windows Embedded Handheld (WM6.5). The TSSHELLWND will not react on mouse_event [...]]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>as MS does not change it, the Remote Desktop Mobile application still disconnects a session after 10 minutes idle time.</p>
<p>Although there is a solution for Windows Mobile 6.1 (http://www.hjgode.de/wp/2009/09/18/wm6-1-remote-desktop-client-disconnects-after-10-minutes/) based on the posting of Rafael (MS Support), this will not work with Windows Embedded Handheld (WM6.5).</p>
<p>The TSSHELLWND will not react on mouse_event and you have to replace the calls by SendMessage and send the WM_MOUSEMOVE to the Terminal Server Input window.</p>
<p>The attached application will do so but it will start only on Int*rm*c devices. It sends a mouse_move message all 4 minutes to the TS input window and so the idle timer will not timeout.</p>
<p>If you ever need to stop RDMKeepbusy from running in the background, you will need StopKeepBusy which is part of the executable download.</p>
<p>For visual control, RDMKeepbusy shows a small blinking line in the task bar:<br />
green = Remote Desktop window found and input window is active<br />
yellow = Remote Desktop window found, but no input window active<br />
red = Remote Desktop window not found</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=139" title="Downloaded 122 times">RDM Keepbusy</a> - Windows Embedded Handheld application to avoid idle timeouts (Hits: 122, size: 8.07 kB)
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F&amp;title=WM+6.5%3A+Remote+Desktop+Client+disconnects+after+10+minutes" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F&amp;title=WM+6.5%3A+Remote+Desktop+Client+disconnects+after+10+minutes" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F&amp;title=WM+6.5%3A+Remote+Desktop+Client+disconnects+after+10+minutes" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F&amp;T=WM+6.5%3A+Remote+Desktop+Client+disconnects+after+10+minutes" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F07%2F04%2Fwm-6-5-remote-desktop-client-disconnects-after-10-minutes%2F&amp;t=WM+6.5%3A+Remote+Desktop+Client+disconnects+after+10+minutes" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/07/04/wm-6-5-remote-desktop-client-disconnects-after-10-minutes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mobile development &#8211; A simple Unicode Character Map</title>
		<link>http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-a-simple-unicode-character-map</link>
		<comments>http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 14:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[charmap]]></category>
		<category><![CDATA[EnumFontFamiliesEx]]></category>
		<category><![CDATA[glyphs]]></category>
		<category><![CDATA[UCS-2]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-16]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1096</guid>
		<description><![CDATA[Recently I needed to know, which chars (glyphs) are supported by a windows mobile font. I looked around for a charmap tool like we have on Windows Desktop PCs and was unable to find one. So I started this little tool: CharmapCF. As you can see, you get a simple charmap and can verify what [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to know, which chars (glyphs) are supported by a windows mobile font. I looked around for a charmap tool like we have on Windows Desktop PCs and was unable to find one. So I started this little tool: CharmapCF.</p>
<p><a rel="attachment wp-att-1100" href="http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/tahoma-0x00/"><img class="alignnone size-medium wp-image-1100" title="tahoma-0x00" src="http://www.hjgode.de/wp/wp-content/uploads/2011/04/tahoma-0x00-225x300.jpg" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-1102" href="http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/wingdings-0x00/"><img class="alignnone size-medium wp-image-1102" title="wingdings-0x00" src="http://www.hjgode.de/wp/wp-content/uploads/2011/04/wingdings-0x00-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>As you can see, you get a simple charmap and can verify what glyphs are supported and which not (square rectangle).</p>
<p>CharmapCF supports only UCS-2, UTF-16 as used by Microsoft&#8217;s Encoding.Unicode class. So it also only supports the Unicode Basic Multilanguage Plane (BMP).</p>
<p><span id="more-1096"></span></p>
<p>When you click a glyph you will get the unicode codepoint displayed in the title and the char is placed in the small text box in the upper right. Using the [c] button you copy the unicode char to the clipboard and paste it in another app.</p>
<p><a rel="attachment wp-att-1099" href="http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/arial-uni-0x04-zoomed/"><img class="alignnone size-medium wp-image-1099" title="Arial-Uni-0x04-zoomed" src="http://www.hjgode.de/wp/wp-content/uploads/2011/04/Arial-Uni-0x04-zoomed-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>In the above screenshot you se I have copied ARIALUNI.TTF form my desktop PC into the \Windows\Fonts dir of the device and can use the font in CharmapCF.</p>
<p>What can also see here is that the table is zoomed in. You can use the Options menu to zoom the table in or out.</p>
<p><a rel="attachment wp-att-1101" href="http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/tahoma-0x04/"><img class="alignnone size-medium wp-image-1101" title="tahoma-0x04" src="http://www.hjgode.de/wp/wp-content/uploads/2011/04/tahoma-0x04-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Here you see that Tahoma does only support some of the glyphs.</p>
<p><a rel="attachment wp-att-1102" href="http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/wingdings-0x00/"><img class="alignnone size-medium wp-image-1102" title="wingdings-0x00" src="http://www.hjgode.de/wp/wp-content/uploads/2011/04/wingdings-0x00-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Above is simply a wingdings glyphs char.</p>
<p>There is nothing special in the code. Maybe you find the font enumeration code useful:</p>
<pre lang="csharp" escaped="true">        /// &lt;summary&gt;
        ///
        /// &lt;/summary&gt;
        /// &lt;param name="lpelfe"&gt;IntPtr LOGFONT structure that contains information about the logical attributes of the font&lt;/param&gt;
        /// &lt;param name="lpntme"&gt;structure that contains information about the physical attributes of the font, if the font is a TrueType font. If the font is not a TrueType font, this parameter points to a TEXTMETRIC structure&lt;/param&gt;
        /// &lt;param name="FontType"&gt;[in] DWORD that specifies the type of the font:
        /// DEVICE_FONTTYPE
        /// RASTER_FONTTYPE
        /// TRUETYPE_FONTTYPE&lt;/param&gt;
        /// &lt;param name="lParam"&gt;Pointer to the application-defined data passed by the EnumFontFamilies function&lt;/param&gt;
        /// &lt;returns&gt;Nonzero continues enumeration. Zero stops enumeration&lt;/returns&gt;
        private int EnumFontFamiliesExProc(IntPtr lpelfe, IntPtr lpntme, EnumFontsType FontType, int lParam)
        {
            LOGFONT logFont = (LOGFONT)Marshal.PtrToStructure(lpelfe, typeof(LOGFONT));

            if (logFont.lfWeight == lfWeightType.FW_REGULAR &amp;&amp; logFont.lfItalic==0)
            {
                //we dont like duplicate names
                if(!fontNames.Contains(logFont.lfFaceName))
                    fontNames.Add(logFont.lfFaceName);

                System.Diagnostics.Debug.WriteLine(logFont.lfFaceName);
            }
            // Non-zero return continues enumerating
            return 1;
        }
        private void buildList(){
            // Need an HDC to pass to EnumFontFamilies
            IntPtr hwnd = GetDesktopWindow();
            IntPtr hdc = GetDC(hwnd);

            LOGFONT logFont = new LOGFONT();

            enumFontDelegate = new EnumFontDelegate(EnumFontFamiliesExProc);
            fpEnumProc = Marshal.GetFunctionPointerForDelegate(enumFontDelegate);

            EnumFontFamilies(hdc, null, fpEnumProc, IntPtr.Zero);

            // We got a list of the major families.  Copy the list,
            // then clear it so we can go back and grab all the individual fonts.
            List&lt;string&gt; fontFamilies = new List&lt;string&gt;();
            fontFamilies.AddRange(fontNames);
            fontNames.Clear();

            foreach(string fontFamily in fontFamilies)
            {
                EnumFontFamilies(hdc, fontFamily, fpEnumProc, IntPtr.Zero);
            }

            ReleaseDC(hdc);

            foreach(string s in fontNames)
            {
                //listBox1.Items.Add(s);
            }
        }</pre>
<p>One interesting behavior of the windows font system is shown when you select the Font &#8220;Fantasie&#8221; from the fonts listbox. You will see windows chooses another font for you (see label on right of listbox showing the active font).</p>
<p>The rest of the code implements some drawing routines. I have used a class based on Panel, so I can easily move and resize the charmap.</p>
<p>Source code is at <a href="http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2FCharMap%2FCharMapCF" target="_blank">code.googl.com/p/win-mobile-code</a></p>
<p>Executable as with release 58 is here: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=135" title="Downloaded 155 times">CharmapCF r58 executable</a> -  (Hits: 155, size: 9.13 kB)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F&amp;title=Mobile+development+%26%238211%3B+A+simple+Unicode+Character+Map" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F&amp;title=Mobile+development+%26%238211%3B+A+simple+Unicode+Character+Map" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F&amp;title=Mobile+development+%26%238211%3B+A+simple+Unicode+Character+Map" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F&amp;T=Mobile+development+%26%238211%3B+A+simple+Unicode+Character+Map" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F04%2F06%2Fmobile-development-a-simple-unicode-character-map%2F&amp;t=Mobile+development+%26%238211%3B+A+simple+Unicode+Character+Map" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All you need to know about unicode</title>
		<link>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=all-you-need-to-know-about-unicode</link>
		<comments>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 15:55:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[multibyte]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf]]></category>
		<category><![CDATA[utf-16]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[widebyte]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1085</guid>
		<description><![CDATA[Recently I stumbled about this great article about ASCII, 7 and 8 Bit, codepages, Multi byte, Wide byte and unicode: http://www.joelonsoftware.com/articles/Unicode.html If you ever get in trouble with wrong encoding display of chars, give this article a try to know the backgrounds. As you know, Windows CE and Windows Mobile  is always unicode except for [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I stumbled about this great article about ASCII, 7 and 8 Bit, codepages, Multi byte, Wide byte and unicode: http://www.joelonsoftware.com/articles/Unicode.html</p>
<p>If you ever get in trouble with wrong encoding display of chars, give this article a try to know the backgrounds.</p>
<p>As you know, Windows CE and Windows Mobile  is always unicode except for serial and socket communication. But the truetype fonts available on Windows Mobile devices mostly support only common chars, there file size is about 600K. The file size of Arial Unicode MS is about 22MB.</p>
<p>regards</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;T=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;t=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development &#8211; Simple serial communication application</title>
		<link>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-simple-serial-communication-application</link>
		<comments>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 14:31:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[SerialPort]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1072</guid>
		<description><![CDATA[Here is a simple application to connect to a serial port. The idea is based on the need of having an application to send demo print files to a virtual comm port connected to a bluetooth printer. Update 16. March 2011: Added dialog to connect to BT printer by BT Address on Intermec devices. New [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple application to connect to a serial port. The idea is based on the need of having an application to send demo print files to a virtual comm port connected to a bluetooth printer.</p>
<p><strong>Update 16. March 2011:</strong> Added dialog to connect to BT printer by BT Address on Intermec devices. New source and binary at code.google.com.</p>
<p><strong>Update 21. March 2011:</strong> Splitted source code and providing three different flavours:<br />
CommAppCFSerial does serial comm only.<br />
CommAppCFbtSearch provides BT connect (Intermec Devices only) and BT discovery<br />
CommAppCF itself is a unstable working release<br />
see code.google.com/p/win-mobile-code &#8230; Executables are in bin subdirs.</p>
<p>You can enter and send texts to or send a whole file to the port. Additionally you are able to send ASCII codes by using \xAB syntax, where AB is the hex code of the byte you would like to send.</p>
<p>There is nothing special with the code except the hex decoding/encoding and the possibility to send a file.</p>
<p><a rel="attachment wp-att-1073" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf/"><img class="alignnone size-medium wp-image-1073" title="CommAppCF" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF-225x300.png" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-1074" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf_connect/"><img class="alignnone size-medium wp-image-1074" title="CommAppCF_connect" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF_connect-225x300.png" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-1075" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf_sendstatus/"><img class="alignnone size-medium wp-image-1075" title="CommAppCF_sendstatus" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF_sendstatus-225x300.png" alt="" width="225" height="300" /></a></p>
<p><span id="more-1072"></span>Here is a short sample how the SendFile is implemented:</p>
<pre lang="csharp">        private void sendFile(string filename)
        {
            try
            {
                updateTxtRcv("Starting sendFile(" + filename + ")");

                System.IO.StreamReader sr = new System.IO.StreamReader(filename);
                int r;
                int blockSize = 4096;
                char[] buf = new char[blockSize];
                //how many blocks to send?
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                long lBlocks = (long)(fi.Length / blockSize);
                if (lBlocks == 0)
                    lBlocks = 1;
                updateTxtRcv("Need to send " + lBlocks.ToString() + " blocks...");
                long lBlockNr = 1;
                do
                {
                    updateTxtRcv("Sending block " + lBlockNr.ToString() + " ...");
                    r = sr.Read(buf, 0, blockSize); //r = number of bytes read
                    comport.Write(buf, 0, r);
                }
                while (r!=-1 &amp;&amp; !sr.EndOfStream);
                sr.Close();
                updateTxtRcv("Finished sendFile(" + filename + ")");
            }
            catch (Exception x)
            {
                updateTxtRcv("sendFile exception:" + x.Message);
                System.Diagnostics.Debug.WriteLine(x.Message);
            }
        }</pre>
<p>The application persists choosen settings in the registry. I had to implement classes to convert SerialPort Parity, Handshake, Stopbits etc settings between typed and integer values. Unfortunately the enums for these properties are not defined on base of integer. For example I had to code this class to enable save/restore of the Handshake property:</p>
<pre lang="csharp">    public static class myHandshake
    {
        public static string[] handshakes = { "None", "XOnXOff", "RequestToSend", "RequestToSendXOnXOff" };
        public static Handshake ToHandshake(int i)
        {
            switch (i)
            {
                case 0: return Handshake.None;
                case 1: return Handshake.XOnXOff;
                case 2: return Handshake.RequestToSend;
                case 3: return Handshake.RequestToSendXOnXOff;
            }
            return Handshake.None;
        }
        public static Handshake ToHandshake(string text)
        {
            if (text.Equals("None", StringComparison.OrdinalIgnoreCase))
                return Handshake.None;
            if (text.Equals("XOnXOff", StringComparison.OrdinalIgnoreCase))
                return Handshake.XOnXOff;
            if (text.Equals("RequestToSend", StringComparison.OrdinalIgnoreCase))
                return Handshake.RequestToSend;
            if (text.Equals("RequestToSendXOnXOff", StringComparison.OrdinalIgnoreCase))
                return Handshake.RequestToSendXOnXOff;
            return Handshake.None;
        }
        public static int ToInt(Handshake hs)
        {
            switch (hs)
            {
                case Handshake.None: return 0;
                case Handshake.XOnXOff: return 1;
                case Handshake.RequestToSend: return 2;
                case Handshake.RequestToSendXOnXOff: return 3;
            }
            return 0;
        }
        public static string ToString(Handshake hs)
        {
            switch (hs)
            {
                case Handshake.None: return "None";
                case Handshake.XOnXOff: return "XOnXOff";
                case Handshake.RequestToSend: return "RequestToSend";
                case Handshake.RequestToSendXOnXOff: return "RequestToSendXOnXOff";
            }
            return "None";
        }
        public static string ToString(int i)
        {
            switch (i)
            {
                case 0: return "None";
                case 1: return "XOnXOff";
                case 2: return "RequestToSend";
                case 3: return "RequestToSendXOnXOff";
            }
            return "None";
        }
    }//class myHandshake</pre>
<p>This would have been a lot easier if the Handshake enum was based on integer.</p>
<p>BTW using StopBits.None is not supported: &#8220;This value is not supported. Setting the System.IO.Ports.SerialPort.StopBits property to System.IO.Ports.StopBits.None raises an System.ArgumentOutOfRangeException.&#8221; (see StopBits enumeration).</p>
<p>Source code and binary located at <a href="http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2FCommAppCF" target="_blank">code.google.com</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;T=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;t=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development &#8211; subclassing the Camera View (CameraCaptureDialog, SHCameraCapture)</title>
		<link>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture</link>
		<comments>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 14:21:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[hook.wndproc]]></category>
		<category><![CDATA[Subclassing]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1065</guid>
		<description><![CDATA[If you are running a kiosk mode app but need to provide the camercapture dialog on Windows Mobile 5 or later, you may need to disable the one or other click in the CameraCapture dialog. This article uses a technique known as subclassing as already used and decribed in my StartButtonHookWM65 article. For the CameraCapture [...]]]></description>
			<content:encoded><![CDATA[<p>If you are running a kiosk mode app but need to provide the camercapture dialog on Windows Mobile 5 or later, you may need to disable the one or other click in the CameraCapture dialog.</p>
<p>This article uses a technique known as subclassing as already used and decribed in my StartButtonHookWM65 article. For the CameraCapture dialog the code has been revised and you can now subclass any known window class and disable clicks within the Windows Mobile menu bar.</p>
<pre lang="csharp">        private string _winClassName = "HHTaskbar";
        public string winClassName
        {
            get { return _winClassName; }
            set {
                if (this.oldWndProc == IntPtr.Zero) //only allow change before subclassing
                    _winClassName = value;
            }
        }
...
        /// &lt;summary&gt;
        /// SubClassing: Install the wndproc hook
        /// &lt;/summary&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private bool hookWindow()
        {
            //find the window to hook
            IntPtr hWndHooked = FindWindow(_winClassName, IntPtr.Zero);
            if (hWndHooked == IntPtr.Zero)
                return false;
            //enable the taskbar, not realy necessary
            EnableWindow(hWndHooked, true);
            //already installed?
            if (oldWndProc == IntPtr.Zero)
            {
                //find the menu_worker window
                IntPtr hwndMenu_Worker = FindWindow("menu_worker", IntPtr.Zero);
                if (hwndMenu_Worker != IntPtr.Zero)
                {
                    //get the child window which has the buttons on it
                    IntPtr hwndToolbar = GetWindow(hwndMenu_Worker, GetWindow_Cmd.GW_CHILD);
                    if (hwndToolbar != IntPtr.Zero)
                    {
                        _mHwnd = hwndToolbar;       //store to remember
                        SubclassHWnd(hwndToolbar);  //subclass the wndproc
                    }
                }
            }
            return true;
        }
</pre>
<p>As the call to CameraCaptureDialog will block and you can not subclass it before it is launched, I use a timer that will subclass the dialog assuming it will show after the call to .ShowDialog().</p>
<pre lang="csharp">        private System.Windows.Forms.Timer timer;
        hwndutils subClassUtils;
        private void ShowCamera()
        {
            CameraCaptureDialog cdlg = new CameraCaptureDialog();
            cdlg.DefaultFileName="picture.jpg";
            cdlg.InitialDirectory = "\\My Documents";
            cdlg.Mode = CameraCaptureMode.Still;
            cdlg.Owner = this.pictureBox1;
            cdlg.StillQuality = CameraCaptureStillQuality.High;
            cdlg.Title = "Take a picture and Select";
            cdlg.Resolution = new Size(240, 320);
            cdlg.VideoTypes = CameraCaptureVideoTypes.All;

            //subclass main window with delay
            subClassUtils = new hwndutils();
            timer = new Timer();
            timer.Interval = 1000;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Enabled = true;

            DialogResult dRes = <strong>cdlg.ShowDialog();</strong>
...
        void timer_Tick(object sender, EventArgs e)
        {
            subClassUtils.winClassName = "Camera View";
            <strong>subClassUtils.CloseButtonDisabled = true;</strong>
            System.Threading.Thread.Sleep(500);
            if(subClassUtils.CloseButtonDisabled)
                timer.Enabled = false;

        }
</pre>
<p>In the line &#8220;<strong>subClassUtils.CloseButtonDisabled = true;&#8221; </strong>the subclassing (or the hook) will be activated and clicks on (OK) will not be accepted.<strong></strong></p>
<p><a rel="attachment wp-att-1068" href="http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/cameracapturedlg/"><img class="alignnone size-medium wp-image-1068" title="CameraCaptureDlg" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CameraCaptureDlg-225x300.png" alt="" width="225" height="300" /></a></p>
<p>Code subclassing.cs download: <strong><b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=134" title="Downloaded 156 times">subclassing.cs</a> - subclassing code for C# compact framework (Hits: 156, size: 2.4 kB)<br />
</strong></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;T=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;t=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Mobile: Disable Low Battery Warning</title>
		<link>http://www.hjgode.de/wp/2011/03/05/windows-mobile-disable-low-battery-warning/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-mobile-disable-low-battery-warning</link>
		<comments>http://www.hjgode.de/wp/2011/03/05/windows-mobile-disable-low-battery-warning/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 17:35:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[Low battery]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[warning]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1062</guid>
		<description><![CDATA[Although I dont recommend this, it may be usefull if your kiosk mode app watches and manages the battery level: you can disable the low battery warning. Sometimes such hacks are hard to find, now there is one more location in internet. In the registry find the key [HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}] This is the entry responsible for [...]]]></description>
			<content:encoded><![CDATA[<p>Although I dont recommend this, it may be usefull if your kiosk mode app watches and manages the battery level: you can disable the low battery warning. Sometimes such hacks are hard to find, now there is one more location in internet.</p>
<p>In the registry find the key</p>
<pre>[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}]</pre>
<p>This is the entry responsible for low battery warnings</p>
<p>Add a new REG_SZ key: &#8220;Default&#8221; with for example the text &#8220;Low Battery Warning&#8221;</p>
<pre>"Default"="Low Battery Warning"</pre>
<p>This entry is used to display the notification in the list of notifications in Start-Settings-Sounds&amp;Notifications. To disable the notification itself it is not really necessary, but easier to control.</p>
<p>The Options entry in the registry defines which options your selected in Start-Settings-Sounds&amp;Notifications, for example play a sound or display a user notification. Set Options to REG_DWORD=0&#215;00 and there will be no notification when the battery goes down to 10% (depends on the device) and lower.</p>
<p>Here is the change in full:</p>
<pre>REGEDIT4
[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}]
"Options"=dword:00000000
"Default"="LowBattWarning"</pre>
<p><strong>You need to reboot the device after the change!</strong></p>
<p>Only a small tipp</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F&amp;title=Windows+Mobile%3A+Disable+Low+Battery+Warning" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F&amp;title=Windows+Mobile%3A+Disable+Low+Battery+Warning" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F&amp;title=Windows+Mobile%3A+Disable+Low+Battery+Warning" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F&amp;T=Windows+Mobile%3A+Disable+Low+Battery+Warning" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F05%2Fwindows-mobile-disable-low-battery-warning%2F&amp;t=Windows+Mobile%3A+Disable+Low+Battery+Warning" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/05/windows-mobile-disable-low-battery-warning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

