<?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; Tools</title>
	<atom:link href="http://www.hjgode.de/wp/category/tools/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>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 90 times">KeyToggleStart</a> -  (Hits: 90, 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>Remote Desktop Mobile on VGA devices: QVGA applications do not scale well</title>
		<link>http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well</link>
		<comments>http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 11:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[HI_RES_AWARE]]></category>
		<category><![CDATA[QVGA]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[VGA]]></category>
		<category><![CDATA[Windows Mobile 6.5.3]]></category>
		<category><![CDATA[wpctsc.exe]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1184</guid>
		<description><![CDATA[Hi there are now more and more full VGA rugged devices coming. And some customers are still using Remote Desktop Mobile to run there application on the small screens. Unfortunately some of the coders use application screen layouts hard coded to QVGA (240&#215;320). Now with a VGA capable Windows Mobile device they get weird screens [...]]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>there are now more and more full VGA rugged devices coming. And some customers are still using Remote Desktop Mobile to run there application on the small screens. Unfortunately some of the coders use application screen layouts hard coded to QVGA (240&#215;320). Now with a VGA capable Windows Mobile device they get weird screens on the device.</p>
<p>The client (Remote Desktop Mobile) sends the server information about there screen sizes. As a VGA device can display 480&#215;640 pixels, the hard coded 240&#215;320 applications only use a quarter of the screen. The texts are very small and more or less unreadable.</p>
<p><span id="more-1184"></span>The terminal server gets client resolution information:</p>
<p><a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/tsmanager_vga_unhacked/" rel="attachment wp-att-1186"><img class="aligncenter size-full wp-image-1186" title="TSManager_VGA_unhacked" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/TSManager_VGA_unhacked.gif" alt="" width="637" height="353" /></a> Unscaled (left) VGA display of a QVGA application (with &#8220;Fit remote desktop to screen&#8221; NOT CHECKED) and on the right the same application with internal autoadjust to workscreen size:</p>
<p><a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/qvga_fixed_form_on_vga_screen_nofittoscreen/" rel="attachment wp-att-1187"><img class="alignnone size-medium wp-image-1187" title="QVGA_fixed_form_on_VGA_screen_noFitToScreen" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/QVGA_fixed_form_on_VGA_screen_noFitToScreen-225x300.gif" alt="" width="225" height="300" /></a>  <a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/rdm_options/" rel="attachment wp-att-1189"><img class="alignnone size-medium wp-image-1189" title="RDM_options" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/RDM_options-225x300.gif" alt="" width="225" height="300" /></a>  <a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/qvga_autoscale_form_on_vga_screen/" rel="attachment wp-att-1190"><img class="alignnone size-medium wp-image-1190" title="QVGA_autoscale_form_on_VGA_screen" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/QVGA_autoscale_form_on_VGA_screen-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>As you can see in the right image above this line, it is no problem to show a form designed for QVGA to scale nice with the use of some code (as using WorkingArea.Width/Height and a table layout). But in the left image you see what happens to hard coded designed applications.</p>
<p>If you have the source code, you should change the design of your dialogs to be resolution aware, so it scales fine for QVGA and VGA (and whatever comes next).</p>
<p>If you do not have the code or can not change the application, you have to tell Windows Mobile to behave like the Remote Desktop Mobile application is NOT <a href="http://msdn.microsoft.com/en-us/library/bb416287.aspx" target="_blank">HI_RES_AWARE</a>. That means you need to hack the exe file. I took a look at the Windows Mobile 6.5.3 wpctsc.exe (the Remote Desktop Mobile executable) and did not find the HI_RES_AWARE resource, so the OS must use the other mark to see that wpctsc.exe is HI_RES_AWARE. And yes, indeed, the PE header shows that wpctsc.exe has a subystem version of 5.2. With some PEInfo tool, you can hack the major subsystem version and just change it from 5 to 4.</p>
<p>When you start a application that is not HI_RES_AWARE, the Windows Mobile 6.5.3 OS will scale all UI elements for the application and the app will look fine and not only fill a quarter of the VGA screen. After changing the major subsystem version number, the first thing you will notice is the more coarse display of the menu items in the menu bar:</p>
<p><a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/rdm_startscreen_vga/" rel="attachment wp-att-1193"><img class="alignnone size-medium wp-image-1193" title="RDM_startscreen_VGA" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/RDM_startscreen_VGA-225x300.gif" alt="" width="225" height="300" /></a>   <a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/rdm_startscreen_qvga/" rel="attachment wp-att-1194"><img class="alignnone size-medium wp-image-1194" title="RDM_startscreen_QVGA" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/RDM_startscreen_QVGA-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>Left is the HI_RES_AWARE original app and on the right we have the hacked one (take a closer look ate the ellipses around the menu items).</p>
<p>When you use the hacked, not HI_RES_AWARE, application, the terminal server will see the client supports QVGA only (Client Resolution) and your hard coded application screens will look the same as on a QVGA capable device:</p>
<p><a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/qvga-form_on_qvga-screen/" rel="attachment wp-att-1195"><img class="alignnone size-medium wp-image-1195" title="QVGA-form_on_QVGA-screen" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/QVGA-form_on_QVGA-screen-225x300.gif" alt="" width="225" height="300" /></a>   <a href="http://www.hjgode.de/wp/2011/09/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/tsmanager_qvga_hacked_nofittoscreen-2/" rel="attachment wp-att-1197"><img class="alignnone size-full wp-image-1197" title="TSManager_QVGA_hacked_noFitToScreen" src="http://www.hjgode.de/wp/wp-content/uploads/2011/09/TSManager_QVGA_hacked_noFitToScreen1.gif" alt="" width="637" height="354" /></a></p>
<p>The attached wpctsc.exe is the hacked one with a subsystem major version number of 4 instead of 5. Use this on your Windows Mobile 6.5.3 device at your own risk. The file is not signed as the device I work with are not requiring signed exe files. The change to the exe file (after I dumped the OS files to my PC using itsutils) was simply done with mgeeky&#8217;s PEinfo code at <a href="https://github.com/mgeeky/PEInfo" target="_blank">GitHub</a>.</p>
<p>If you can not copy the file on top of the original one on the device (\Windows\wpctsc.exe), you can use the syscache feature. Copy the wpctsc.exe to \Windows\System\SysCache directory and reboot the device. If the directory does not exist you just have to create it manually.</p>
<p>If you want to get the old wpctsc.exe back, just delete the file you copied. As the original wpctsc.exe is part of the OS (a XIP file), you can not delete the file but you can copy a file with the same name on top of it. When you delete this copied file, the original is back in place. So, there is no harm in testinng the exe.</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=142" title="Downloaded 242 times">wpctsc.exe with major subsystem version number = 4</a> -  (Hits: 242, size: 40.21 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%2F09%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%2F&amp;title=Remote+Desktop+Mobile+on+VGA+devices%3A+QVGA+applications+do+not+scale+well" 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%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%2F&amp;title=Remote+Desktop+Mobile+on+VGA+devices%3A+QVGA+applications+do+not+scale+well" 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%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%2F&amp;title=Remote+Desktop+Mobile+on+VGA+devices%3A+QVGA+applications+do+not+scale+well" 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%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%2F&amp;T=Remote+Desktop+Mobile+on+VGA+devices%3A+QVGA+applications+do+not+scale+well" 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%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%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%2F05%2Fremote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well%2F&amp;t=Remote+Desktop+Mobile+on+VGA+devices%3A+QVGA+applications+do+not+scale+well" 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/05/remote-desktop-mobile-on-vga-devices-qvga-applications-do-not-scale-well/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 119 times">RDM Keepbusy</a> - Windows Embedded Handheld application to avoid idle timeouts (Hits: 119, 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>2</slash:comments>
		</item>
		<item>
		<title>Mobile Development: AutoHide Windows Mobile Device Center</title>
		<link>http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-autohide-windows-mobile-device-center</link>
		<comments>http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/#comments</comments>
		<pubDate>Fri, 13 May 2011 12:54:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[autohide]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Mopbile Device Center]]></category>
		<category><![CDATA[WMDC]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1121</guid>
		<description><![CDATA[Do you like the Windows Mobile Device Center (WMDC) does popup every time you connect a mobile device to your (development) PC? If yes, don&#8217;t read further. The attached application (including VS 2008 C++ source code) simply watches the Window list for Windows Mobile Device Center and Windows Mobile Member Center. If a window is [...]]]></description>
			<content:encoded><![CDATA[<p>Do you like the Windows Mobile Device Center (WMDC) does popup every time you connect a mobile device to your (development) PC? If yes, don&#8217;t read further.</p>
<p><a rel="attachment wp-att-1134" href="http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/wmdcstarted/"><img class="alignnone size-medium wp-image-1134" title="WMDCstarted" src="http://www.hjgode.de/wp/wp-content/uploads/2011/05/WMDCstarted-300x106.gif" alt="" width="300" height="106" /></a></p>
<p>The attached application (including VS 2008 C++ source code) simply watches the Window list for Windows Mobile Device Center and Windows Mobile Member Center. If a window is found, it will be hidden automatically. Very simple application.</p>
<p><a rel="attachment wp-att-1135" href="http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/wmdc_contextmenu/"><img class="alignnone size-full wp-image-1135" title="WMDC_contextmenu" src="http://www.hjgode.de/wp/wp-content/uploads/2011/05/WMDC_contextmenu.gif" alt="" width="182" height="172" /></a></p>
<p>WMDCautohide will reside in the notification area of your Windows 7 PC after you started it. If Mobile Device Center has been found and hidden, there will be a short notification.</p>
<p><a rel="attachment wp-att-1136" href="http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/wmdc_options/"><img class="alignnone size-full wp-image-1136" title="WMDC_options" src="http://www.hjgode.de/wp/wp-content/uploads/2011/05/WMDC_options.gif" alt="" width="239" height="166" /></a></p>
<p>You can right click the notification symbol and then either show/hide WMDC, show the main window, set the watch interval or exit the tool.</p>
<p><a rel="attachment wp-att-1123" href="http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/wmdc_mainwin/"><img class="alignnone size-full wp-image-1123" title="WMDC_mainwin" src="http://www.hjgode.de/wp/wp-content/uploads/2011/05/WMDC_mainwin.gif" alt="" width="240" height="120" /></a> <a rel="attachment wp-att-1137" href="http://www.hjgode.de/wp/2011/05/13/mobile-development-autohide-windows-mobile-device-center/wmdc_mainwin_menu/"><img class="alignnone size-full wp-image-1137" title="WMDC_mainwin_menu" src="http://www.hjgode.de/wp/wp-content/uploads/2011/05/WMDC_mainwin_menu.gif" alt="" width="242" height="148" /></a></p>
<p>Download: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=137" title="Downloaded 125 times">WMDC Source and Exe</a> -  (Hits: 125, size: 45.5 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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%2F&amp;title=Mobile+Development%3A+AutoHide+Windows+Mobile+Device+Center" 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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%2F&amp;title=Mobile+Development%3A+AutoHide+Windows+Mobile+Device+Center" 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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%2F&amp;title=Mobile+Development%3A+AutoHide+Windows+Mobile+Device+Center" 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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%2F&amp;T=Mobile+Development%3A+AutoHide+Windows+Mobile+Device+Center" 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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%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%2F05%2F13%2Fmobile-development-autohide-windows-mobile-device-center%2F&amp;t=Mobile+Development%3A+AutoHide+Windows+Mobile+Device+Center" 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/05/13/mobile-development-autohide-windows-mobile-device-center/feed/</wfw:commentRss>
		<slash:comments>0</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>Mobile Development-PingAlert: watch your servers</title>
		<link>http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-pingalert-watch-your-servers-2</link>
		<comments>http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 21:23:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Hosts]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[PingAlert]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1037</guid>
		<description><![CDATA[Three tools to peridically launch an app, ping a list of hosts and show a notification.]]></description>
			<content:encoded><![CDATA[<p>Are you looking for a tool that periodically pings a list of hosts? Here is a toolset that will reschedule a ping utilitiy. This ping utility pings a list of hosts and will create notifications if one or most hosts failed to answer.</p>
<p>I have done this toolset with three separate applications. The scheduler and the notification tool are written in C/C++ win32 API cause this API provided the best access to all the possibilities of the used functions. The user notification API is only supported with basic functionality by CF2. The CEUserNotification API is not supported by CF2 at all.</p>
<p>Although OpenNetCF provides an C# interface to the used APIs, I did not like to include all the unneeded stuff. On the other hand the scheduler is fast and small written in C/C++. With C# I had problems with the notification, especially for removing existing notifications and why should the main tool reside in memory just for showing the notification.</p>
<p>The ping tool is written in C# targeting Compact Framework 2. C# was the easiest to implement the GUI.</p>
<p>All source is available thru one Visual Studio 2008 solution. Yes, you can mix C/C++ and CF2 within one solution.</p>
<p><a rel="attachment wp-att-1039" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/vs2008solution/"><img class="alignnone size-full wp-image-1039" title="vs2008solution" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/vs2008solution.gif" alt="" width="203" height="123" /></a></p>
<p><a rel="attachment wp-att-1042" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/pingreport/"><img class="alignnone size-medium wp-image-1042" title="PingReport" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/PingReport-192x300.gif" alt="" width="192" height="300" /></a><a rel="attachment wp-att-1040" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/pingalert/"><img class="alignnone size-medium wp-image-1040" title="PingAlert" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/PingAlert-193x300.gif" alt="" width="193" height="300" /></a></p>
<p><span id="more-1037"></span>The code of the scheduler called PingAlertScheduler is based on my code <a href="http://www.hjgode.de/wp/2009/07/14/howto-run-an-application-periodically/" target="_blank">How to run an application periodically</a>. The code first clears all existing schedules of themself and then creates a new schedule for xx minutes in the future. If the scheduler is run from the schedule event, it will get a special arg transmitted &#8220;PingAlert&#8221;</p>
<pre lang="cpp">...
    TCHAR szExtApp[] = L"\\Windows\\PingAlert.exe";
    TCHAR szExtArg[] = L"pingsweep";
    TCHAR szScheduleArg[] = L"PingAlert";
...
    if (_wcsicmp(szScheduleArg, lpCmdLine)==0)
    {

        nclog(L"PingAlertScheduler: processing CmdLine=%s...\n", szScheduleArg);
        nclog(L"PingAlertScheduler: ...will wakeup again after reschedule...\n");
        //schedule next run
        if ( !FAILED(ScheduleRunApp(lpFileName, szScheduleArg)) )
        {
            //the worker application should be launched here!
            nclog(L"PingAlertScheduler: starting target app %s...\n", szExtApp);
            //is the target already running, then send WM_USER msg
            //else start a new instance with cmdLine="pingsweep"
            PROCESS_INFORMATION pi;
            if( CreateProcess(szExtApp,szExtArg,
                    NULL,NULL,NULL, 0, NULL,NULL,NULL,
                    &amp;pi)!=0)
            {
                nclog(L"PingAlertScheduler: CreateProcess for '%s' OK\n", szExtApp);
                CloseHandle(pi.hThread);
                CloseHandle(pi.hProcess);
            }
            else
                nclog(L"PingAlertScheduler: CreateProcess for '%s' FAILED: %u\n", szExtApp, GetLastError());
            //inform target
            //iRet=signalEvent();
            goto MainExit;
        }
        else{
            MessageBox(NULL, L"error in ScheduleRunApp", lpFileName, MB_TOPMOST | MB_SETFOREGROUND);
            nclog(L"PingAlertScheduler: error in ScheduleRunApp\n");
            iRet=-2;
            goto MainExit; //OK
        }
    }
</pre>
<p>This code also calls the reschedule to run itself again in the specified time interval.</p>
<pre lang="cpp">static HRESULT ScheduleRunApp(
  LPCTSTR szExeName,
  LPCTSTR szArgs)
{
    //do not add a schedule if actual date is 21.3.2003
    SYSTEMTIME t;
    memset(&amp;t, 0, sizeof(SYSTEMTIME));
    GetLocalTime(&amp;t);
    //check if the system clock is at factory default, device specific!
    if ( (t.wYear == 2003) &amp;&amp; (t.wMonth == 3) &amp;&amp; (t.wDay == 21) )
    {
        nclog(L"PingAlertScheduler: # no next run schedule as date is 21.03.2003!\n");
        return NOERROR;
    }

    HRESULT hr = S_OK;
    HANDLE hNotify = NULL;

    // set a CE_NOTIFICATION_TRIGGER
    CE_NOTIFICATION_TRIGGER notifTrigger;
    memset(&amp;notifTrigger, 0, sizeof(CE_NOTIFICATION_TRIGGER));
    notifTrigger.dwSize = sizeof(CE_NOTIFICATION_TRIGGER);

    // calculate time
    SYSTEMTIME st = {0};
    GetLocalTime(&amp;st);

    st = AddDiff(&amp;st, iScheduleInterval); //wake in x minutes
    wsprintf(str, L"Next run at: %02i.%02i.%02i %02i:%02i:%02i\n",
                                        st.wDay, st.wMonth , st.wYear,
                                        st.wHour , st.wMinute , st.wSecond );
    nclog(L"PingAlertScheduler: %s\n", str);

    notifTrigger.dwType = CNT_TIME;
    notifTrigger.stStartTime = st;

    // timer: execute an exe at specified time
    notifTrigger.lpszApplication = (LPTSTR)szExeName;
    notifTrigger.lpszArguments = (LPTSTR)szArgs;

    hNotify = CeSetUserNotificationEx(0, &amp;notifTrigger, NULL);
    // NULL because we do not care the action
    if (!hNotify) {
        hr = E_FAIL;
        nclog(L"PingAlertScheduler: CeSetUserNotificationEx FAILED...\n");
    } else {
        // close the handle as we do not need to use it further
        CloseHandle(hNotify);
        nclog(L"PingAlertScheduler: CeSetUserNotificationEx succeeded...\n");
    }
    return hr;
}
</pre>
<p>When PingAlertScheduler.exe ist started with &#8220;PingAlert&#8221; it will also launch the second application of the toolset called PingAlert. The Compact Framework application PingAlert can be started normally to manage the hosts list and it can be started with the argument &#8220;pingsweep&#8221; and then will automatically start to ping all hosts and then exits itself. If there were ping errors, PingAlert will create a HTML file with a report and then start the notification application of this toolset, which is called PingAlertToast.</p>
<p>How do we handle program arguments in compact framework. See program.cs:</p>
<pre lang="csharp">        [MTAThread]
        static void Main(String[] args)
        {
            Application.Run(new Form1(args));
        }
</pre>
<p>and then I change the form constructor code to receive the args string list:</p>
<pre lang="csharp">        public Form1(String[] args)
        {
            InitializeComponent();

            paSettings = new PingAlertSettings();
            readSettings();

            //get cmdLine
            String myArg="";
            if (args.Length == 1)
            {
                myArg = args[0];
                if (myArg.Equals("pingsweep", StringComparison.OrdinalIgnoreCase))
                    bRunAndQuit = true;
            }
</pre>
<p>At the end of pinging the host list, another boolean signals a timer tick event handler, that it is time to quit the app.</p>
<pre lang="csharp">        private void exitTimer1_Tick(object sender, EventArgs e)
        {
            //is it OK to quit now
            if(bQuitIsOK){
                exitTimer1.Enabled = false;
                this.Close();//exit form
            }
        }
</pre>
<p>At the end of the host pings, the third app, PingAlertToast will be started, if there was at least one error:</p>
<pre lang="csharp">...
            if (bte.qData._iCount == numberOfQueuedData)
            {
                //end html
                closeHTML();
                //write report file
                //System.IO.TextWriter stringWriter = new System.IO.StringWriter();
                try
                {
                    System.IO.TextWriter streamWriter = new System.IO.StreamWriter(szHtmlFile);
                    streamWriter.WriteLine(sbHTML);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                catch (Exception x)
                {
                    addLog("Exception in write HTML: " + x.Message);
                }

                //start notification
                showNotification();
                bQuitIsOK = true;
            }
...
</pre>
<p>Ah, what is this qData? To have the GUI still responsive during the ping process, the PingAlert uses a queue to add hosts to ping. The background process reads this queue and ping one by the other as long as there are hosts in the queue.</p>
<p>bgThread2.cs:</p>
<pre lang="csharp">...
    //The blocking function...
    if (_theQueue.Count &amp;gt; 0)
    {
        //dequeue one IP to ping
        lock (_theQueue.SyncRoot)// syncedCollection.SyncRoot)
        {
            _qData = (queueData)_theQueue.Dequeue();// get object from queue
        }

        //System.Net.IPAddress ip;
        try
        {
            _qData.IP = System.Net.Dns.Resolve(_qData.sHost).AddressList[0];
            iPreplies = myPing.PingQdata(ref _qData);
        }
...
</pre>
<p>To be able to have some extra information with the hosts I use a class called QueueData which will hold the hosts to ping, the number of ping retries etc.. You can add hosts using there DNS name or there IP address.</p>
<p><a rel="attachment wp-att-1040" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/pingalert/"><img class="alignnone size-medium wp-image-1040" title="PingAlert" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/PingAlert-193x300.gif" alt="" width="193" height="300" /></a></p>
<p>How can you you disable the schedule? As you know, PingAlertScheduler can be launched with different args. If it is launched without args, it will create a new schedule and terminates itself. If it is launched with &#8220;PingAlert&#8221; it will reschedule itself and launch PingAlert with the arg &#8220;pingsweep&#8221;. If it is launched with the argument &#8220;clear&#8221;, it will clear all existing schedules to PingAlertScheduler.</p>
<p>So, if you want to stop the scheduling, you have to launch PingAlertScheduler with the argument &#8220;clear&#8221;. To do so, you can simply use the button &#8220;Clear Schedule&#8221; in the main PingAlert application.</p>
<p>If you need to start the schedule, you use the button &#8220;Schedule&#8221;. It will simply launch PingAlertSchedule without an argument.</p>
<p>Now to the last of the trio, PingAlertToast. It is written in C/C++ and creates a user notification. You will get a nice symbol in the taskbar and if you click (tap) it, it will show the notification. This is only a reminder notification signaling that some ping failed.</p>
<p><a rel="attachment wp-att-1041" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/pingalerttoast/"><img class="alignnone size-medium wp-image-1041" title="PingAlertToast" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/PingAlertToast-193x300.gif" alt="" width="193" height="300" /></a></p>
<p>If you dont like to keep the notification, just tap (Dismiss). To only hide it tap on (Hide). To get the notification back on screen, tap the small symbol in the taskbar.</p>
<p>Within the notification text is a link which should open your internet browser on the device and that shows the report.</p>
<p><a rel="attachment wp-att-1042" href="http://www.hjgode.de/wp/2011/03/01/mobile-development-pingalert-watch-your-servers-2/pingreport/"><img class="alignnone size-medium wp-image-1042" title="PingReport" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/PingReport-192x300.gif" alt="" width="192" height="300" /></a></p>
<p>The notification API is very strong and enables you to configure nearly everything of the notification. As the API is not fully available in Compact Framework, I did code PingAlertToast in C/C++. Here is the main part creating the notification:</p>
<pre lang="cpp">int showNotification(TCHAR* szText){
	LRESULT lRes=0;
    // This code will add an SHNotification notificaion
    SHNOTIFICATIONDATA sn  = g_shNotificationData;
    sn.cbStruct = sizeof(sn);
    sn.dwID = g_NotificationID;
    sn.npPriority = SHNP_INFORM;
    sn.csDuration = -1;
    sn.hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_SAMPLEICON));
    sn.clsid = guidNotifyApp;
    sn.grfFlags = 0;
    sn.pszTitle = TEXT("PingAlert");
	sn.pszHTML = TEXT("&lt;html&gt;&lt;body&gt;There was at least one error. Please click &lt;a href=\"file:///Windows\\PingAlertReport.html\"&gt;PingAlert Report&lt;/a&gt; for more details.&lt;/body&gt;&lt;/html&gt;");
    sn.rgskn[0].pszTitle = TEXT("Dismiss");
    sn.rgskn[0].skc.wpCmd = g_dwNotificationCmdID1;
	sn.rgskn[0].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_STAYOPEN;
    sn.rgskn[1].pszTitle = TEXT("Hide");
    sn.rgskn[1].skc.wpCmd = g_dwNotificationCmdID2;
	sn.rgskn[1].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_HIDE;
	sn.hwndSink=g_hWnd;
    //Add the notification to the tray
    lRes = SHNotificationAdd(&amp;sn);

    return lRes;
}
</pre>
<p>Take a deeper look at PingAlertToast.cpp to see more details on handling menu taps etc.</p>
<p>Not to forget, the settings are persistent in the registry at HKLM\Software\PingAlert</p>
<pre>REGEDIT4

[HKEY_LOCAL_MACHINE\Software\PingAlert]
"Log2File"=dword:00000000
"TimeInterval"=dword:0000000F
"Hosts"=hex(7):\
67,6F,6F,67,6C,65,2E,63,6F,6D,00,31,39,32,2E,31,36,38,2E,31,32,38,2E,35,\
00,73,6D,61,72,74,00,00
</pre>
<ul>
<li>Log2File specifies if you like to have a log file for PingAlert&#8217;s action in \PingAlert.Log.txt.</li>
<li>TimeInterval specifies the interval between reschedules.</li>
<li>Hosts is a Multi_SZ registry key holding the list of hosts to ping.</li>
</ul>
<hr />
<p><a href="http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2FPingAlert" target="_blank">Code at code.google.com</a></p>
<p>Executable set (copy all into \Windows dir on the device): <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=131" title="Downloaded 200 times">PingAlert Executables Set</a> - PingAlertScheduler, PingAlert and PingAlertToast (Hits: 200, size: 24.02 kB)</p>
<p>Installable CAB file (will place a link in your program folder):  New version 1.1 4. March 2011: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=133" title="Downloaded 55 times">PingAlert Setup CAB v1.1</a> - fixed minor bugs (Hits: 55, size: 24.57 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%2F03%2F01%2Fmobile-development-pingalert-watch-your-servers-2%2F&amp;title=Mobile+Development-PingAlert%3A+watch+your+servers" 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%2F01%2Fmobile-development-pingalert-watch-your-servers-2%2F&amp;title=Mobile+Development-PingAlert%3A+watch+your+servers" 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%2F01%2Fmobile-development-pingalert-watch-your-servers-2%2F&amp;title=Mobile+Development-PingAlert%3A+watch+your+servers" 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%2F01%2Fmobile-development-pingalert-watch-your-servers-2%2F&amp;T=Mobile+Development-PingAlert%3A+watch+your+servers" 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%2F01%2Fmobile-development-pingalert-watch-your-servers-2%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%2F01%2Fmobile-development-pingalert-watch-your-servers-2%2F&amp;t=Mobile+Development-PingAlert%3A+watch+your+servers" 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/01/mobile-development-pingalert-watch-your-servers-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development: a native remote desktop client (rdesktop port win32)</title>
		<link>http://www.hjgode.de/wp/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-a-native-remote-desktop-client-rdesktop-port-win32</link>
		<comments>http://www.hjgode.de/wp/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 06:51:47 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[mstsc]]></category>
		<category><![CDATA[rdesktop]]></category>
		<category><![CDATA[rdesktop-ce]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[rdp_autologin]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[terminal service client]]></category>
		<category><![CDATA[tsc]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows mobile]]></category>
		<category><![CDATA[wpctsc.exe]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=899</guid>
		<description><![CDATA[A native rdesktop port for windows ce and windows mobile to replace Remote Desktop Mobile]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: medium;"><strong>The famous <a href="http://sourceforge.net/projects/rdesktop/" target="_blank">rdesktop</a> running natively on windows ce and windows mobile</strong></span></p>
<h2>Intro and Background</h2>
<p>Some times ago I found that <a href="http://osdir.com/ml/network.rdesktop.user/2006-04/msg00004.html">message of Jay Sorg</a> and retrieved a copy of his code for a native <a href="http://sourceforge.net/projects/rdesktop/" target="_blank">rdesktop</a> win32 version.  I played a little and got the code compile with Visual Studio 2005 with the Windows Mobile SDK.</p>
<p>I tried to implement windows clipboard support to enhance the transfer of texts between the client and server, but unfortunately I was not successful yet. Hopefully someone jumps in and helps enhancing the code and adds some features.</p>
<p>Rdesktop is open source and you can go with the wince implementation here, but if it does not work for you, you have either change the code yourself (and publish it) or find someone that is able to do for you.</p>
<p>There is a template uiports/xxxwin.c in the actual rdesktop source you can use as a starter to compile the actual rdesktop version for windows mobile if you manage to get all the dependencies to work. If you success, forget this post and go with this version (maybe you leave me a note?).</p>
<p><a rel="attachment wp-att-900" href="http://www.hjgode.de/wp/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/screenshot01/"><img class="alignnone size-medium wp-image-900" title="ScreenShot01" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/ScreenShot01-225x300.gif" alt="" width="225" height="300" /></a></p>
<h2>Why another Remote Desktop/Terminal Server Client?</h2>
<p><span id="more-899"></span>The Windows Mobile Remote Desktop Client (or Remote Desktop Mobile, RDM) lacks some useful features available in the Windows CE version or the Desktop Windows version:</p>
<ul>
<li>No automated login</li>
<li>No kiosk mode</li>
<li>Function keys are not sent to server</li>
<li>&#8230;</li>
</ul>
<p>The first item is essential if you like to start a Terminal Server session without user intervention.</p>
<p>The second item is important for using RDM in a production environment.</p>
<p>The third item is useful to run applications on the Terminal Server (TS) that use Function keys.</p>
<h2>Commercial RDM</h2>
<p>There are some commercial remote desktop clients available for windows mobile:</p>
<ul>
<li><a href="http://www.mochasoft.dk/rd.htm">Mochasoft RDP client</a><br />
 &#8220;Windows 200x servers and terminal servers are not supported, as to a Microsoft patent license.&#8221;</li>
<li><a href="http://www.zatelnet.com/zadesktop/main.php">zaDesktop</a><br />
 This is currently in an early state.</li>
<li><a href="http://forum.xda-developers.com/showthread.php?t=292895">RDP Finster</a><br />
 Not really clear where this comes from. </li>
</ul>
<p>I assume some of the commercials are either using mstscax or rdesktop code. Some time ago MS published the <a href="http://msdn.microsoft.com/en-us/library/cc240445%28PROT.10%29.aspx">RDP documentation</a>. Maybe the commercial apps did start from there. Going with the TSC COM library mststcax would be great, but who has the doc for this? For desktop PCs it is documented but not for windows mobile. If someone has a doc to this leave me a note. Then we can start to write a TSC around this library.</p>
<p>There are also some rewritten TSC for the desktop not using mstscax. One is called ProperJavaRDP and maybe a good starting point to rewrite a dotnet based native TSC for windows mobile.</p>
<h2>Usage of the free opensource rdesktop-ce</h2>
<p>You can start winrdesktop on windows mobile either with an ini file or with command line arguments:</p>
<h3>Sample winrdesktop.ini</h3>
<p>(place either in program dir or in root)</p>
<pre>[main]
server=<em>192.168.128.5</em>
port=<em>3389</em>
username=<em>YourUserName</em>
password=<em>YourPassword</em>
bpp=<em>16</em>
geometry=<em>1024x768</em>
#fullscreen
</pre>
<p>server : provide the server IP or DNS host name<br />
 port : provide the port to use for RDP, usually 3389<br />
 username : provide the login user name for the terminal client session<br />
 password : provide the password of the user<br />
 bpp : define the bits per pixel to be used (number of colors per pixel)<br />
 geometry : define the size of the remote desktop window width x height An application to be used on windows mobile devices should match the screen size of the device. For example 240&#215;320 (QVGA). Otherwise the user has to scroll the window to get access to all of the remote screen.<br />
 fullscreen : <span style="text-decoration: line-through;">currently not supported</span></p>
<hr />
<h3>UPDATE 23. nov 2010:</h3>
<p>fullscreen now supported. Fullscreen will switch rdesktop to not show a caption and no menu bar. If geometry matches the device&#8217;s screen size, there will also be no scrollbars.</p>
<p><a rel="attachment wp-att-914" href="http://www.hjgode.de/wp/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/screenshotfullscreen/"><img class="alignnone size-medium wp-image-914" title="ScreenShotFullscreen" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/ScreenShotFullscreen-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>This screenshot was taken of an app I wrote running on a Windows 2003 server of a QVGA device with following winrdesktop.ini:</p>
<pre>[main]
server=192.168.128.5
port=3389
username=rdesktop
password=rdesktop
bpp=16
geometry=240x320
fullscreen
</pre>
<hr />
<h2>Rdesktop usage</h2>
<h3>Command line</h3>
<pre>WinRDesktop [-g widthxheight] [-t port] [-a bpp]
    [-f] [-u username] [-p password] [-d domain]
    [-s shell] [-c working directory] [-n host name]
    server-name-or-ip
</pre>
<p>options are the same as in winrdesktop.ini plus:</p>
<pre>-d <em>domain</em> : specify the domain of the user login
-s <em>shell</em> : define a shell to use on TSC
-c <em>working directory</em> : define a working directory for the session
-n <em>host name</em> : specify the host name to use for the client (visible on TSC)
</pre>
<h2>Restrictions of current code</h2>
<p>See <a href="http://code.google.com/p/rdesktop-ce/issues/list?thanks=2&amp;ts=1290249303" target="_blank">googlecode issues</a> for a list of known restrictions.</p>
<h2>Downloads</h2>
<p><a href="http://code.google.com/p/rdesktop-ce/downloads/list">Windows Mobile Executable and INI sample file at googlecode</a><br />
 Source code: see <a href="http://code.google.com/p/rdesktop-ce/source/checkout">googlecode</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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%2F&amp;title=Mobile+Development%3A+a+native+remote+desktop+client+%28rdesktop+port+win32%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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%2F&amp;title=Mobile+Development%3A+a+native+remote+desktop+client+%28rdesktop+port+win32%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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%2F&amp;title=Mobile+Development%3A+a+native+remote+desktop+client+%28rdesktop+port+win32%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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%2F&amp;T=Mobile+Development%3A+a+native+remote+desktop+client+%28rdesktop+port+win32%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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%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%2F2010%2F11%2F20%2Fmobile-development-a-native-remote-desktop-client-rdesktop-port-win32%2F&amp;t=Mobile+Development%3A+a+native+remote+desktop+client+%28rdesktop+port+win32%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/2010/11/20/mobile-development-a-native-remote-desktop-client-rdesktop-port-win32/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Mobile Development: Disable Windows Mobile 6.5 Start and Close Button</title>
		<link>http://www.hjgode.de/wp/2010/11/18/mobile-development-disable-windows-mobile-6-5-start-and-close-button/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-disable-windows-mobile-6-5-start-and-close-button</link>
		<comments>http://www.hjgode.de/wp/2010/11/18/mobile-development-disable-windows-mobile-6-5-start-and-close-button/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 13:03:47 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[6.5.3]]></category>
		<category><![CDATA[Close Button]]></category>
		<category><![CDATA[DotNet]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[sender-as-rectangle-windows-ce]]></category>
		<category><![CDATA[Start Button]]></category>
		<category><![CDATA[Subclassing]]></category>
		<category><![CDATA[taskbar]]></category>
		<category><![CDATA[windows mobile]]></category>
		<category><![CDATA[WM65]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=888</guid>
		<description><![CDATA[Windows Mobile 6.5.3. Class to subclass menu toolbar to disable Start and Close button clicks.]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>here is one other way to write a kios mode .NET application using a technique called SubClassing. The idea was born by a comment of redwolf2222 on this blog about how to <a href="http://www.hjgode.de/wp/2010/10/11/windows-mobile-hide-startbutton-in-winmo-6-5-x/">Hide Start and Close buttons on Windows Mobile 6.5 devices</a>. Redwolf2222 also provided a code snippet. Unfortunately it was incomplete and so I wrote my own class.</p>
<p><strong>Disable clicks on Start and Close button</strong></p>
<p>The demo project shows one dialog with two check boxes and you can easily test the function. If &#8220;StartButton Disabled&#8221; or &#8220;Close Button disabled&#8221; is checked, you cannot &#8216;click&#8217; the corresponding button any more:</p>
<p><a rel="attachment wp-att-889" href="http://www.hjgode.de/wp/2010/11/18/mobile-development-disable-windows-mobile-6-5-start-and-close-button/startbuttoncontrolwm65_2/"><img class="alignnone size-medium wp-image-889" title="StartButtonControlWM65" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/StartButtonControlWM65_2-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>You still &#8216;click&#8217; the buttons but the subclassed window will not &#8216;execute&#8217; your click. The buttons are part of the toolbar32 window which is a child of the menu_worker window. So first we have to follow the window tree.</p>
<p><strong>Find the right window</strong></p>
<pre escaped="true" line="1" lang="csharp">/// &lt;summary&gt;
/// SubClassing: Install the wndproc hook
/// &lt;/summary&gt;
/// &lt;returns&gt;&lt;/returns&gt;
private bool hookWindow()
{
    //find taskbar
    IntPtr hWndTaskbar = FindWindow("HHTaskbar", IntPtr.Zero);
    if (hWndTaskbar == IntPtr.Zero)
        return false;
    //enable the taskbar, not realy necessary
    EnableWindow(hWndTaskbar, 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><strong>Subclassing</strong></p>
<p>Now, as we have the window handle, the subclassing can be started:<br />
 <span id="more-888"></span></p>
<pre escaped="true" line="1" lang="csharp">private void SubclassHWnd(IntPtr hWnd)
{
    // hWnd is the window you want to subclass..., create a new
    // delegate for the new wndproc
    newWndProc = new Win32WndProc(MyWndProc);
    // subclass
    oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc);
}
</pre>
<p>The installation of the &#8216;hook&#8217; is very simple. Just use SetWindowLong with the new window procedure. The old, original window procedure is saved for later use. We need it for example to call it for clicks outside the buttons and for all messages we don&#8217;t care about.</p>
<p>The &#8216;hook&#8217; or better the redirection will remain active until you install the old window procedure. So your device&#8217;s start and close button will not &#8216;work&#8217; as long as the hook is in place.</p>
<p><strong>The new window procedure</strong></p>
<pre escaped="true" line="1" lang="csharp">// this is the new wndproc, just show a messagebox on left button down:
private IntPtr MyWndProc(IntPtr hWnd, int msg, int wParam, int lParam)
{
    //is this a message for us?
    if (((msg == (int)WM_LBUTTONDOWN) || (msg == (int)WM_LBUTTONUP)) &amp;&amp; (this._mIsStartButtonDisabled || this._mIsCloseButtonDisabled) )
    {
        int x = ((int)lParam) &amp; 0xFFFF;
        int y = ((int)lParam) &gt;&gt; 16;

        bool isVGA;
        bool isQVGA;
        using (System.Windows.Forms.Control detector = new System.Windows.Forms.Control())
        {
            using (System.Drawing.Graphics gr = detector.CreateGraphics())
            {
                isVGA = gr.DpiY == 192;
                isQVGA = gr.DpiY == 96;
            }
        }

        RECT rect;
        GetWindowRect(hWnd, out rect); //get the rectangle of the menu_bar

        int width = Math.Max(rect.Left, rect.Right) - Math.Min(rect.Left, rect.Right);
        int height = Math.Max(rect.Bottom, rect.Top) - Math.Min(rect.Bottom, rect.Top);

        //width values are assumed
        int buttonWidth = (isQVGA | isVGA) ? 92 : 46;
        int buttonHeight = height; //(isQVGA | isVGA) ? 72 : 36;

        System.Drawing.Rectangle rectStartButton = new System.Drawing.Rectangle(0, 0, buttonWidth, buttonHeight);
        System.Drawing.Rectangle rectCloseButton = new System.Drawing.Rectangle(width - buttonWidth, 0, buttonWidth, buttonHeight);

        //check if enabled and click is inside the start or close button rectangle
        if(this._mIsStartButtonDisabled &amp;&amp; rectStartButton.Contains(x, y))
            return IntPtr.Zero;
        if (this._mIsCloseButtonDisabled &amp;&amp; rectCloseButton.Contains(x, y))
            return IntPtr.Zero;

        //if both are false, we have to provide the click to windows
        return CallWindowProc(oldWndProc, hWnd, msg, wParam, lParam);
    }
    else
        return CallWindowProc(oldWndProc, hWnd, msg, wParam, lParam);
}
</pre>
<p>Subclassing the window means that we redirect the window message procedure of the found window to our own, custom window procedure. This new procedure checks for WM_LBUTTONDOWN and WM_LBUTTONUP messages. Then the click position is checked and discarded if within the rectangle area of the Start and/or Close button. If the position is outside the calculated rectangles, the original window procedure is called.</p>
<p><strong>The demo code</strong></p>
<pre escaped="true" line="1" lang="csharp">public partial class StartButtonControl : Form
{
    StartButtonWM65.hwndutils _hwndutils = new StartButtonWM65.hwndutils();
    private bool _bInitializing = true;
    public StartButtonControl()
    {
        InitializeComponent();
        this.chkDisableStartButton.Checked = this._hwndutils.StartButtonDisabled;
        _bInitializing = false;
    }

    private void chkDisableStartButton_CheckStateChanged(object sender, EventArgs e)
    {
        if (_bInitializing)
            return;
        this._hwndutils.StartButtonDisabled = chkDisableStartButton.Checked;
    }

    private void mnuExit_Click(object sender, EventArgs e)
    {
        _hwndutils.Dispose();
        Application.Exit();
    }

    private void StartButtonControl_Closing(object sender, CancelEventArgs e)
    {
        _hwndutils.Dispose();
        Application.Exit();
    }

    private void chkCloseButton_CheckStateChanged(object sender, EventArgs e)
    {
        if (_bInitializing)
            return;
        this._hwndutils.CloseButtonDisabled = chkCloseButton.Checked;
    }
}
</pre>
<p>As you see, the usage of the class hwndutils is very simple. Dont forget to Dispose the hwndutils object before you exit your app.</p>
<p><strong>Downloads</strong><br />
 Visual Studion 2008 solution with demo project targeting Windows Mobile 6 SDK: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=128" title="Downloaded 831 times">StartButtonHookWM65 VS2008 source code and demo project</a> -  (Hits: 831, size: 18.53 kB)</p>
<p>Thanks to redwolf2222 for the great idea.</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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%2F&amp;title=Mobile+Development%3A+Disable+Windows+Mobile+6.5+Start+and+Close+Button" 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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%2F&amp;title=Mobile+Development%3A+Disable+Windows+Mobile+6.5+Start+and+Close+Button" 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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%2F&amp;title=Mobile+Development%3A+Disable+Windows+Mobile+6.5+Start+and+Close+Button" 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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%2F&amp;T=Mobile+Development%3A+Disable+Windows+Mobile+6.5+Start+and+Close+Button" 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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%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%2F2010%2F11%2F18%2Fmobile-development-disable-windows-mobile-6-5-start-and-close-button%2F&amp;t=Mobile+Development%3A+Disable+Windows+Mobile+6.5+Start+and+Close+Button" 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/2010/11/18/mobile-development-disable-windows-mobile-6-5-start-and-close-button/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mobile Development &#8211; Reset Device password</title>
		<link>http://www.hjgode.de/wp/2010/09/17/mobile-development-reset-device-password/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-reset-device-password</link>
		<comments>http://www.hjgode.de/wp/2010/09/17/mobile-development-reset-device-password/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 11:14:49 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[ControlPanel/Owner]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[power on]]></category>
		<category><![CDATA[PowrPass]]></category>
		<category><![CDATA[Security/SIM]]></category>
		<category><![CDATA[unlock]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=814</guid>
		<description><![CDATA[How to reset Windows Mobile device lock/PowerOn password.]]></description>
			<content:encoded><![CDATA[<p>Some times ago, I got a device locked with a password. As I needed to access the device using ActiveSync I did some research and found the registry keys responsible for the device password:<br />
 HKLM\Security\SIM\6fb7<br />
 HKCU\ControlPanel\Owner\PowrPass</p>
<p>So I wrote a small application which resets the device password.</p>
<p><span id="more-814"></span>You can use the code in your application to remove the password protection of your device.</p>
<p>But how can you start the app, as you cannot unlock it? If your device supports a memory card, you can use the OS feature that start an app called AutoRun.exe in a special dir of the memory card. The special dir for ARM processor based devices is 2577. If you place the PassReset.exe as AutoRun.exe in \2577 of the memory card and then place the mem card in the device and reboot the device, the OS will automatically start the app. So you can start ResetPass without having access to file explorer etc.</p>
<pre escaped="true" lang="c">// PassReset.cpp : Defines the entry point for the application.
//

#include "stdafx.h"

int resetPassworkLock(){
    int iRet=0;
    HKEY hKey;
    byte *pBuf= new byte[255];
    HRESULT hRes=0;
    DWORD dwType=REG_BINARY;
    DWORD dwCount=0;

    hRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Security\\SIM", 0, 0, &amp;hKey);

    if(hRes == ERROR_SUCCESS){
        hRes = RegSetValueEx(hKey, L"6fb7", 0, dwType, NULL, dwCount);
        if(hRes==ERROR_SUCCESS){
            RegCloseKey(hKey);
            hRes = RegOpenKeyEx(HKEY_CURRENT_USER, L"ControlPanel\\Owner", 0, 0, &amp;hKey);
            if(hRes == ERROR_SUCCESS){
                pBuf[0]=0x00;
                dwCount=1;
                hRes = RegSetValueEx(hKey, L"PowrPass", 0, dwType, pBuf, dwCount);
                if(hRes==ERROR_SUCCESS){
                    RegCloseKey(hKey);
                }
                else
                    iRet=-4; //error in setValue for PowrPass
            }
            else
                iRet=-3; //error in OpenKey for ControlPanel/Owner?
        }
        else
            iRet=-2; //error in setValue for 6fb7
        RegCloseKey(hKey);
    }
    else
        iRet=-1; //error in openKey for Security/SIM

    return iRet;
}

int WINAPI WinMain( HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPTSTR    lpCmdLine,
                    int       nCmdShow)
{
    // TODO: Place code here.
    TCHAR *errStr[5];
    errStr[0]=new TCHAR[]=L"No error";
    errStr[1]=new TCHAR[]=L"error in openKey for Security/SIM";
    errStr[2]=new TCHAR[]=L"error in setValue for 6fb7";
    errStr[3]=new TCHAR[]=L"error in OpenKey for ControlPanel/Owner";
    errStr[4]=new TCHAR[]=L"error in setValue for PowrPass";

    int iRet = resetPassworkLock();
    MessageBox(GetDesktopWindow(), errStr[abs(iRet)], L"PassReset", MB_OK);
    return iRet;
}
</pre>
<p>Download:<br />
 <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=121" title="Downloaded 338 times">PassReset evc4 source code</a> -  (Hits: 338, size: 10.38 kB)<br />
 <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=122" title="Downloaded 352 times">PassReset ARM executable</a> - Rename to AutoRun.exe and place in directory 2577 of your memory card to have it run automatically on reboot. (Hits: 352, size: 1.3 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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%2F&amp;title=Mobile+Development+%26%238211%3B+Reset+Device+password" 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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%2F&amp;title=Mobile+Development+%26%238211%3B+Reset+Device+password" 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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%2F&amp;title=Mobile+Development+%26%238211%3B+Reset+Device+password" 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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%2F&amp;T=Mobile+Development+%26%238211%3B+Reset+Device+password" 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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%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%2F2010%2F09%2F17%2Fmobile-development-reset-device-password%2F&amp;t=Mobile+Development+%26%238211%3B+Reset+Device+password" 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/2010/09/17/mobile-development-reset-device-password/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mobile development &#8211; a WiFi signal strength indicator</title>
		<link>http://www.hjgode.de/wp/2010/09/07/mobile-development-wifi-signal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-wifi-signal</link>
		<comments>http://www.hjgode.de/wp/2010/09/07/mobile-development-wifi-signal/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 13:08:46 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[get-signal-strength-on-wince]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[ndisuio]]></category>
		<category><![CDATA[pocketpc]]></category>
		<category><![CDATA[RSSI]]></category>
		<category><![CDATA[taskbar]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wirless]]></category>
		<category><![CDATA[wlan]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=797</guid>
		<description><![CDATA[A simple taskbar addon showing the WiFi signal strength]]></description>
			<content:encoded><![CDATA[<p>Here is one more windows mobile taskbar addon. I have seen many people are interested in these small widgets. This one shows the signal strength of the current associated access point in your taskbar.</p>
<p style="text-align: center;"><a rel="attachment wp-att-798" href="http://www.hjgode.de/wp/2010/09/07/mobile-development-wifi-signal/screenshotwlanrssi/"><img class="alignnone size-medium wp-image-798" title="ScreenShotWlanRssi" src="http://www.hjgode.de/wp/wp-content/uploads/2010/09/ScreenShotWlanRssi-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>The code is the same as with the other taskbaraddons you find here, only the code for wireless signal strength has been added. Oh, yes, and this addon uses small bitmaps to show the signal strength.</p>
<p style="text-align: center;"><a rel="attachment wp-att-799" href="http://www.hjgode.de/wp/2010/09/07/mobile-development-wifi-signal/wlan-signal/"><img class="alignnone size-full wp-image-799" title="wlan-signal" src="http://www.hjgode.de/wp/wp-content/uploads/2010/09/wlan-signal.gif" alt="" width="137" height="29" /></a></p>
<p>To get the signal strength I use part of PeekPocket code submission at CodeProject. I only need the name of the first wireless adapter.</p>
<p><span id="more-797"></span></p>
<pre escaped="true" line="1" lang="c">CWifiPeek m_wp;
TCHAR* szAdapterName=new TCHAR[64];

ULONG GetCurrentValue(){
    WCHAR buf[1024];
    DWORD dwSize;
    dwSize=sizeof(buf);
    if(false == m_wp.GetAdapters(buf, dwSize) || dwSize == 0)
    {
        return UNKNOWERROR;
    }
    else{
        //we are only interested in first returned name
        wsprintf(szAdapterName, L"%s", buf);
        int iRSSI=0;
        int iRes = GetSignalStrength(szAdapterName, &amp;iRSSI);
        if(iRes == ERROR_SUCCESS){
            return iRSSI;
        }
        else{
            return LOADLIBFAILED;
        }
    }
}
</pre>
<p>(<small><a class="linkification-ext" title="Linkification: http://www.codeproject.com/KB/windows/PeekPocket.aspx" href="http://www.codeproject.com/KB/windows/PeekPocket.aspx">http://www.codeproject.com/KB/windows/PeekPocket.aspx</a>)</small></p>
<p>Then the signal strength is queried using another code snippet:</p>
<pre escaped="true" line="1" lang="c">INT GetSignalStrength(TCHAR *ptcDeviceName, INT *piSignalStrength)
{
    PNDISUIO_QUERY_OID queryOID;
    DWORD dwBytesReturned = 0;
    UCHAR QueryBuffer[sizeof(NDISUIO_QUERY_OID)+sizeof(DWORD)];
    HANDLE ndisAccess = INVALID_HANDLE_VALUE;
    BOOL retval;
    INT hr;

    // Attach to NDISUIO.
    ndisAccess = CreateFile(NDISUIO_DEVICE_NAME, 0, 0, NULL,
    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
    INVALID_HANDLE_VALUE );

    if (ndisAccess == INVALID_HANDLE_VALUE)
        return -1;

    // Get Signal strength
    queryOID = (PNDISUIO_QUERY_OID)&amp;QueryBuffer[0];
    queryOID-&gt;ptcDeviceName = ptcDeviceName;
    queryOID-&gt;Oid = OID_802_11_RSSI;

    retval = DeviceIoControl(ndisAccess,
    IOCTL_NDISUIO_QUERY_OID_VALUE, (LPVOID)queryOID,
    sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD), (LPVOID)queryOID,
    sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD), &amp;dwBytesReturned, NULL);

    if (retval &amp;&amp; piSignalStrength)
    {
        hr = 0;
        *piSignalStrength = *(DWORD *)&amp;queryOID-&gt;Data;
    }
    else
    {
        hr = -2;
    }

    CloseHandle(ndisAccess);

    return(hr);
}
</pre>
<p><small>(<a class="linkification-ext" title="Linkification: http://www.pcreview.co.uk/forums/thread-1306359.php" href="http://www.pcreview.co.uk/forums/thread-1306359.php">http://www.pcreview.co.uk/forums/thread-1306359.php</a>)</small></p>
<h2>Downloads</h2>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=118" title="Downloaded 509 times">TaskbarAddon5</a> - Windows Mobile taskbar addon showing the signal strength of associated access point (Hits: 509, size: 178.63 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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%2F&amp;title=Mobile+development+%26%238211%3B+a+WiFi+signal+strength+indicator" 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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%2F&amp;title=Mobile+development+%26%238211%3B+a+WiFi+signal+strength+indicator" 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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%2F&amp;title=Mobile+development+%26%238211%3B+a+WiFi+signal+strength+indicator" 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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%2F&amp;T=Mobile+development+%26%238211%3B+a+WiFi+signal+strength+indicator" 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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%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%2F2010%2F09%2F07%2Fmobile-development-wifi-signal%2F&amp;t=Mobile+development+%26%238211%3B+a+WiFi+signal+strength+indicator" 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/2010/09/07/mobile-development-wifi-signal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

