`
`Window Management
`
`Chapter
`
`Deciding how to present your applications
`tasks or processes
`requires considering
`and their skill
`intended
`audience
`
`your
`ject or task effective
`
`towards
`
`data-centered
`
`collection of related
`number of design
`factors
`the presentation of ob
`level
`on the display
`and evolution
`
`use of the space
`design
`
`Presentation of Object or Task
`What an Object
`represents and how it is used
`and relates
`to other
`objects influences how you present
`its view Simple objects that are
`primary window or only require
`self-contained may not require
`set of menu commands and
`property sheet
`to edit
`their properties
`
`An object with user-accessible content
`such
`in addition to properties
`primary window The single docu
`document only requires
`as
`ment window interface can be sufficient
`when the objects primary
`single unit even when containing different
`presentation or use is as
`views
`be supported with controls that
`types Alternative
`can easily
`the view Simple simultaneous
`allow the user to change
`views of the
`by splitting the window into panes
`same data can even be supported
`The system uses the single document window style of interface for
`most of the components it includes
`such
`folders
`
`as
`
`MDI workspaces workbooks
`and projects are more effective
`requires multiple views or the nature of
`the composition
`of an object
`These constructs
`the users tasks requires views of multiple objects
`and focus
`for
`set of specific
`user activities
`provide
`grouping
`within the larger environment of the desktop
`
`when
`
`MDI
`types The user cannot
`homogeneous
`is best suited for viewing
`objects within the same MDI parent windows unless
`mix different
`On the other hand you
`you supply them as part of the application
`can use MDI
`views
`to support simultaneous
`of different
`objects
`
`workbook when you want
`Use
`to optimize quick user navigation
`workbook
`of multiple views
`simplifies the task by eliminating
`the
`of child windows but in doing so it limits the users
`management
`views
`ability to see simultaneous
`
`The Windows Interface
`
`Guidelines
`
`for Software
`
`Design
`
`233
`
`255
`
`
`
`Chapter
`
`Window Management
`
`and mixing
`and projects provide flexibility for viewing
`Workspaces
`workspace as you would MDI
`of objects and their windows Use
`when you want
`the icons and their windows
`segregate
`to clearly
`project when you do not want
`task Use
`used
`in
`child windows
`
`to constrain any
`
`project provides the greatest flexibility
`for user placement
`of its windows It does so however
`at the expense
`arrangement
`it may be more difficult
`of an increase in complexity
`for
`because
`the child window of
`from windows of
`user to differentiate
`project
`
`and
`
`other applications
`
`Display Layout
`
`For very high
`for layout of information
`the requirements
`the use of menu bars toolbars
`and status
`resolution displays
`bars
`adequate display of the informa
`poses little problem for providing
`tion being viewed in window Similarly the appearance
`of these
`in each window has little
`common interface elements
`on the
`impact
`overall presentation At VGA resolution
`however
`this can be an
`set of windows
`issue The interface components for
`dominate the users work area that
`the user cannot
`their data
`
`should not so
`view or
`
`easily
`
`Consider
`
`manipulate
`
`MDI
`orkspaces wo kbooks
`and projects all allow some interface
`to be shared among multiple views Within shared ele
`components
`ments it must be clear when
`interface component
`ap
`particular
`plies Although you can automatically
`switch the content
`of those
`are common across views or
`consider what
`functions
`components
`child windows
`and present
`them in
`consistent way to provide for
`stability in the interface For example if multiple views
`share
`toolbar button present
`that button in
`consistent
`location
`shifts when the user switches
`buttons placement
`constantly
`view the users efficiency
`the task may decrease
`in performing
`Note that shared interfaces may make user custnmi7atinn
`of interface
`you need to indicate whether
`components more complex because
`applies to the current context or across all views
`customization
`
`If the
`
`the
`
`the
`
`234
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Software Design
`
`256
`
`
`
`Window Management
`
`Chapter
`
`Regardless
`
`of the window model you chose always
`consider allow
`which interface components they wish to have
`ing users to determine
`to consider how to
`displayed Doing so means that you also
`need
`com
`make basic functionality available if the user hides
`particular
`ponent For example pop-up menus
`can often supplement
`the inter
`face when the user hides the menu bar
`
`for
`
`Data-Centered Design
`single document window interface provides the best support
`and may be the easiest
`simple data-centered
`for users to
`design
`learn MDI supports more conventional
`application
`is best suited to multiple views of the same data or contexts
`sign It
`where the application does not represent views of user data You can
`and projects to provide single document
`use workspaces workbooks
`window interfaces while preserving some of the management
`tech
`by MDI
`niques
`provided
`
`centered
`
`de
`
`Combination of Alternatives
`
`interfaces MDIs workspaces workbooks
`Single document window
`and projects are not exclusive design
`It may be advanta
`techniques
`to combine these techniques
`For example
`documents can be
`geous
`You can also design workbooks
`and
`presented within
`workspace
`In similar fashion
`projects as objects within
`workspace
`workbook
`as one of its objects
`might contain
`
`project
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`235
`
`257
`
`
`
`258258
`
`
`
`CHAPTER
`
`ffitegrating with the
`System
`
`Users appreciate seamless
`
`integration
`
`between the system and their
`covers
`This chapter
`information
`about
`integrating your
`applications
`software with the system and how to extend
`its features
`including
`using the registry
`information
`about your application
`install
`to store
`using appropriate naming conventions and
`the taskbar Control Panel and
`such
`features
`
`ing your application
`
`supporting shell
`Recycle Bin
`
`as
`
`to provide an overview Details re
`This chapter
`is only intended
`of this guide For
`quired for some conventions
`go beyond the scope
`these conventions see the documentation
`information
`about
`inclu
`ded in the Microsoft Win32 Software Development Kit SDK In
`and features may not be sup
`some of these conventions
`addition
`ported in all releases For more information
`about
`releases
`specific
`Supporting Specific Versions of Windows
`see Appendix
`
`The Registry
`
`special repository
`
`called the registry
`
`that serves
`and com
`is not intended
`
`for
`
`placed
`information
`
`in it affects
`
`your appli
`the icons
`determines
`
`259
`
`Windows provides
`configuration
`
`as
`
`central
`
`database
`
`puter-specific
`
`information
`
`direct user access
`cations user interface Registered
`
`for user- application-
`Although the registry
`the information
`
`
`
`Chapter
`
`10 Integrating with
`
`the System
`
`commands
`files The registry
`and other features displayed for
`it easier to man age and support configuration
`makes
`information
`used by your application and eliminates redundant
`locations
`stored in different
`
`information
`
`also
`
`is
`
`stmcture Each node in the tree is called
`The registry
`hierarchical
`and data entries
`called values
`key Each key can contain subkeys
`Key names cannot
`or wildcard charac
`include
`space backslash
`In the HKEY CLASSES ROOT key names beginning
`or
`ter
`for special syntax filename exten
`are reserved
`period
`key name The name of
`sions but you can
`include
`period within
`subkey must be unic ue with respect
`to its parent key Key names
`their values may be
`localized into other languages
`are not
`although
`
`with
`
`key can have any number of values
`value entry has three parts
`the name of the value its data type and the value itself Value en
`tries larger than 2048 bytes should
`be stored as
`files with their
`filenames
`stored in the registry
`
`The example registry
`in this chapter
`the hierarchical
`
`relationship
`
`represent
`
`entries
`
`only
`
`of
`
`the
`
`information
`
`about
`
`For more
`keys
`the registry and registry file formats
`the documentation
`SDK
`
`see
`the Win32
`
`included
`
`in
`
`To use memory most effi
`system stores
`that have
`
`the
`
`entries
`
`ciently
`
`the
`
`registry
`only
`been installed and that are required
`should
`for operation Applications
`to write
`
`fail
`
`never
`because
`
`it
`
`installed
`
`entry
`
`registry
`is not already
`To ensure this happens
`
`try creation
`
`functions
`
`an entry
`
`use
`regis
`when adding
`
`register
`
`data
`
`When
`keys for where ap
`the user installs your application
`shell com
`plication data is stored for
`filename extensions
`icons
`mands OLE registration
`and for any special extensions
`To
`you can create
`your applicatians
`information
`registra
`register
`tion file and use the Registry Editor
`to merge this file into the
`system registry You can
`also use other utilities that support
`this
`or use the system-supplied
`functions to access
`function
`data
`or manipulate
`
`registry
`
`registry
`
`to store
`
`state
`
`Registering ApplicaLion State Information
`Use the registry
`for your application
`you may
`the data you store
`here will be information
`Typically
`have stored in initialization
`.INI files in previous releases of
`Windows
`the Software subkey in the
`under
`Create
`subkeys
`HKEY LOCAL_MACHINE and HKEY CURRENT_USER
`include information
`about your application
`keys that
`
`information
`
`238
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Snftware
`
`Design
`
`260
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`HKEY LOCAL MACHINE
`Software
`CompanyName
`ProductName
`Version
`
`USER
`
`HKEY CURRENT
`Software
`CompanyName
`ProductName
`Version
`
`store
`
`settings
`
`Use your applications HKEY LOCAL MACHINE entry as the
`data and the HKEY CURRENT
`location to store
`computer-specific
`USER entry to store user-specific
`data The latter key allows you to
`individual users working
`to tailor your application for
`with the same computer Under your applications
`subkey you can
`define your own structure
`for the information
`Although the system
`files for backward compatibility use the
`still supports initialization
`registry wherever possible to store
`informa
`tion instead
`
`your applications
`
`state
`
`state whenever appropriate
`Use these keys to save your applications
`as when the user closes its primary window In most cases
`such
`window
`to its previons state when the user reopens
`best to restore
`
`it is
`
`it
`
`that
`
`state
`
`state
`
`under
`
`that
`
`the user shuts down the system with your applications win
`When
`dow open you may optionally store
`information
`so
`in the registry
`is restored when the user starts up Win
`the applications
`dows The system does
`this for folders To have your applications
`your window and application
`information
`restored store
`entries when the system notifies
`its registry
`it is shutting down Store the state
`information
`in your appli
`under HKEY_CURRENT
`USER and add
`cations
`value
`entries
`namevalue pair to the RunOnce
`subkey that corresponds
`to your
`application When
`the system it runs the command
`the user restarts
`line you supply Once your applieatiufl
`runs you can use the data
`you stored to restore its state
`
`state
`
`your application
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Software Design
`
`239
`
`261
`
`
`
`Chapter
`
`10
`
`Integrating with
`
`the System
`
`USER
`
`HKEY_CURRENT
`Software
`Microsoft
`Windows
`CurrentVersion
`RunOnce
`
`application
`
`identifier
`
`command line
`
`you can include value name
`If you have multiple instances open
`single entry and use com
`for each or consolidate them as
`entries
`that are most appropriate for your application
`mand-line switches
`For example you can
`include entries
`like the following
`
`WordPad Document
`C\Program Files\Wordpad.exe
`WordPad Document
`C\Program Files\Wordpad.exe
`Paint
`C\Program Files\Paint.exe
`Abstract.bmp
`
`Cubist.bmp
`
`Letter
`
`to Bill restore
`
`Letter
`
`to Paul
`
`/restore
`
`valid command line string
`As long as you provide
`that your appli
`way that best fits
`format
`the entry in
`cation can process you can
`your application
`
`the HKEY_LOCAL
`RunOnce
`You can also include
`entry under
`MACHINE key When using this entry however
`the system runs
`up You can use this entry for applica
`the application before starting
`that may need to query
`the user for information
`tions
`that affects
`how Windows
`remember
`starts
`Just
`all users of the computer
`
`that any entry here will affect
`
`RunOnce
`removed from the registry
`once
`are automatically
`entries
`the system starts up Therefore you need not remove or update
`the
`its state when the user
`entries but your application must always
`save
`shuts down the system The system also supports
`Run subkey in
`both the HKEY_CURRENT_USER
`and HKEY_LOCAL
`MACHINE keys The system runs any value name entries under
`the system starts up but does not remove those
`this subkey after
`from the registry For example
`virus check program can be
`the system starts up You can also
`to run automatically
`file or shortcut
`file in the
`this functionality by placing
`to
`support
`Startup folder The registry
`the location of the Startup folder
`value in HKEY CURRENT USER \Software\Microsoft\
`Folders
`Windows\CurrentVersion\Explorer\Shell
`
`entries
`
`installed
`
`as
`
`IJ The systems ability
`
`to restore
`
`state depends
`
`an applications
`on the availability
`and
`
`its data files If
`
`of the application
`have
`been
`
`they
`
`deleted
`
`or
`
`the
`
`user
`
`has
`
`over
`
`the network where
`
`in
`
`logged
`same
`
`the
`
`files
`
`are
`
`not
`
`available
`
`the
`
`system
`
`may not
`
`be able to restore the state
`
`after
`
`stores
`
`240
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`262
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`paths
`
`Registering Application Path Information
`The system supports per application
`path
`If you register
`Windows
`sets the PATH environment
`variable to be the registered
`hen it starts your application
`You set your applications
`path
`path
`the HKEY_LOCAL_MACHINE
`in the App Paths subkey under
`new key using your applications
`key Create
`executable
`filename
`as its name Set
`this keys Default value to the path of your execut
`able file The system uses this entry to locate your application if it
`fails to find it in the current path for example if the user chooses
`the
`Run command on the Start menu and only includes the filename of
`icon doesnt include
`path setting To
`or if
`the application
`shortcut
`
`the location of dynamic-link
`libraries placed
`in
`separate
`identify
`value entry called Path and
`directory you can
`its value to the path of your dynamic-link
`libraries
`set
`
`include another
`
`also
`
`HKEV LOCAL MACHINE
`Software
`Microsoft
`Windows
`CurrentVersion
`App Paths
`Application Executable Filename
`
`path
`Path
`
`path
`
`update the path and default entries
`The system will automatically
`the user moves or renames the applications
`file using the
`executable
`system shell user interface
`
`if
`
`shared dynamic-link
`Register any system-wide
`subkey
`SharedDLLs subkey of HKEY_LOCAL_MACHINE key
`under
`index
`the entrys
`If the file already exists increment
`count
`usage
`For more information
`index see the section
`about
`the usage
`count
`Installation later
`in this chapter
`
`libraries in
`
`HKEY LOCAL MACHINE
`Software
`Microsoft
`Windows
`CurrentVersion
`SharedDLLs filename
`
`usage count
`
`index
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`241
`
`263
`
`
`
`Chapter
`
`10
`
`Integrating with
`
`the System
`
`Registering File Extensions
`If your application creates and maintains files register
`for
`entries
`to users and that you want
`the file types that you expose directly
`users to be able to easily differentiate For
`ery file type you regis
`two entries
`key entry and
`filename-extension
`ter include at
`an application class identification
`
`key entry
`
`least
`
`file type it will be displayed
`If you do not register
`an extension for
`icon as shown
`in Figure 10.1
`with the systems generic file object
`and its extension will always
`be displayed
`In addition
`the user will
`the file to open it Open With will be the
`not be able to double-click
`icons default command
`
`Figure
`
`10.1 System-generated
`
`icons
`
`for unregistered
`
`types
`
`The Filename Extension Key
`
`The filename extension entry maps
`filename extension to an appli
`To register
`cation identifier
`subkey in the
`an extension
`create
`HKEY CLASSES ROOT key using the three-letter
`extension
`period and set
`to an application
`
`including
`
`its value
`
`identifier
`
`HKEY CLASSES ROOT
`.ext
`
`Applicationldentifier
`
`For the value of the application identifier also known as program
`or Prog ID use
`matic identifier
`that uniquely
`string
`is used internally
`by the system and is not
`class This string
`to users unless explicitly
`exported with
`exposed directly
`special
`registry utility there ore you need not localize this entry
`
`identifies
`
`given
`
`242
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`264
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`Avoid assigning multiple extensious to the same application identi
`fier To ensure that each
`file type can be distinguished
`by the user
`define each extension such
`that each
`has
`application identi
`uuique
`the user does not interact with di
`If you have utility files that
`fier
`them
`an extension and icon for
`rectly you should
`register
`they can be identified In addi
`the same extension so that
`preferably
`tion mark them with the hidden
`file attribute
`
`still
`
`that use the same
`
`The system provides no arbitration
`for applications
`and check
`So define unique
`the registry
`exteusions
`identifiers
`avoid writing over and replacing existing extension entries
`prac
`the users existing files More spe
`tice which may seriously affect
`an extension that conflicts
`avoid registering
`or redefines the
`cifically
`common filename extensions used by the system Examples of these
`extensions are shown in Table 10.1
`
`to
`
`Table 10.1 Common Filename Extensions Supported by Windows
`
`Extension
`
`Type description
`
`386
`
`3GR
`
`ACM
`
`ADF
`
`ANT
`
`AVI
`AWD
`AWP
`
`AWS
`
`BAK
`
`BAT
`
`BFC
`
`BIN
`
`BMP
`
`CAB
`
`CAL
`
`CDA
`
`CFG
`
`Windows
`
`virtual device driver
`
`Screen grabber
`
`for MS DOS based
`
`applications
`
`Audio compression manager
`
`driver
`
`Administration configuration
`
`files
`
`Animated
`
`pointer
`
`Video clip
`
`FAX viewer
`
`document
`
`FAX key viewer
`
`FAX signature
`
`viewer
`
`Backed
`
`up file
`
`MS-DOS batch file
`
`Biicfcasc
`
`Binary data file
`
`Picture Windows
`
`bitmap
`
`Windows Setup file
`
`Windows Calendar
`
`file
`
`CD audio track
`
`Configuration file
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Software Design
`
`243
`
`265
`
`
`
`Chapter
`
`10
`
`Integrating with the Sys tern
`
`Continued
`
`Extension
`
`Type description
`
`CNT
`
`COM
`
`CPD
`
`CPE
`
`CPI
`
`CPL
`
`CRD
`
`CSV
`
`CUR
`
`DAT
`
`DCX
`
`DLL
`DOC
`
`DOS
`
`DRY
`
`EXE
`
`FND
`
`FON
`
`FOT
`
`GR3
`
`GRP
`
`HLP
`
`HT
`
`1CM
`
`ICO
`
`IDF
`
`IMP
`
`INI
`
`Help con tents
`
`MS-DOS
`
`based application
`
`FAX cover page
`
`FAX cover page
`
`International
`
`code
`
`page
`
`Control Panel extension
`
`Windows Cardfile
`
`document
`
`Command-separated
`
`data file
`
`Cursor pointer
`
`System data file
`
`FAX viewer
`
`document
`
`Applicatinn extension dynamic-link
`
`library
`
`WordPad document
`
`MS DOS file also extension
`drivers
`
`protocol
`
`for NDIS2 net card and
`
`Device driver
`
`Application
`
`Saved
`
`search
`
`Font
`
`file
`
`Shortcut
`
`10 font
`
`Windows
`
`3.0 screen
`
`grabber
`
`Program group file
`
`Help file
`
`HyperTerminalTM file
`
`1CM profile
`
`Icon
`
`MIDI
`
`ins rument definition
`
`Setup information
`
`Initialization file configuration settings
`
`244
`
`The Windows
`
`Interface
`
`Gnidelines
`
`for Software Design
`
`266
`
`
`
`Integrating with the System Chapter
`
`10
`
`Continued
`
`Extension
`
`Type description
`
`KBD
`
`LGO
`
`LIB
`
`LNK
`
`LOG
`
`MCI
`
`MDB
`
`MID
`
`MIF
`MMF
`MMM
`MPD
`
`MSG
`
`MSN
`
`NLS
`
`PAB
`
`PCX
`
`PDR
`
`PF
`
`PIF
`
`PPD
`
`PRT
`
`PST
`
`PWL
`
`QIC
`
`REC
`
`REG
`
`RLE
`
`RMI
`
`Keyboard
`
`layout
`
`Windows
`
`logo driver
`
`Static-link
`
`library
`
`Shortcut
`
`Log file
`
`MCI command set
`
`File viewer
`
`extension
`
`MIDI
`
`sequence
`
`MIDI
`
`instrument
`
`file
`
`Microsoft Mail message
`
`file
`
`Animation
`
`Mini-port driver
`
`Microsoft
`
`Exchange mail document
`
`Microsoft Network
`
`home base
`
`Natural
`
`language services
`
`driver
`
`Microsoft Exchange
`
`personal
`
`address
`
`book
`
`Bitmap picture PCX format
`
`Port driver
`
`1CM profile
`to MS DOS based application
`
`Shortcut
`
`PostScript0
`
`printer
`
`description
`
`file
`
`Printer
`
`formatted file result
`
`of Print
`
`to File option
`
`Microsoft Exchange
`
`personal
`
`information store
`
`Password
`
`list
`
`Backup
`
`set
`
`for Microsoft Backup
`
`Windows Recorder
`
`file
`
`Application registration
`
`file
`
`Picture RLE format
`
`MIDI
`
`sequence
`
`The Windows Interface
`
`Guidelines
`
`for Software
`
`Design
`
`245
`
`267
`
`
`
`Chapter
`
`10
`
`Integrating with the System
`
`Continued
`
`Extension
`
`Type description
`
`RTF
`
`SCR
`
`SET
`
`SHB
`
`SHS
`
`SPD
`
`SWP
`
`SYS
`
`TIP
`
`TMP
`
`TRN
`
`TSP
`
`TIFF
`
`TXT
`
`VBX
`
`VER
`VXD
`
`WAV
`
`WPC
`
`WRI
`
`Doeume at
`
`rich-text
`
`format
`
`Screen saver
`
`File set for Microsoft Backup
`
`Shortcut
`
`into
`
`document
`
`Scrap
`
`PostScri
`
`at printer
`
`description
`
`file
`
`Virtual memory
`
`storage
`
`System file
`
`Picture TIFF format
`
`Temporary
`
`file
`
`Translation
`
`file
`
`Windows
`
`telephony
`
`service provider
`
`TrueType font
`
`Text document
`
`Microsoft Visual Basic control
`
`file
`
`Version description
`
`file
`
`Virtual
`
`device driver
`
`Sound wave
`
`WordPad
`
`file converter
`
`Windows Write document
`
`It
`
`is
`
`good idea to investigate extensions commonly
`used by popular
`new extension that might
`so you can avoid
`creating
`applications
`conflict with them unless you intend to replace or superset the func
`tionality of those applications
`
`246
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Software
`
`Design
`
`268
`
`
`
`The Application
`
`Identifier Key
`
`Integrating with
`
`the System Chapter
`
`10
`
`registry
`
`The second
`file type is its class-defini
`entry you create for
`tion Prog ID key Using the same string
`the application identi
`key and assign
`value create
`for the extensions
`fier you used
`type name as
`the value of the key
`
`as
`
`HKEY CLASSES ROOT
`.ext
`Applicationidentifier
`Type Name
`
`Applicationidentifier
`
`Under
`
`this key you specify shell and OLE properties of the class
`this entry even if you do not have any extra information
`Provide
`place under this key doing
`so provides
`for users to identify
`label
`the file type In addition
`the icon for
`you use this entry to register
`the file type
`
`to
`
`the type name also known as
`the MainUserTypeName as
`Define
`or class name
`the human-readable form of its application identifier
`convey to the user the objects name behavior or capabil
`It should
`type name can
`elements
`include all of the following
`
`ity
`
`Company Name
`Communicates
`
`product
`
`identity
`
`Name
`Application
`Indicates which application
`
`object
`
`is responsible for activating
`
`data
`
`Data Type
`Indicates the basic category
`or sound Limit
`
`spreadsheet
`mum of 15
`
`of the object for example drawing
`the number of characters to maxi
`
`Version
`When there are multiple versions of the same basic type for up
`version number
`you may want
`to include
`grading purposes
`types
`distinguish
`
`to
`
`When defining your type name use title capitalization The name
`can include up to maximum of 40 characters Use one of the fol
`forms
`lowing three recommended
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`247
`
`269
`
`
`
`Chapter
`
`10
`
`Integrating with the System
`
`Name
`Company Name Application
`For example Microsoft
`Excel Worksheet
`
`Data Type
`
`Company Name-Application Name
`Data Type
`For cases when the company
`name and application are the same
`2.0 Document
`for example ExampleWare
`
`Company Name Application
`When
`the application
`sufficiently
`example Microsoft Graph
`
`Name
`
`describes the data type
`
`for
`
`for refer
`
`interface
`associated
`
`want
`
`to include
`
`type portion of
`
`the full
`
`These type names provide the user with
`precise language
`ring to objects Because
`type names appear
`object
`the
`throughout
`the user becomes
`type and its
`conscious
`of an objects
`However hecause
`of their
`behavior
`you may also
`length
`type name
`type name is the data
`short
`short
`that support OLE
`type name Applications
`type name entry in the registry Use the short
`include
`short
`always
`and pop-up menus For example
`type name in drop-down
`is simply referred to as Worksheet
`Microsoft Excel Worksheet
`in menus
`
`short type name add an AuxUserType subkey under
`To provide
`regis ered CLSID subkey which is under
`the applications
`the
`CLSID key
`
`HKEY CLASSES ROOT
`.ext
`Applicationldentifier
`
`Applicationidentifier
`CLSID
`
`Type Name
`identifier
`
`CLSID
`
`CL.SID identifier
`AuxUserType
`Short Type Name
`
`If
`
`short
`
`type name is not available for an object because
`the string
`type name instead All controls that
`was not registered
`use the full
`type name must allocate
`for 40 charac
`display the full
`enough
`space
`ters in width By comparison
`controls need only accommodate
`characters when using the short
`type name
`
`15
`
`248
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Sottware
`
`Design
`
`270
`
`For more
`
`information
`
`about
`
`registering
`
`names
`
`other
`information
`clude under
`
`type
`you should
`the CLSID key see
`OLE
`documentation
`Win32 SOK
`
`included
`
`in the
`
`and
`
`in
`
`the
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`Supporting Creation
`The system supports the creation of new objects in system contain
`as folders and the desktop Register
`information
`for each
`ers such
`the system to include The registered type
`file type that you want
`will appear on the New command that
`the system includes on menus
`the desktop folders and the Open and Save As common dialog
`for
`boxes This provides
`more data-centered
`because
`the user
`design
`new object without
`to locate and run the associ
`can create
`ated application
`
`having
`
`To register
`
`Application
`
`subkey using the
`subkey in HKEY
`CLASSES ROOT Under it also create the ShdilNew subkey
`
`file type for inclusion
`under
`the extensions
`Identifier
`
`create
`
`HKEY CLASSES ROOT
`.ext
`Applicationidentifier
`
`Applicationidentifier
`Value Name
`ShelINew
`
`Value
`
`value entry to the SheilNew subkey with one of the four
`Assign
`methods for creating
`file with this extension
`
`Value name
`
`Value
`
`Result
`
`NullFile
`
`Data
`
`binary data
`
`FileName
`
`path
`
`Command
`
`filename
`
`new file of
`Creates
`null empty file
`
`this
`
`type as
`
`Creates
`
`binary
`
`new file containing
`data
`
`Creates
`
`specified
`
`new file by copying
`file
`
`the
`
`the
`
`the command Use this
`Carries out
`to run your own application
`code to
`new file for example run
`create
`
`wizard
`
`The Windows Interface
`
`Guidelines
`
`for Software
`
`Design
`
`249
`
`271
`
`
`
`Chapter
`
`10
`
`Integrating with
`
`the System
`
`The system also will automatically
`provide
`new file using the type name you register
`
`unique
`
`filename for
`
`the
`
`Commaud value place your application file that
`When using
`creates the new fi1e in the directory that
`the system uses to store
`these files To determi ce the path for that directory check
`the setting
`value in the Shell Folders subkey found in
`for the Templates
`HKEY CURRENT
`LISER\Software\Microsoft\Windows\
`Then you need only register
`CurrentVersion\Explorer
`filename for the command
`
`the
`
`Registering Icons
`
`to determine
`
`which icon to display for
`The system uses the registry
`file You register
`an icon for every
`data file type that your
`specific
`application supports and that you want
`the user to be able to distin
`Defaultlcon subkey entry under
`guish easily Create
`and define its value
`subkey you created
`as
`the icon Typically
`you use the applications
`filename containing
`filename and the index of the icon within the file The
`
`tion identifier
`
`executable
`
`the applica
`the
`
`to the icon resource within the file
`index value
`corresponds
`represents the icons position in the file
`tive number
`negative
`ID number of the
`number corresponds
`to the inverse of the resource
`icon The icon for your application should
`be the first icon
`always
`file The system always
`in your executable
`uses the first
`resource
`files This means the index
`icon resource
`to represent executable
`for your data files will be
`number greater than
`
`posi
`
`value
`
`HKEY CLASSES ROOT
`Applicationidentifier
`Defaulticon
`
`path
`
`Type Name
`
`executable
`
`reg-
`
`For more
`
`information
`
`about
`
`icons see Chapter
`designing
`13 Visual Design
`
`file you can
`Instead of registering the applications
`file .DLL an icon file
`ister the name of
`dynamic
`link library
`.ICO or bitmap file .BMP to supply your data file icons If an
`icon dues nut exist or is not registered
`the system supplies an icon
`derived from the icon of the file types registered application
`If no
`icon is available for the application
`the system supplies
`icon These icons do not make your files uniquely
`identifiable so
`and register
`and its data file
`icons for both your application
`design
`16 pixel 16 color
`32
`types Include the following
`sizes 16
`pixel 16 color and 48
`48 pixel 256 color
`
`generic
`
`32
`
`250
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`272
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`Registering Commands
`Send To Cut
`Many of the commands found on icons including
`Copy Paste Create Shortcut Delete Rename and Properties
`are
`is their containing folder or the
`by their container
`that
`provided
`for the icons primary com
`desktop But you must provide support
`mands also referred to as verbs such
`as Open Edit Play and Print
`You can also register
`commands that apply to your file
`additional
`as Whats This command and even commands for
`types such
`other file types
`
`in the HKEY CLASSES_ROOT key you
`To add these commands
`command
`shell subkey and
`subkey for each verb and
`subkey for each menu command name
`
`register
`
`HKEY CLASSES ROOT
`Type Name
`Applicationidentifier
`shell
`default verb
`Menu Command Name
`verb
`command
`pathname
`
`You can also register
`
`DDE command string
`
`for
`
`DDE command
`
`1-IKEY CLASSES_ROOT
`Type Name
`Applicationidentifier
`shell
`default verb
`Menu Command Name
`verb
`DDE command string
`ddeexec
`DDE Application Name
`Application
`DDE topic
`name
`Topic
`
`verb is
`
`name of the command Applica
`language-independent
`command programmatically
`tions may use it to invoke
`specific
`The system defines Open Print Find and Explore as standard
`verbs
`provides menu command names
`and appropriate
`and automatically
`access key assignments localized in each
`intemational
`version of
`Windows When
`you supply verbs other than these provide menu
`version of Windows
`command names
`on
`localized for the specific
`which the application is installed To assign menu command name
`verb make it the default value of the verb subkey
`
`for
`
`The Windows Interface
`
`Guidelines
`
`for Software Design
`
`251
`
`273
`
`
`
`Chapter
`
`10 Integrating with
`
`the System
`
`The menu command names
`to the verbs for
`corresponding
`file type
`folders File drop-down menu
`on
`are displayed to the user either
`or pop-up menu for
`files icon These
`appear at the top of the
`menu You define the order of the menu commands by ordering the
`the de
`verbs in the value of the shell key The first verb becomes
`fault command in the menu
`
`the menu
`ion follows how you enter format
`By default
`capitalizal
`command name value of the verb subkey Although the system auto
`commands Open Print Explore
`the standard
`matically capitalizes
`and Find you can use the value of the menu command name to
`the capitalization differently Similarly you use the menu
`format
`command name value
`the access key for the menu command
`to set
`normal menu conventions prefixing the character
`in the
`following
`name with an ampersand
`Otherwise the system sets
`the first
`letter of the command as
`the access key for that command
`
`To support user execution
`verb provide the path for
`of
`the applica
`tion or DDE command string You can
`include command-line
`For paths include
`switches
`parameter This parameter
`for whatever
`file the user selects
`
`operational placeholder
`
`is an
`
`an Analyze command for an application that
`For example to register
`stock market information
`entries might look
`the registry
`manages
`like the following
`
`HKEY CLASSES ROOT
`Stock Data
`stockfile
`
`shell
`
`analyze
`Analyze
`analyze
`command
`C\Program Files\Stock Analysis\Stock.exe
`
`IA
`
`for each command You may assign one
`You may have different
`values
`the Open command and another
`to carry out
`application to carry out
`cr use the same application for all commands
`the Print command
`
`252
`
`The Windows
`
`Interface
`
`Guidelines
`
`for Software
`
`Design
`
`274
`
`
`
`Integrating with
`
`the System Chapter
`
`10
`
`Enabling Printing
`
`Print verb entry in the shell
`file types are printable include
`If your
`subkey under HKEY_CLASSES_ROOT following
`the conven
`tions described
`in the previous section This will display the Print
`command on the pop-up menu for the icon and on the File menu of
`the folder in which the icon resides when the user selects
`the icon
`When
`the Print command
`the user chooses
`the system uses the reg
`what application to run to print
`istry entry to determine
`the file
`
`Also register
`Print To registry
`entry for the file types your applica
`tion supports This entry enables dragging
`of
`and dropping
`file
`Print To command is not displayed
`icon Although
`onto
`printer
`the default command
`on any menu the printer
`includes Print Here as
`on the pop-up menu displayed when the user drag and drops
`file on
`using button
`the printer
`
`In both cases print
`the file preferably without opening
`the
`primary window One way to do this is to provide
`applications
`command-line
`runs the application for handling the print
`switch that
`ing operation only for example WordPad.exe Ip In addition dis
`play some form of user feedback
`indicates whether
`printing
`that
`has been initiated and if so its progress For example this
`be modeless message box that displays Printing
`could
`on printer name and
`Cancel button You may also
`progress indicator control