Page 125 - DCAP408_WEB_PROGRAMMING
P. 125
Unit 7: Character Sets, Fonts and the Keyboard
If installing fonts from a floppy disk or a CD-ROM, you should ensure this check box Notes
is selected. Or else, to use the fonts in your applications, you must always keep the
disk in the disk drive.
Click OK to install the fonts.
Self Assessment
Fill in the blank:
14. To ......................... the fonts to the Fonts folder, ensure the Copy fonts to the Fonts folder
check box is selected.
7.11 Keyboard Accelerators
Accelerators are intimately associated to menus — both offer the user with access to an
application’s command set. Usually, users depend on an application’s menus to study the
command set and then switch over to using accelerators as they turn out to be more capable with
the application. Accelerators offer faster, more direct access to commands than menus do. At a
minimum, an application should supply accelerators for the more frequently used commands.
Eve though accelerators usually generate commands that appear as menu items, they can also
produce commands that have no corresponding menu items.
7.11.1 Accelerator Tables
An accelerator table includes an array of ACCEL structures, each defining an individual
accelerator. Each ACCEL structure involves the following information:
The accelerator’s keystroke combination.
The accelerator’s identifier.
Various flags. This comprises one that states whether the system is to offer visual feedback
by stressing the corresponding menu item, if any, when the accelerator is used.
!
Caution To process accelerator keystrokes for a provided thread, the developer must call
the TranslateAccelerator function in the message loop connected with the thread’s message
queue.
The TranslateAccelerator function monitors keyboard input to the message queue, verifying for
key combinations that match an entry in the accelerator table. When TranslateAccelerator locates
a match, it converts the keyboard input (that is, the WM_KEYUP and WM_KEYDOWN messages)
into a WM_COMMAND or WM_SYSCOMMAND message and then sends the message to the
window procedure of the particular window. The following illustration displays how
accelerators are processed.
The WM_COMMAND message comprises the identifier of the accelerator that caused
TranslateAccelerator to produce the message. The window procedure inspects the identifier to
find out the source of the message and then processes the message consequently.
Accelerator tables survive at two different levels. The system sustains a single, system-wide
accelerator table that applies to all applications. An application cannot amend the system
accelerator table.
LOVELY PROFESSIONAL UNIVERSITY 119