Email:   
Home
In This Issue
Email a Friend
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
PROGRAMMING POWER
HP hotkeys, OK buttons, and file existence
By Andrew Tucker

Before we jump into this month's topics, I wanted to thank everyone who has sent in questions and comments on previous columns. We forgot to mention it, but the SIP question last month was sent in by John Rogers of Trimble Navigation. This column is geared toward responding to user feedback, so be sure to send us any questions you might have, as well as comments on previous columns, to poweranswers@bsquare.com.

This month we'll take a look at a hidden feature that should be of interest to all users of Hewlett Packard (HP) Jornada H/PCs and H/PC Pros. The tip comes from the comp.os.ms-windows.ce USENET newsgroup posting by Steve Grother at HP.

Across the top of the Jornada's keyboard are 11 hotkeys that allow you to start a specific application at the push of a button. The stock configuration of the device has settings for the application icon printed on the key, but HP provides an editor that allows you to change the keys to correspond to any program you like. What HP doesn't tell you, or let you customize, is that combining shift or control with a hotkey can have a completely different setting from just the hotkey itself. To take advantage of this, I wrote a hotkey editor that allows you to customize all 33 hotkeys to a program of your choice rather than just the 11 that the HP editor allows. We'll examine how the editor works in some detail, and then we'll look at some common Windows CE programming problems that it solves along the way.

The key to customizing the hotkeys is knowing that the mapping is kept under the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Keys. Each hotkey is a separate registry key made up of four hexadecimal digits. The top two characters specify what modifier key is used for this entry. 0x44 is the shift key, 0x48 is the control key, and 0x40 means no modifier keys. The bottom two characters specify the actual hotkey. Starting with the value of 0xC1 representing the far left key with the Inbox, the value increments by one for each key. Table A lists all the hotkey combinations and their numeric registry key names. The default value under the registry key holds the actual path to the executable or shell link that will be launched when that key is pressed.

Hotkey combinations Numeric registry key names
40C1 Key 1
44C1 Shift-Key 1
48C1 Control-Key 1
40C2 Key 2
44C2 Shift-Key 2
48C2 Control-Key 2
40C3 Key 3
44C3 Shift-Key 3
48C3 Control-Key 3
40C4 Key 4
44C4 Shift-Key 4
48C4 Control-Key 4
40C5 Key 5
44C5 Shift-Key 5
48C5 Control-Key 5
40C6 Key 6
44C6 Shift-Key 6
48C6 Control-Key 6
40C7 Key 7
44C7 Shift-Key 7
48C7 Control-Key 7
40C8 Key 8
44C8 Shift-Key 8
48C8 Control-Key 8
40C9 Key 9
44C9 Shift-Key 9
48C9 Control-Key 9
40CA Key 10
44CA Shift-Key 10
48CA Control-Key 10
40CB Key 11
44CB Shift-Key 11