Search Pocket PC Life's 126 Pocket PC-related article archive 
Home
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.
HP hotkeys, OK buttons, and file existence (continued)

The extended editor, shown in Figure A, looks a lot like the stock editor provided by HP. Full source code is available at http://www.halcyon.com/ast/dload/HotKeyEditor.zip.

FIGURE A


The extended editor looks a lot like the stock editor provided by HP. Roll over picture for a larger image.

The edit box in the lower right hand corner always shows the program associated with the currently highlighted hotkey, and you can either type in a new entry or use the Browse button to select a file from a directory on the device. The Restore Defaults button will change the hotkeys back to the values of the original device configuration. To save your changes, press Enter or select the OK button in the title bar. If any of the specified files do not exist, the editor will warn you via a dialog box. You'll then need to change the offending filename(s) and hit OK again or cancel the dialog to throw away your changes.

The editor is mostly a straightforward Windows CE dialog application, but it does address a couple of common questions that often come up in the newsgroups and mailing list.

How do I create an OK button in the title bar of my dialog box?
This feature is controlled by the extended window style WS_EX_CAPTIONOKBTN. Typically, you specify window styles via the properties dialog in the Visual C++ for Windows CE resource editor. Unfortunately, there's a bug in the latest version that causes the checkbox for this feature to be disabled, as shown in Figure B. Luckily, there are a couple of workarounds.

FIGURE B

Unfortunately, there's a bug in the latest version of Visual C++ for Windows CE resource editor that causes the checkbox for creating buttons in the title bar to be disabled.

One possibility for working around this bug is to manually add the style to the list in the resource file dialog template. Resource files are just plain text, so this is easy to do, but it's a major pain. Every time you save from the resource editor, your changes will be overwritten -- yuck! The second, and much more attractive, alternative is to change the style programmatically at runtime. This doesn't always work for window styles, but luckily it works in this situation. Just add the following line to the handler for your WM_INITDIALOG message and the OK button will magically show up in your title bar:

SetWindowLong(hwndDlg, GWL_EXSTYLE, WS_EX_CAPTIONOKBTN );


« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Phones and PDAs > Windows Mobile > Programming (3 articles)
   Palm-sized input panel quirks and mounted database volumes
   Freeing up DLLs, avoiding suspend mode, and listbox tricks
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
More from the ZATZ journals
Computing Unplugged: Smartphone smarts for a mobile world
David Gewirtz Online: CNN commentary and analysis
DominoPower: It's time for Lotus to double-down on Linux and open source
OutlookPower: The strange case of Outlook losing notes and requiring passwords
-- Advertisement --

Printing emails and attachments has never been simpler
When it comes to printing emails or attachments, you can be confident that our Auto-Print add-in can do what Outlook lacks - print the emails and/or attachments as soon as they arrive.

Discover this professional tool today.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1999-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login