|
|
|
|
|
|
|
|
|
|
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. Click 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 );
|
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album — and have them delivered right to your door!
Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!
And it's only from The Duck! Tap here to get started. |
-- Advertisement --
Write for Computing Unplugged!
Share your experience and expertise with other handheld device users. There are new opportunities at ZATZ for contributing authors and editors.
Write about something you're an expert on and get your name in lights.
For Writers' Guidelines and to discuss topics, contact Staff Editor Steve Niles. This is your opportunity to shine in front of your peers, your clients, and friends.
Click for more info! |
|
|
|
|
|
|
|
|