<?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; Keyboard</title>
	<atom:link href="http://www.hjgode.de/wp/category/programming/keyboard-programming/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>Windows Mobile &#8211; the no-go world of Function Keys</title>
		<link>http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-mobile-the-no-go-world-of-function-keys</link>
		<comments>http://www.hjgode.de/wp/2011/12/20/windows-mobile-the-no-go-world-of-function-keys/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 09:07:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Mobile Information]]></category>
		<category><![CDATA[AllKeys]]></category>
		<category><![CDATA[Function Key]]></category>
		<category><![CDATA[Internet Explorer Mobile]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[UnregisterFunc1]]></category>
		<category><![CDATA[windows mobile]]></category>

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

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1233</guid>
		<description><![CDATA[Hello at KeyWedge I posted my code that connects to a serial port and then simulates keystrokes into your application. Now, there were issues where the reconnect did not automatically take place after a Suspend/Resume and you had to invoke the main window and select File-Hide just to let KeyWedge reconnect. This happens on devices [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>at <a title="KeyWede Post" href="http://www.hjgode.de/wp/2009/10/22/keywedge-a-serial-port-to-keyboard-message-connector/">KeyWedge </a>I posted my code that connects to a serial port and then simulates keystrokes into your application.</p>
<p>Now, there were issues where the reconnect did not automatically take place after a Suspend/Resume and you had to invoke the main window and select File-Hide just to let KeyWedge reconnect. This happens on devices that provide the communication port all the time and dont close it during a suspend.</p>
<p>I have added some code to watch the Windows Mobile Power Message Queue for RESUM messages and then do an automatic reconnect. The other option would have been to send some data thru the port periodically to check if it is still working. But this may disturb the attached the device.</p>
<p>The main change is in PowerMsgQueue.cpp. It implements the msg queue to receive power broadcast messages like done in a MSDN example code. If a resume message is encountered, the code sends a WM_USER message to the main window, which will do a SuspendComm/ResumeComm cycle. Very easy.</p>
<p>In PowerMsgQueue.cpp we have code that recognizes the resume:</p>
<pre lang="cpp">                case PBT_TRANSITION:
                    nclog(L"Power Notification Message: PBT_TRANSITION\n");
                    //Add2Log(L"Power Notification Message: PBT_TRANSITION\n",TRUE);
                    nclog(L"Flags: %lx\n", ppb-&gt;Flags);
                    nclog(L"Length: %d\n", ppb-&gt;Length);
                    wsprintf(szPBtype, L"trans.: ");
/*
Flags: 12010000
Length: 6
trans.: ON|PASSWORD|BACKLIGHTON|
*/
                    if(ppb-&gt;Flags &amp; 0x12010000)
                    {
                        nclog(L"PwrMsgQueue: got 'ON|PASSWORD|BACKLIGHTON'...\n");
                        //send a message to main window
                        iPost = PostMessage(hwndMain, WM_USER_RESUMECOMM, 0, 0);
                        nclog(L"PostMessage WM_USER_RESUMECOMM returned %i\n", iPost);
                    }
                    break; 

                case PBT_RESUME:
                    nclog(L"Power Notification Message: PBT_RESUME\n");
                    //Add2Log(L"Power Notification Message: PBT_RESUME\n",TRUE);
                    wsprintf(szPBtype, L"resume: ");
                    //send a message to main window
                    iPost = PostMessage(hwndMain, WM_USER_RESUMECOMM, 0, 0);
                    nclog(L"PostMessage WM_USER_RESUMECOMM returned %i\n", iPost);
                    nclog(L"Power: PBT_RESUME\n");
                    break;</pre>
<p>To not block the queue, I use PostMessage to inform the main window of the Resume. Here is the simple code block in WndProc of the main window:</p>
<p><span id="more-1233"></span></p>
<pre lang="cpp">        case WM_USER_RESUMECOMM: //will be called from bg thread after suspend/resume
            nclog(L"WndProc: received WM_USER_RESUMECOMM: restarting COMM\n");
            suspendCOMM();
            Sleep(100);
            resumeCOMM(); //suspend is called in MYMSG_TASKBARNOTIFY
            break;</pre>
<p>The msgQueue thread is created in InitInstance of the main window:</p>
<pre lang="cpp">    //create PowerResume watchdog thread
    hwndMain=hWnd;
    if(startMsgThread()==0)
        nclog(L"InitInstance: startMsgThread() OK\r\n");
    else
        nclog(L"InitInstance: startMsgThread() FAILED\r\n");

    //helps
    resumeCOMM();

    ShowWindow(hWnd, SW_HIDE);//nCmdShow);
    UpdateWindow(hWnd);</pre>
<p>Have fun coding</p>
<p>Josef</p>
<p>VS2008 WM6 SDK Project: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=145" title="Downloaded 34 times">KeyWedge 2</a> -  (Hits: 34, size: 682.7 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%2F11%2F10%2Fkeywedge-updated%2F&amp;title=KeyWedge%3A+Updated" 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%2F11%2F10%2Fkeywedge-updated%2F&amp;title=KeyWedge%3A+Updated" 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%2F11%2F10%2Fkeywedge-updated%2F&amp;title=KeyWedge%3A+Updated" 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%2F11%2F10%2Fkeywedge-updated%2F&amp;T=KeyWedge%3A+Updated" 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%2F11%2F10%2Fkeywedge-updated%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%2F11%2F10%2Fkeywedge-updated%2F&amp;t=KeyWedge%3A+Updated" 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/11/10/keywedge-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KeyToggleStart: Yet another usage for keyboard hook</title>
		<link>http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=keytogglestart-yet-another-usage-for-keyboard-hook</link>
		<comments>http://www.hjgode.de/wp/2011/09/08/keytogglestart-yet-another-usage-for-keyboard-hook/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 10:56:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[function keys]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[windows mobile]]></category>

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

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

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

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

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=877</guid>
		<description><![CDATA[A class to manage remapping of usb and direct keys on intermec mobile computers.]]></description>
			<content:encoded><![CDATA[<p>Although Intermec provides a control panel and an API to remap keys for Intermec Mobile Computers these tools only support normal remappings. This means for example you can remap a hardware key to produce a virtual key code. But you cannot map a key to the other great possibilities of the keyboard driver:</p>
<ul>
<li>switch the keyboard plane (shiftkey)</li>
<li>map as modifier key</li>
<li>map as rotate key (one that produce abc depending on how often you press is)</li>
<li>multikey that produces a sequence of key strokes</li>
<li>event key, one that fires a named event pair (like the scan button does)</li>
<li>a function key that executes a function inside a DLL </li>
</ul>
<p>I also added classes to manage the used tables as for example MultiKeys, ShiftKeys, RotateKeys, ModifierKeys and so on.</p>
<p>As an example on how the the USB codes are layed out on a device. Unfortunately I only have mappings of this device and not for the others. Therefor you can only suggest the key to remap by the printing on the key.</p>
<p><a rel="attachment wp-att-878" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/ck61-keyboard/"><img class="alignnone size-full wp-image-878" title="ck61-keyboard" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/ck61-keyboard.bmp" alt="" width="234" height="300" /></a></p>
<p>There is no support in the Intermec tools to remap directKeys. For example the side buttons of a CN3 or CN4 or the PTT button of the CK3 are not managed via the usb keyboard driver, these are managed by a direct keyboard driver. ITCKEYBOARD enables you to remap this keys thru an API.</p>
<p><span id="more-877"></span>The ITCKEYBOARD namespace and the CUsbKeys and CDirectKeys classes are still in development and I started a google code project to invite you to collaborate. You are free to download and use the classes, the code is released under GPL v3 license. As this is a project in development, there is no warranty for anything.</p>
<p>The other reason I started to use googlecode was to get familar with a version control system. So forgive me, if I do or did something wrong with svn.</p>
<p>The classes are documented inline and an offline documentation is generated with Doxygen. On my windows developer PC I use AnkhSVN and on an Ubuntu PC (documentation only) I use the svn command line tool. On Windows you may also use TortoiseSVN, which integrates into the file explorer whereas AnkhSVN integrates into Visual Studio.</p>
<p>Both keyboard driver mappings are controlled thru the registry of the intermec device (see community.intermec.com for a doc called <a title="Reprogramming the USB keypad" href="http://community.intermec.com/t5/General-Development-Developer/Keypad-remap/m-p/84#M24" target="_blank">reprogramming the usb keypad</a>). The ITCKEYBOARD namespace provides you managed, strongly typed access to these registry tables. For example the USB keyboard mappings are controlled by a sequence of 6 bytes for every key. These bytes define the key function and are concatenated in the registry into one binary registry value. The ITCKEYBOARD classes take this binary value and splits it into the single key sequences for easy managing.</p>
<h2>Screenshots of a small Demo</h2>
<h3>The demo start and DirectKeys screen</h3>
<p><a rel="attachment wp-att-881" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/demostart/"><img class="alignnone size-medium wp-image-881" title="DemoStart" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/DemoStart-225x300.gif" alt="" width="225" height="300" /> </a><a rel="attachment wp-att-879" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/demodirectkeys/"><img class="alignnone size-medium wp-image-879" title="DemoDirectKeys" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/DemoDirectKeys-225x300.gif" alt="" width="225" height="300" /></a></p>
<h3>DirectKey event management and USBKey demo form</h3>
<p><a rel="attachment wp-att-880" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/demodirectkeysevents/"><img class="alignnone size-medium wp-image-880" title="DemoDirectKeysEvents" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/DemoDirectKeysEvents-225x300.gif" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-882" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/demousbkeys/"><img class="alignnone size-medium wp-image-882" title="DemoUSBkeys" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/DemoUSBkeys-225x300.gif" alt="" width="225" height="300" /></a></p>
<h3>In insight view with the dumpscreen</h3>
<p><a rel="attachment wp-att-883" href="http://www.hjgode.de/wp/2010/11/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/demousbkeysdump/"><img class="alignnone size-medium wp-image-883" title="DemoUSBkeysDump" src="http://www.hjgode.de/wp/wp-content/uploads/2010/11/DemoUSBkeysDump-225x300.gif" alt="" width="225" height="300" /></a></p>
<h2>Sample usage</h2>
<pre escaped="true" line="1" lang="csharp">            //create a new, empty usbkey
            CUSBkeys.usbKeyStruct _theKey = new CUSBkeys.usbKeyStruct();
            _theKey.bHID = 0x07;
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.NoRepeat;// UsbKeyFlags2.NoRepeat;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.RotateKeyIndex;// UsbKeyFlags3.RotateKeyIndex;

            //initialize a new usbkey object
            CUSBkeys _cusb = new CUSBkeys();

            //ShiftPlane 1 ####################################################
            //CAPS lock on "1"
            // 'ModKey2' = 00,02,08,58 //caps lock
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.NoRepeat;// UsbKeyFlags2.NoRepeat;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.ModifierIndex;// UsbKeyFlags3.ModifierIndex;
            _theKey.bIntScan = 0x02; //ModKey index at 2 is caps lock
            _theKey.bScanKey =  (CUsbKeyTypes.HWkeys)0x1E;
            if (_cusb.setKey(2, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(2, _theKey);

            //space on "0"
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.VKEY;// UsbKeyFlags2.VKEY;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.NormalKey;// UsbKeyFlags3.NormalKey;
            _theKey.bIntScan = 0x20;
            _theKey.bScanKey = (CUsbKeyTypes.HWkeys)0x27;
            if (_cusb.setKey(2, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(2, _theKey);

            //remap (OK) to "@" (Shifted-Space)
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.VKEY | CUsbKeyTypes.usbFlagsMid.Shifted;// UsbKeyFlags2.Shifted;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.NormalKey;// UsbKeyFlags3.NormalKey;
            _theKey.bIntScan = 0x32;
            _theKey.bScanKey = CUsbKeyTypes.HWkeys.Right_GUI;
            if (_cusb.setKey(2, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(2, _theKey);

            //ShiftPlane 1 ####################################################
            //VKLWIN='Left GUI' on "0", 07,27,00,01,00,1F (07,E3,00,01,00,1F)
            //remap "0" on shift plane 1 to VK_LWIN (windows key)
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.Extended;// UsbKeyFlags2.Extended;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.NormalKey;// UsbKeyFlags3.NormalKey;
            _theKey.bIntScan = 0x1F;
            _theKey.bScanKey = (CUsbKeyTypes.HWkeys)0x27;
            if (_cusb.setKey(1, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(1, _theKey);

            //change the top row of keys to F1 to F4
            _theKey.bHID = 0x07;
            _theKey.bScanKey = CUsbKeyTypes.HWkeys.Left_GUI;
            _theKey.bFlagHigh = CUsbKeyTypes.usbFlagsHigh.NoFlag;// UsbKeyFlags3.NoFlag;
            _theKey.bFlagMid = CUsbKeyTypes.usbFlagsMid.VKEY;// UsbKeyFlags2.VKEY;
            _theKey.bFlagLow = CUsbKeyTypes.usbFlagsLow.NormalKey;// UsbKeyFlags3.NormalKey;
            _theKey.bIntScan = 0x70; //F1
            if (_cusb.setKey(0, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(0, _theKey);

            _theKey.bScanKey = CUsbKeyTypes.HWkeys.F1;
            _theKey.bIntScan = (byte)VKEY.VK_PRIOR;//PageUp // 0x71; //F2
            if (_cusb.setKey(0, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(0, _theKey);

            _theKey.bScanKey = CUsbKeyTypes.HWkeys.F2;
            _theKey.bIntScan = (byte)VKEY.VK_NEXT;//PgDwn 0x72; //F3
            if (_cusb.setKey(0, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(0, _theKey);

            _theKey.bScanKey = CUsbKeyTypes.HWkeys.Right_GUI;
            _theKey.bIntScan = 0x73; //F3
            if (_cusb.setKey(0, _theKey.bScanKey, _theKey) != 0)
                _cusb.addKey(0, _theKey);

            _cusb.writeKeyTables(); //save the changes

            // DIRECT Keys stuff
            //remap PTT to @
            CDirectKeys _directKeys = new CDirectKeys(); //create a new directkey object
            _directKeys.setKey(0x02, VKEY.VK_SPACE, CDirectKeys.directKeyType.kTypeShiftdVirtualKey);
            _directKeys.saveKeyTable(); //save the changes
            _directKeys = null;
</pre>
<p>Source Code (Visual Studio 2005, Windows Mobile 6 Prof. SDK). (Work in progress)<br />
 <a class="linkification-ext" title="Linkification: http://code.google.com/p/itc-keyboard/" href="http://code.google.com/p/itc-keyboard/">http://code.google.com/p/itc-keyboard/</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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%2F&amp;title=ITCKeyboard%3A+a+class+to+manage+ITC+keyboard+mappings" 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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%2F&amp;title=ITCKeyboard%3A+a+class+to+manage+ITC+keyboard+mappings" 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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%2F&amp;title=ITCKeyboard%3A+a+class+to+manage+ITC+keyboard+mappings" 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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%2F&amp;T=ITCKeyboard%3A+a+class+to+manage+ITC+keyboard+mappings" 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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%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%2F06%2Fitckeyboard-a-class-to-manage-itc-keyboard-mappings%2F&amp;t=ITCKeyboard%3A+a+class+to+manage+ITC+keyboard+mappings" 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/06/itckeyboard-a-class-to-manage-itc-keyboard-mappings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development: another keyboard hooking tool: keyToggleCtrl</title>
		<link>http://www.hjgode.de/wp/2010/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-another-keyboard-hooking-tool-keytogglectrl</link>
		<comments>http://www.hjgode.de/wp/2010/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 14:41:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=732</guid>
		<description><![CDATA[This is again a keyToggle application. An application that works in background using a keyboard hook. After keyToggleCtrl has been started, it will install a keyboard hook and watches the keyboard messages for the appearance of the toggle, or as I call it, the sticky key. When the sticky key is detected, keyToggle Ctrl will [...]]]></description>
			<content:encoded><![CDATA[<p>This is again a keyToggle application. An application that works in background using a keyboard hook.</p>
<p>After keyToggleCtrl has been started, it will install a keyboard hook and watches the keyboard messages for the appearance of the toggle, or as I call it, the sticky key.</p>
<p>When the sticky key is detected, keyToggle Ctrl will watch the keyboard messages for the keys listed in a keytable (default is watching for presses of the number keys 0 to 9). If the pressed key matches a key in the keytable, keytogglectrl will remove the message from the window message queue and instead send the key found in CharTable with Control pressed before and released after the replaced key.</p>
<p>For example, you press the sticky key, the LED defined by LedID should light and if you then press 0, keyToggleCtrl will send instead Control+C to the active application.</p>
<h4>KeyTest3AK IMAGE</h4>
<p><a rel="attachment wp-att-733" href="http://www.hjgode.de/wp/2010/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/keytest3ak-2/"><img class="alignnone size-medium wp-image-733" title="KeyTest3AK" src="http://www.hjgode.de/wp/wp-content/uploads/2010/08/KeyTest3AK-227x300.gif" alt="" width="227" height="300" /></a></p>
<p><span id="more-732"></span>Without keyToggleCtrl you have to show the SoftwareInputPanel (SIP), tap the [Ctrl] button and then the &#8216;C&#8217; and then hide the SIP. With keyToggleCtrl you can just use the hardware keyboard and have Ctrl+C (Copy to Clipboard) and Ctrl+V (Paste from Clipboard) at your fingers.</p>
<p>After you started keyToggleControl you will only notice a small symbol on the Today Screen of your device. If you tap the symbol, you have the chance to end the keyboard hook and the keyToggleCtrl application.</p>
<h4>KeyToggleCtrl Today Screen</h4>
<p><a rel="attachment wp-att-734" href="http://www.hjgode.de/wp/2010/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/today-keytogglectrl/"><img class="alignnone size-medium wp-image-734" title="today-keyToggleCtrl" src="http://www.hjgode.de/wp/wp-content/uploads/2010/08/today-keyToggleCtrl-227x300.gif" alt="" width="227" height="300" /></a></p>
<p><span style="text-decoration: underline;">Default key mapping with use of -writereg:</span></p>
<pre style="padding-left: 30px;">Keytable 0 0x30 -&gt; 0x0043, '0 -&gt; 'C'
Keytable 1 0x31 -&gt; 0x0058, '1 -&gt; 'X'
Keytable 2 0x32 -&gt; 0x0057, '2 -&gt; 'W'
Keytable 3 0x33 -&gt; 0x0054, '3 -&gt; 'T'
Keytable 4 0x34 -&gt; 0x0045, '4 -&gt; 'E'
Keytable 5 0x35 -&gt; 0x0058, '5 -&gt; 'X'
Keytable 6 0x36 -&gt; 0x0057, '6 -&gt; 'W'
Keytable 7 0x37 -&gt; 0x0054, '7 -&gt; 'T'
Keytable 8 0x38 -&gt; 0x0045, '8 -&gt; 'E'
Keytable 9 0x39 -&gt; 0x0056, '9 -&gt; 'V'</pre>
<p>These values are the same as ANSI codes or VK_ values found in winuser.h.</p>
<p><br class="spacer_" /></p>
<ul>
<li>Default sticky key is VK_PERIOD</li>
<li>Sticky timeout is 3 seconds</li>
<li>Autofallback is 0</li>
<li>LedID default is 1</li>
</ul>
<p><br class="spacer_" /></p>
<p>To find a usable LedID you may use another tool called LED_Control. Funny, that the vibrate motor is also controlled with the same LED API calls.</p>
<h4>LED_control IMAGE</h4>
<div><a rel="attachment wp-att-735" href="http://www.hjgode.de/wp/2010/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/led_control/"><img class="alignnone size-medium wp-image-735" title="LED_control" src="http://www.hjgode.de/wp/wp-content/uploads/2010/08/LED_control-227x300.gif" alt="" width="227" height="300" /></a></div>
<h4>LED_control DOWNLOAD</h4>
<div><b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=112" title="Downloaded 275 times">LED_Control</a> - A tool to test the LED API on Windows Mobile devices (Hits: 275, size: 11.5 kB)</div>
<h4>keyToggleCtrl Downloads</h4>
<p>VS2005/WM6 SDK source code solution: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=113" title="Downloaded 324 times">keyToggleCtrl VS2005 Source (WM6 SDK)</a> -  (Hits: 324, size: 42.77 kB)</p>
<p>keyToggleCtrl installation CAB file: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=114" title="Downloaded 259 times">keyToggleCtrl Installer CAB</a> - Installs keyToggleCtrl with default values onto your Windows Mobile device. It is installed to Programs and StartUp (Hits: 259, size: 22.59 kB)</p>
<p><br class="spacer_" /></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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%2F&amp;title=Mobile+Development%3A+another+keyboard+hooking+tool%3A+keyToggleCtrl" 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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%2F&amp;title=Mobile+Development%3A+another+keyboard+hooking+tool%3A+keyToggleCtrl" 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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%2F&amp;title=Mobile+Development%3A+another+keyboard+hooking+tool%3A+keyToggleCtrl" 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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%2F&amp;T=Mobile+Development%3A+another+keyboard+hooking+tool%3A+keyToggleCtrl" 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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%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%2F08%2F01%2Fmobile-development-another-keyboard-hooking-tool-keytogglectrl%2F&amp;t=Mobile+Development%3A+another+keyboard+hooking+tool%3A+keyToggleCtrl" 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/08/01/mobile-development-another-keyboard-hooking-tool-keytogglectrl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>keyToggleChar &#8211; a tool to enter UTF-8 national chars via keyboard</title>
		<link>http://www.hjgode.de/wp/2010/07/19/keytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=keytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard</link>
		<comments>http://www.hjgode.de/wp/2010/07/19/keytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 11:28:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[GetForegroundKeyboardTarget]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[keytogglechar]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=713</guid>
		<description><![CDATA[As you may know my keyToggle app to be able to use the number keys on a windows mobile device as function keys, here is another one that enables you to enter special national chars, like Å, Ä Æ etc. directly via the keyboard. You must specify 10 keys and there UTF-8 replacements. Configuration is done [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know my keyToggle app to be able to use the number keys on a windows mobile device as function keys, here is another one that enables you to enter special national chars, like Å, Ä Æ etc. directly via the keyboard. You must specify 10 keys and there UTF-8 replacements. Configuration is done via the registry:</p>
<pre>3.0        added code for read/write reg for CharTable and KeyTable
 REGEDIT4

 [HKEY_LOCAL_MACHINE\Software\Intermec\KeyToggleChar]
 "KeyTable"=hex:\
 30,31,32,33,34,35,36,37,38,39
 "CharTable"=hex:\
 C6,00,E6,00,D8,00,F8,00,C5,00,E5,00,C2,00,E2,00,C4,00,E4,00
 "LEDid"=dword:00000001
 "autoFallback"=dword:00000000
 "Timeout"=dword:00000003
 "StickyKey"=dword:00000074

 <strong>KeyTable</strong>     holds a list of 10 keys which will be 'remapped'
 <strong>CharTable </strong>   holds  list of UniChar codes to use as replacement
 <strong>LEDid </strong>       defines the ID of the LED to use for showing sticky state
 <strong>autoFallback </strong>defines, if the sticky state is reset after a mapped key is pressed.
              Use 0, if you dont want the sticky state to fallback after keypress
 <strong>TimeOut </strong>     defines a timout after which sticky state will be reset</pre>
<p>To get the UTF-8 word entries for Unicode chars, see for example here: http://www.unicode.org/charts/charindex.html</p>
<p>The default mapping used here is defined as follows and maps the keys 0-9 to:</p>
<pre>0x00c6, 0x00e6, 0x00d8, 0x00f8, 0x00C5, 0x00e5, 0x00c2, 0x00e2, 0x00c4, 0x00e4
 AE        ae     O/       o/      A°      a°      A^      a^      Ä       ä</pre>
<p>The main problem I had was finding a function to get the window handle of the current input active window. Finally I found GetForegroundKeyboardTarget() (after some days of searching).</p>
<p><span id="more-713"></span></p>
<pre escaped="true" lang="c">void sendKey(UINT vKey){
 TCHAR* lpText;
 lpText = new TCHAR[MAX_PATH];
 TCHAR strClass[MAX_PATH];
 int iRes;

 // hWndActive = GetFocusEx(); // a trick that does not deliver the focusses window
 hWndActive = GetForegroundKeyboardTarget();

 GetWindowText(hWndActive, lpText, MAX_PATH-1);
 iRes = GetClassName(hWndActive, strClass, MAX_PATH);
 DEBUGMSG(1, (L"### GetFocusEx() window, handle=0x%x, text='%s', class='%s'\n", hWndActive, lpText, strClass));

 if(hWndActive == NULL)
 return; //no window found

 WPARAM wParam = getCharForKey(vKey); // charTable[vKey-0x30];// 0x00c6; //AE
 LPARAM lParam = 1; //flags: repeat=1

/*
 wm_keydown, wParam=0, lParam=1
 wm_char, wParam=char code, lParam=1
 wm_keyup, wParam=0, lParam=c0000001;
*/

 LRESULT lRes=0;
 lRes = SendMessage(hWndActive, WM_KEYDOWN, 0, 1);
 DEBUGMSG(1, (L"SendMessage1 for 'WM_KEYDOWN' returned 0x%0x\n", lRes));
 lRes = SendMessage(hWndActive, WM_CHAR, wParam, 1);
 DEBUGMSG(1, (L"SendMessage2 for '0x%04x' returned 0x%0x\n", wParam, lRes));
 lRes = SendMessage(hWndActive, WM_KEYUP, 0, 0xc0000001);
 DEBUGMSG(1, (L"SendMessage3 for 'WM_KEYUP' returned 0x%0x\n", lRes));

 return;
}</pre>
<p>I leaved my different finding in code (commented out), so you can see, what functions I have tried. <br class="spacer_" /></p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=108" title="Downloaded 159 times">keyToggleChar</a> -  (Hits: 159, size: 6 kB)
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=109" title="Downloaded 153 times">keyToggleChar Source (C/C++, VS2005, Mobile 6 SDK)</a> -  (Hits: 153, size: 35.92 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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%2F&amp;title=keyToggleChar+%26%238211%3B+a+tool+to+enter+UTF-8+national+chars+via+keyboard" 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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%2F&amp;title=keyToggleChar+%26%238211%3B+a+tool+to+enter+UTF-8+national+chars+via+keyboard" 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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%2F&amp;title=keyToggleChar+%26%238211%3B+a+tool+to+enter+UTF-8+national+chars+via+keyboard" 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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%2F&amp;T=keyToggleChar+%26%238211%3B+a+tool+to+enter+UTF-8+national+chars+via+keyboard" 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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%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%2F07%2F19%2Fkeytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard%2F&amp;t=keyToggleChar+%26%238211%3B+a+tool+to+enter+UTF-8+national+chars+via+keyboard" 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/07/19/keytogglechar-a-tool-to-enter-utf-8-national-chars-via-keyboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development: Hooking the keyboard &#8211; KeyToggle</title>
		<link>http://www.hjgode.de/wp/2010/07/16/mobile-development-hooking-the-keyboard-keytoggle/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-hooking-the-keyboard-keytoggle</link>
		<comments>http://www.hjgode.de/wp/2010/07/16/mobile-development-hooking-the-keyboard-keytoggle/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 04:02:33 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Int*rm*c]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[function keys]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[simulate keys]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=675</guid>
		<description><![CDATA[Using keyboard hook to remap keys to function keys on windows mobile.]]></description>
			<content:encoded><![CDATA[<p><strong>KeyToggle</strong></p>
<p>Extend your keyboard to get function keys by pressing numbers.</p>
<p>With keytoggle you can define a &#8216;sticky&#8217; key that will change the beahviour of the number keys. As long as the sticky key is &#8216;active&#8217;, number keys from 1 to 0 will produce the function keys F1 to F10. If sticky key is active, the left LED will light in green.</p>
<p>To start keytoggle just tap it or let it start by a link in StartUp. If keytoggle is loaded, you can see a small yellow arrow sign in the taskbar.</p>
<p><a rel="attachment wp-att-676" href="http://www.hjgode.de/wp/2010/07/16/mobile-development-hooking-the-keyboard-keytoggle/keytoggle-3/"><img class="alignnone size-full wp-image-676" title="keytoggle" src="http://www.hjgode.de/wp/wp-content/uploads/2010/07/keytoggle.gif" alt="" width="23" height="24" /></a></p>
<p>If you tap this symbol, you are asked, if you want to unload the app. If the registry does not have values defined for keytoggle, it will use default values. If you try to launch keytoggle a second time you will get a message box. Only one instance of keytoggle can run at a time.</p>
<p>Using the registry you can define the behaviour of the sticky key. In example, you can have the sticky key remain active until it is pressed again, let it &#8216;go off&#8217; or &#8216;fallback&#8217; after a period of time or let it fallback after a number key has been pressed. If the sticky key is pressed again, it will always fallback.</p>
<p><span id="more-675"></span>REGEDIT4<br />
 [HKEY<em>LOCAL</em>MACHINE\SOFTWARE\Intermec\KeyToggle]<br />
 &#8220;Timeout&#8221;=dword:00000000<br />
 &#8220;autoFallback&#8221;=dword:00000001<br />
 &#8220;StickyKey&#8221;=dword:00000090</p>
<p>The values:</p>
<pre><code>  StickyKey:
  default "144", decimal (VK_NUMLOCK)
  the VK_ value of the sticky key. Here you define, what you will have as the sticky key. VK_ values are defined as in winuser.h. In example the VK_ value for the NumLock key is 0x90 (144 decimal, see VK_NUMLOCK). The sticky key will be consumed by keytoggle and is not visible to the system any more. That means, that you should choose key value that you do not need in any app you use.

  Timeout:
  default "3", three seconds
  number of seconds the sticky key will remain active. If 0, the sticky key will not fallback automatically by time

  autoFallback:
  default "0"
  if 0 the sticky key will not fallback after pressing a number key. If 1 the sticky key will fallback after a number key is pressed
</code></pre>
<p><strong>Launch arguments</strong></p>
<pre><code>  Keytoggle only supports one argument: "-writereg". This will create the registry keys used by keytoggle and fill them with the default values.
</code></pre>
<p><strong>Usage Sample Scenario</strong></p>
<p>You have a ITC Color device  with a numeric keyboard but no function keys. You need the function keys to be able to use a web application within iBrowse. With keytoggle you can now for example use the Gold key as sticky key. You have to download the device reource kit to get a keyboard remapper tool from the ITC site and assign the Gold key to NUMLOCK.</p>
<p><a rel="attachment wp-att-677" href="http://www.hjgode.de/wp/2010/07/16/mobile-development-hooking-the-keyboard-keytoggle/cpkbdmap-3/"><img class="alignnone size-medium wp-image-677" title="cpkbdmap" src="http://www.hjgode.de/wp/wp-content/uploads/2010/07/cpkbdmap-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>With this remapping and keytoggle running you will to get a function keystroke simulated if you press the Gold key and then a number key.</p>
<p>Download installer: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=107" title="Downloaded 195 times">KeyToggle Installer CAB</a> -  (Hits: 195, size: 5.19 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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%2F&amp;title=Mobile+Development%3A+Hooking+the+keyboard+%26%238211%3B+KeyToggle" 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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%2F&amp;title=Mobile+Development%3A+Hooking+the+keyboard+%26%238211%3B+KeyToggle" 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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%2F&amp;title=Mobile+Development%3A+Hooking+the+keyboard+%26%238211%3B+KeyToggle" 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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%2F&amp;T=Mobile+Development%3A+Hooking+the+keyboard+%26%238211%3B+KeyToggle" 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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%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%2F07%2F16%2Fmobile-development-hooking-the-keyboard-keytoggle%2F&amp;t=Mobile+Development%3A+Hooking+the+keyboard+%26%238211%3B+KeyToggle" 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/07/16/mobile-development-hooking-the-keyboard-keytoggle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full Screen Engine to make Compact Framework applications fullscreen</title>
		<link>http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=full-screen-engine-to-make-compact-framework-applications-fullscreen</link>
		<comments>http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 13:43:50 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[GXOpenInput]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=456</guid>
		<description><![CDATA[A class to make a Windows Mobile compact framework forms fullscreen. Includes code to catch all keys (no more working softkeys)]]></description>
			<content:encoded><![CDATA[<p>Here is my approach to make a compact framework form fullscreen:</p>
<p>A class that enables you to</p>
<ul>
<li>lock/unlock the taskbar</li>
<li>hide/show the taskbar and resize form to occupy the whole screen</li>
<li>hide the menu bar but show/hide SIP</li>
<li>disables OS to capture Function keys like F6/F7 for Volume Up/Down etc and makes these keys available to be used in your app. Also the use of the WinKey does not open the Start Menu</li>
</ul>
<p><a rel="attachment wp-att-457" href="http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/fullscreencstest/"><img class="alignnone size-full wp-image-457" title="fullscreenCStest" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/fullscreenCStest.gif" alt="" width="240" height="320" /></a></p>
<p>(You are right, you dont see &#8216;fullscreen&#8217; in the screen shot, BUT the taskbar is locked!)</p>
<p><span id="more-456"></span></p>
<pre lang="csharp">using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace myApp{
    class fullScreen
    {
        #region DllImports
        ///
        /// FindWindow will find a window by specifying the WndClass or the Caption
        ///
        ///

        ///

        /// an intPtr to the found window or null, if not found
        [DllImport("coredll.dll")]
        extern private static IntPtr FindWindowW(string lpClassName, string lpWindowName);

        ///
        /// we need this to get the size of the screen
        ///
        ///

        ///
        [DllImport("coredll.dll")]
        extern private static int GetSystemMetrics(int nIndex);
        ///
        /// the used nIndex values for screen width and height
        ///
        private const int SM_CXSCREEN = 0;
        private const int SM_CYSCREEN = 1;

        ///
        /// query a window for his state
        ///
        ///

        /// true if window is visible
        [DllImport("coredll.dll")]
        static extern bool IsWindowVisible(IntPtr hWnd);

        #endregion
        ///
        /// function to modify the window state of a window
        ///
        /// handle to the window
        /// the required window state
        ///
        [DllImport("coredll.dll")]
        static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);

        #region WStyles
        /// Enumeration of the different ways of showing a window using
        /// ShowWindow
        private enum WindowShowStyle : uint
        {
            /// Hides the window and activates another window.
            /// See SW_HIDE
            Hide = 0,
            /// Activates and displays a window. If the window is minimized
            /// or maximized, the system restores it to its original size and
            /// position. An application should specify this flag when displaying
            /// the window for the first time.
            /// See SW_SHOWNORMAL
            ShowNormal = 1,
            /// Activates the window and displays it as a minimized window.
            /// See SW_SHOWMINIMIZED
            ShowMinimized = 2,
            /// Activates the window and displays it as a maximized window.
            /// See SW_SHOWMAXIMIZED
            ShowMaximized = 3,
            /// Maximizes the specified window.
            /// See SW_MAXIMIZE
            Maximize = 3,
            /// Displays a window in its most recent size and position.
            /// This value is similar to "ShowNormal", except the window is not
            /// actived.
            /// See SW_SHOWNOACTIVATE
            ShowNormalNoActivate = 4,
            /// Activates the window and displays it in its current size
            /// and position.
            /// See SW_SHOW
            Show = 5,
            /// Minimizes the specified window and activates the next
            /// top-level window in the Z order.
            /// See SW_MINIMIZE
            Minimize = 6,
            /// Displays the window as a minimized window. This value is
            /// similar to "ShowMinimized", except the window is not activated.
            /// See SW_SHOWMINNOACTIVE
            ShowMinNoActivate = 7,
            /// Displays the window in its current size and position. This
            /// value is similar to "Show", except the window is not activated.
            /// See SW_SHOWNA
            ShowNoActivate = 8,
            /// Activates and displays the window. If the window is
            /// minimized or maximized, the system restores it to its original size
            /// and position. An application should specify this flag when restoring
            /// a minimized window.
            /// See SW_RESTORE
            Restore = 9,
            /// Sets the show state based on the SW_ value specified in the
            /// STARTUPINFO structure passed to the CreateProcess function by the
            /// program that started the application.
            /// See SW_SHOWDEFAULT
            ShowDefault = 10,
            /// Windows 2000/XP: Minimizes a window, even if the thread
            /// that owns the window is hung. This flag should only be used when
            /// minimizing windows from a different thread.
            /// See SW_FORCEMINIMIZE
            ForceMinimized = 11
        }
        #endregion
#region private vars
        private int m_width = 240;
        private int m_height = 320;
        private bool m_SIP_shown = false;
#endregion
        ///
        /// class instantiation
        /// store the screen size
        ///
        public fullScreen()
        {
            m_width = GetSystemMetrics(SM_CXSCREEN);
            m_height = GetSystemMetrics(SM_CYSCREEN);
            //Find SipWndClass
            IntPtr hWndSipWndClass = IntPtr.Zero;
            hWndSipWndClass = FindWindowW("SipWndClass", null);
            if (hWndSipWndClass != IntPtr.Zero)
            {
                m_SIP_shown = IsWindowVisible(hWndSipWndClass);
            }
            GXopen();
        }
        ///
        /// this will open the GX API and all keystrokes, even the softkeys as Vol_Up, Win etc will not be handled by the OS
        /// the gx.dll is only available on Windows Mobile OS, not on WinCE OS devices
        /// The GX class has been ousourced and will only be loaded in gx.dll exists
        /// otherwise you will get missing DLL exceptions
        ///
        private void GXopen(){
            if (System.IO.File.Exists(@"\Windows\gx.dll"))
            {
                GX_WM gxwm = new GX_WM();
                gxwm.GXopen();
            }
        }

        ///
        /// deinit GX API and let wiondows handle the 'softkeys'
        ///
        private void GXclose()
        {
            if (System.IO.File.Exists(@"\Windows\gx.dll"))
            {
                GX_WM gxwm = new GX_WM();
                gxwm.GXopen();
            }
        }
        ///
        /// public vars to get the screen size
        ///
        public int width
        {
            get
            {
                return m_width;
            }
        }
        public int height
        {
            get
            {
                return m_height;
            }
        }
        ///
        /// will enlarge the form to cover the full screen
        /// the taskbar will be hidden
        /// the SIP will be hidden
        ///
        /// the form to make fullscreen
        public void makeFullScreen(System.Windows.Forms.Form f)
        {
            f.Width = m_width;
            f.Height = m_height;
            f.Top = 0; f.Left = 0; // move the form to upper left
            hideTaskBar(true); //hide the taskbar
            showSIP(false); //hide the SIP window, regardless of it is shown or not
        }

        ///
        /// restore previous screen settings
        ///
        public void Unload()
        {
            hideTaskBar(false);
            if (m_SIP_shown)
                showSIP(true);
        }

        ///
        /// Hide or show the SIP
        ///
        ///

        public void showSIP(bool bShow)
        {
            //Find SipWndClass
            IntPtr hWndSipWndClass = IntPtr.Zero;
            hWndSipWndClass = FindWindowW("SipWndClass", null);
            if (hWndSipWndClass != IntPtr.Zero)
            {
                if (bShow)
                    ShowWindow(hWndSipWndClass, (uint)WindowShowStyle.ShowNormal);
                else
                    ShowWindow(hWndSipWndClass, (uint)WindowShowStyle.Minimize);
            }
        }

        ///
        /// Hide or show the TaskBar
        ///
        ///

        ///
        private int hideTaskBar(bool mode)
        {
            IntPtr hWndTaskBar = IntPtr.Zero;
            if (mode)
            {
                hWndTaskBar = FindWindowW("HHTaskBar", null);
                if (hWndTaskBar != IntPtr.Zero)
                    ShowWindow(hWndTaskBar, (uint)WindowShowStyle.Hide);
            }
            else
            {
                hWndTaskBar = FindWindowW("HHTaskBar", null);
                if (hWndTaskBar != IntPtr.Zero)
                    ShowWindow(hWndTaskBar, (uint)WindowShowStyle.ShowNormal);
            }
            return 0;
        }

    }
}</pre>
<p>The GX_WM class:</p>
<pre lang="csharp">using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; 

namespace myApp
{
	class GX_WM {
		//nice mangled names
		//?GXCloseInput@@YAHXZ or use "#3"
		[DllImport("gx.dll", EntryPoint="?GXCloseInput@@YAHXZ")]
		extern private static Int16 GXOpenInput();
		//?GXOpenInput@@YAHXZ or use "#9"
		[DllImport("gx.dll", EntryPoint="?GXOpenInput@@YAHXZ")]
		extern private static Int16 GXCloseInput(); 

		public void GXopen(){
			GXOpenInput();
			System.Diagnostics.Debug.WriteLine("GXOpenInput()");
		}
		public void GXclose() {
			GXCloseInput();
			System.Diagnostics.Debug.WriteLine("GXCloseInput()");
		}
	}
}
</pre>
<p>To use the classes in your code, declare a new fullScreen object at a central point of your app. For example in Program.cs:</p>
<pre lang="csharp">        public static fullScreen fse;</pre>
<p>The declaration is static to enable you to use this object in all forms of your app. Then before your Run statement place the initialisation of the fullScreen object. At the end of your app, it is a good way to unload the object, so it may restore the taskbar and SIP status.</p>
<pre lang="csharp">static class Program
    {
        ///
        /// The main entry point for the application.
        ///
        public static fullScreen fse;
        [MTAThread]
        static void Main()
        {
            try
            {
                fse = new fullScreen();
                Application.Run(new MyAppForm());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry: " + ex.Message);
            }
            fse.Unload();
        }
    }
</pre>
<p>Now in every form you have, place the line:</p>
<pre lang="csharp">Program.fse.makeFullScreen(this);</pre>
<p>in the _Load event or &#8211; as I do &#8211; in the form constructor after the line &#8220;InitializeComponent();&#8221;</p>
<pre escaped="true" lang="csharp">public myAppForm() {
    if (!InitApp())
        AppShutdown();
    InitializeComponent();
    <strong>Program.fse.makeFullScreen(this);</strong>
}</pre>
<p>If you need to show the SIP, use</p>
<pre>Program.fse.showSIP(true); </pre>
<p>If you want to have a real fullscreen app without a title bar, dont forget to set the borderstyle of your form to None. You can also change the makeFullScreen function and do this for the form given in the argument.</p>
<p>Any comments or enhancements?</p>
<p>Have fun</p>
<p>PS: Key catching works fine in C# with the fullscreen class (either using GXOpenInput() or AllKeys()), see attached c# sample.</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=87" title="Downloaded 802 times">FullScreenCStest</a> -  (Hits: 802, size: 44.66 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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" 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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" 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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" 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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;T=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" 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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%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%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;t=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" 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/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use FuncKey to free up your FunctionKeys on Windows Mobile</title>
		<link>http://www.hjgode.de/wp/2010/02/10/use-funckey-to-free-up-your-functionkeys-on-windows-mobile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-funckey-to-free-up-your-functionkeys-on-windows-mobile</link>
		<comments>http://www.hjgode.de/wp/2010/02/10/use-funckey-to-free-up-your-functionkeys-on-windows-mobile/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 22:24:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[AllKeys]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[FuncKeys]]></category>
		<category><![CDATA[function keys]]></category>
		<category><![CDATA[GXOpenInput]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=20</guid>
		<description><![CDATA[A toolset to free FunctionKeys on your Windows Mobile device]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p style="text-align: right;">Updated on 10. feb 2010</p>
<p>I finished a toolset to free the function keys on windows mobile devices. That means a tool set that will give you back the function keys. Instead of F3 launching the phone app, you can free the F3 key and use it in your app.</p>
<p><span id="more-20"></span></p>
<p><img title="FuncKeys1.jpg" src="http://community.intermec.com/t5/image/serverpage/image-id/83i4E8528B315AD6935/image-size/original?v=mpbl-1&amp;px=-1" border="0" alt="FuncKeys1.jpg" align="center" /> <img title="FuncKeys0.jpg" src="http://community.intermec.com/t5/image/serverpage/image-id/84i60D6B7FD34772A90/image-size/original?v=mpbl-1&amp;px=-1" border="0" alt="FuncKeys0.jpg" align="center" /></p>
<p>The tool set consists of three files:</p>
<ul>
<li>FuncKeysCPL a control panel applet that will launch the second tool FuncKeys.</li>
<li>FuncKeys will enable you to define the function keys to free up.</li>
<li>FuncKeysUnReg, the tool that will apply your settings during startup of the device.</li>
</ul>
<p>For some more information see the html help inside FuncKeys (use the [?] button).</p>
<p>The only disadvantage with the tool is that it cannot free VK_LWIN as GXOpenInput() or <a title="Post about AllKeys()" href="http://www.hjgode.de/wp/2009/05/09/gapi-gxopeninput-and-gxcloseinput-will-be-removed-for-windows-mobile-65/" target="_self">AllKeys()</a> can do.</p>
<p>regards</p>
<p>Josef<br />
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=1" title="Downloaded 422 times">FuncKeys</a> - Control the function of Function Keys on Windows Mobile devices (embedded Visual C++ 4.0 Source included) (Hits: 422, size: 721.86 KB)</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=51" title="Downloaded 277 times">FuncKey ArmV4i installer cab</a> -  (Hits: 277, size: 205.06 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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%2F&amp;title=Use+FuncKey+to+free+up+your+FunctionKeys+on+Windows+Mobile" 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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%2F&amp;title=Use+FuncKey+to+free+up+your+FunctionKeys+on+Windows+Mobile" 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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%2F&amp;title=Use+FuncKey+to+free+up+your+FunctionKeys+on+Windows+Mobile" 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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%2F&amp;T=Use+FuncKey+to+free+up+your+FunctionKeys+on+Windows+Mobile" 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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%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%2F02%2F10%2Fuse-funckey-to-free-up-your-functionkeys-on-windows-mobile%2F&amp;t=Use+FuncKey+to+free+up+your+FunctionKeys+on+Windows+Mobile" 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/02/10/use-funckey-to-free-up-your-functionkeys-on-windows-mobile/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automated Login for Remote Desktop Mobile</title>
		<link>http://www.hjgode.de/wp/2010/01/21/automated-login-for-remote-desktop-mobile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automated-login-for-remote-desktop-mobile</link>
		<comments>http://www.hjgode.de/wp/2010/01/21/automated-login-for-remote-desktop-mobile/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 16:44:37 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[keybd_event]]></category>
		<category><![CDATA[mouse_event]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[remote desktop mobile]]></category>
		<category><![CDATA[SetWindowText]]></category>
		<category><![CDATA[terminal service client]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=273</guid>
		<description><![CDATA[Automate windows and dialogs and mouse clicks on Windows Mobile]]></description>
			<content:encoded><![CDATA[<h2>Remote Desktop Mobile autologin</h2>
<p>As you may know, Remote Desktop Mobile (RDM) does not support auto-login. But sometimes you may want a user does not change settings and is directly connected to a Terminal Server. Ruggedized devices are often used in warehouses and the IT structure uses a terminal server to gather data and manage goods. Although I think Windows Mobile is not the right OS for such barcode scanner devices, you may have no choose and have to use a handheld computer with Windows Mobile instead one that uses Windows CE. The RDM or Terminal Service Client provided with Windows CE devices is much more flexible and can be configured by the OEM to enable you to auto-login into a Terminla Server (TS).</p>
<p>OK, the challenge was to automate the startup and login of RDM on a Windows Mobile 6.1 device. I started using embedded Visual C++ 4.0 although this is outdated by VS2005 and VS2008.</p>
<p>The idea was to launch the exe, fill in the values and click the Connect bar.<span id="more-273"></span></p>
<h3>Finding the connect dialog window</h3>
<p>Normally, on desktop windows, windows and there childs are located in there own tree (see desktop PC spy++ screenshot). On WM61 I found, that the RDM window (class=&#8221;TSSHELLWND&#8221;) and the Connect dialog (class=&#8221;Dialog&#8221;) are located side by side below the desktop window (see cespy screenshot). This makes it hard to find the right dialog, especially as the Connect Dialog does not have a unique window title (window text). The windows can be identified as belonging together by there processID.</p>
<p><a rel="attachment wp-att-275" href="http://www.hjgode.de/wp/2010/01/21/automated-login-for-remote-desktop-mobile/spy-trees/"><img class="alignnone size-medium wp-image-275" title="spy-trees" src="http://www.hjgode.de/wp/wp-content/uploads/2010/01/spy-trees-300x265.gif" alt="" width="300" height="265" /></a></p>
<div id="attachment_274" class="wp-caption alignleft" style="width: 250px"><br />
<a rel="attachment wp-att-274" href="http://www.hjgode.de/wp/2010/01/21/automated-login-for-remote-desktop-mobile/connect_dialog/"><img class="alignnone size-full wp-image-274" title="connect_dialog" src="http://www.hjgode.de/wp/wp-content/uploads/2010/01/connect_dialog.gif" alt="" width="240" height="317" /></a><p class="wp-caption-text">RDM Connect Dialog</p></div>
<h3>Filling the fields</h3>
<p>Knowing the right window I was able to set the text entries by knowing there controlIDs (dialogs use ctrlIDs for easier access of the data, see scanTscDialog() in tscDialog.cpp). So the tool I did can fill in all connection details using SetWindowText().</p>
<h3>Execute the Connect</h3>
<p>The fields are filled with the connection details and now I needed a way to simulate a click onto the connect button (which is a menu in reality) to let the dialog execute a connect. I tried several approaches, the best is to use keyb_event although it works also by sending the TSC window the WM_USER message that is posted by the menu click. I found this WM_USER message within messages of cespy as I tapped on [Connect].</p>
<pre lang="cplusplus"> //Solution three, best solution, ensure you use the scancode value too! AFAIK the scancode for F1 is always 0x70
keybd_event(VK_F1, 0x70, 0, 0);
 Sleep(30);
 keybd_event(VK_F1, 0x70, KEYEVENTF_KEYUP, 0);</pre>
<p>I was unable to send TSSHELLWND nor the Dialog a click onto the menu option [Connect]. The menu seems to be not owned by either of these two visible windows. The menu bar looks like owned by the desktop window.</p>
<p>Sending the SoftKey1 (F1) was also unsuccessfull for window handles of TSSHELLWND and the Connect Dialog.</p>
<h3>The pitfalls</h3>
<p>Everything seems to work OK, but sometimes the tool was unable to fill the fields and execute the connect. I did search several hours and then I found, that the registry and a file is involved in the connect.</p>
<p>The tool always failed to autoconnect after the first clean boot. So I did a snapshot with the famous free SSNAP by &#8220;S-K tools&#8221; and found the changes that caused a manualy connect to be successfull.</p>
<h4>Registry changes</h4>
<p>First, the registry will get be changed, if you manually connect. As I did not like to have my tool to emulate a user typing into the fields using keybd_event, I added code, that does the same changes to the registry (see writeMRU() function in code). There are some more changes in registry, but fortunately I did not have to implement these too (see comments in &#8220;tscDialog.cpp&#8221;).</p>
<h4>RDP file default.rdp</h4>
<p>When you fill the connect dialog and then press [Connect] RDM will save your values in a file \Windows\default.rdp. You may know, that rdp files are commonly used on desktop windows to save/load Remote Desktop Session connection data. Yes, WM6.1 does use a similar technique.</p>
<p>The tool had to provide a default.rdp with the data of the connection settings. So I wrote a function to create and write this file from scratch on every start (see writeRDP() in tsc_dialog.cpp and rdp_file.h). As options, like &#8220;FullScreen&#8221; or &#8220;Fit to Screen&#8221; are also controlled by the rdp file, I was able to control these settings by code.</p>
<h3>Conclusion</h3>
<p>So far the tool works. Dont download if you dont like spaghetti. The code is written as grown.</p>
<h3>Usage</h3>
<p>Write the correct values for the connection to the registry</p>
<pre>[HKEY_LOCAL_MACHINE\Software\RDP_autologin]
"FitToScreen"="1"
"FullScreen"="1"
"Status"="connecting..."
"Save Password"="1"
"Domain"=""
"Password"="xxxxxxxxxx"
"Username"="rdesktop"
"Computer"="192.168.0.130"</pre>
<p>Then simply start the tool. First it will terminate a running instance of RDM. Then it starts a new instance and starts to fill the fields and do the connect.</p>
<h4>Warranty</h4>
<p>No warranty, code is provided as is. Hopefully it is usefull for the one or other.</p>
<h4>Changes</h4>
<p>Some values are hard coded, ie the control IDs used. These IDs may be different on other devices or within other RDM releases. So far the code works on my testing device. If you need to change the control IDs you may use the scanTscDialog() function to get the actual codes listed in the debug window.</p>
<p>Have fun!</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=48" title="Downloaded 1251 times">RDP_autologin CPP source EVC4</a> -  (Hits: 1251, size: 123.58 KB)
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=49" title="Downloaded 1198 times">RDP_autologin ARMv4i exe and reg file</a> -  (Hits: 1198, size: 4.27 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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%2F&amp;title=Automated+Login+for+Remote+Desktop+Mobile" 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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%2F&amp;title=Automated+Login+for+Remote+Desktop+Mobile" 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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%2F&amp;title=Automated+Login+for+Remote+Desktop+Mobile" 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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%2F&amp;T=Automated+Login+for+Remote+Desktop+Mobile" 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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%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%2F01%2F21%2Fautomated-login-for-remote-desktop-mobile%2F&amp;t=Automated+Login+for+Remote+Desktop+Mobile" 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/01/21/automated-login-for-remote-desktop-mobile/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

