App Studio Table of Contents
App Studio

How to Use App Studio

   App Studio Basics

   Using the Dialog Editor

   Using the Menu Editor

   Using the Graphics Editor

   Using the Accelerator Editor

   Using the String Editor

   Using the Binary Editor

   Working with Symbols

   Using ClassWizard

Other Help Topics

   Help in Brief

   Update for Windows NT

   Using Search Plus


Copyright Notice
Copyright Notice for App Studio Help

Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without express written permission of Microsoft Corporation.

© 1993 Microsoft Corporation. All rights reserved.

Microsoft is a registered trademark and Windows and Windows NT are trademarks of Microsoft Corporation.


Accelerator Table Editor Topics

How Do I?	Brief	Click
Learn about the accelerator table editor	Defining an accelerator table; uses of accelerators and the accelerator table editor
Create and edit accelerator resources	Creating a new accelerator table; opening the accelerator table editor
Edit the accelerator table	Adding, deleting, or changing accelerator key definitions
Edit accelerator properties	Using the property page associated with the accelerator table editor
Type in accelerator values	Legal values for accelerator keys
Associate a menu item with an accelerator key	Linking accelerator keys and menu items; adding the name of the key to the menu item caption


Using the Accelerator Table Editor

An accelerator table is a Windows resource that contains a list of accelerator keys (also known as shortcut keys) and the command identifiers that are associated with them. A program can have more than one accelerator table.

Normally accelerators are used as keyboard shortcuts for program commands that are also available on a menu or toolbar. However, you can use the accelerator table to define key combinations for commands that don't have a user−interface object associated with them.

You can use Visual C++ for Windows NT ClassWizard to hook accelerator key commands to code. For more information, see ClassWizard Topics.

You can use the accelerator table editor to:

Add, delete, change, or browse the accelerator key assignments in your project.

View and change the resource identifier associated with each entry in the accelerator table. The identifier is used to reference each accelerator table entry in program code.

Associate an accelerator key with a menu item.


Creating and Editing Accelerator Resources

You can call up the accelerator table editor to edit an existing accelerator table or create a new one.

   To create a new accelerator table:

In the resource browser window, click New, or from the Resource menu, choose New. Then select Accelerator from the list of choices and click OK or press ENTER.

Toolbar shortcut: .

Shortcut: CTRL+R.

The accelerator table editor window appears.

Note  Windows does not allow the creation of empty accelerator tables. If you create an accelerator table with no entries, it is deleted automatically when you save the file.

   To edit an existing accelerator table:

1.	Move to the resource browser window.

2.	In the Type box, select Accelerator.

A list of the accelerator tables in the current file appears in the Resources box.

3.	In the Resources box, select the accelerator table you want to edit.

4.	Choose Open.

-Or-

Select the resource and press ENTER.

-Or-

Double−click the resource.

-Or-

From the Resource menu, choose Open.

The accelerator table editor window appears.


Editing the Accelerator Table

When you edit an existing accelerator table or create a new one, the accelerator table editor window appears. Use the accelerator table window to browse existing accelerator keys, delete keys, or select the new−item box (an empty rectangle) at the end of the list. Move to the accelerator table property page to edit or define values for each accelerator table entry.

   To add an entry to the accelerator table:

1.	Select the new−item box at the end of the list, or from the Resource menu, choose New Accelerator (INS).

2.	Move to the General property page to define the key. (Pressing INS, or typing the key name with the new−item box selected, moves you to the Properties window automatically.)

Note  Make sure all accelerators you define are unique. When duplicate accelerator keys are assigned, only the first one works correctly.

   To delete an entry from the accelerator table:

1.	Select the entry you want to delete. Use the CTRL or SHIFT keys to select multiple entries.

2.	Choose Delete at the bottom of the accelerator table editor window, or from the Edit menu, choose Delete.

Shortcut: DEL.

   To move or copy an accelerator table entry from one resource script file to another:

1.	Open the accelerator table editor windows in both resource script files.

2.	Use the drag and drop method.

− Or −

Use the Edit menu's Copy (or Cut) and Paste commands.

Note  You can also use the CTRL key with drag and drop, or use the Edit menu, to copy keys within an accelerator table. However, exercise caution when doing so as this creates duplicate accelerator keys. App Studio does not prompt you to resolve accelerator key conflicts.


Editing Accelerator Properties

Use the accelerator table's General property page to edit the values for each accelerator.

An accelerator can be either an ASCII value or virtual key. A virtual key is a device−independent identifier. The Key box on the General property page contains a list of standard virtual key identifiers.

   To define or change the values for an accelerator table entry:

1.	Select the entry you want to define or change.

2.	Move to the General property page. In the Key box, type the name of the key, or choose from the list of virtual key identifiers.

Select additional options as appropriate under Modifiers (CTRL, ALT, or SHIFT) and Type (ASCII or VirtKey [virtual key]). When first created, a new key has the CTRL modifier selected.

− Or −

Choose Next Key Typed and then type the key or key combination you want to enter. The Key box and the options under Modifiers and Type are updated automatically.

Note  Accelerator values entered using the Next Key Typed command are always entered as virtual keys, if possible.


Typing in Accelerator Values

The following are legal entries in the Key box of an accelerator table's General property page:

An integer between 0 and 255 in decimal, hexadecimal, or octal format. The setting of the Type property determines if the number is an ASCII or virtual key value.

Single−digit numbers are always interpreted as the corresponding key, rather than as ASCII values. To enter an ASCII value from 0 to 9, precede it with two zeros (for example, 006).

A single keyboard character. Uppercase A−Z or the numbers 0 through 9 can be either ASCII or virtual key values; any other character is ASCII only.

A single keyboard character in the range A−Z (uppercase only), preceded by a caret (^) [image] for example, ^C. This enters the ASCII value of the key when it is pressed with the CTRL key held down.

Note  When entering an ASCII value, the CTRL and SHIFT modifiers are not available. You cannot use a control−key combination entered with a caret to create a virtual accelerator key.

Any valid virtual key identifier. The Key box on the General property page contains a list of standard virtual key identifiers.


Binary Data Editor Topics

How Do I?	Brief	Click
Learn about the binary editor	Using the binary data editor; keyboard shortcuts
Create a new data resource or custom resource	Using standard .RC file syntax and the File menu Set Includes command to add a custom resource
Open a resource	Opening the binary data editor
Edit a resource	Editing a resource at the binary level


Using the Binary Data Editor

The App Studio binary data editor allows you to edit a resource at the binary level in either hexadecimal or ASCII format.

You should use the binary editor only when you need to view or make minor changes to custom resources or resource types not supported by App Studio.

Caution  Editing nondata resources in the binary data editor can corrupt the resource. A corrupted resource can cause App Studio and Windows to behave in unexpected ways.

Keyboard Shortcuts

To:	Press:
Move selection right	RIGHT ARROW
Move selection left	LEFT ARROW
Move selection up	UP ARROW
Move selection down	DOWN ARROW
Move between hexadecimal and ASCII listings	TAB


Creating a New Data Resource or Custom Resource

You create new custom or data resources by placing them in a separate file using normal .RC file syntax, and then including the file with the File menu Set Includes command.

  To create a new custom or data resource:

1.	Use Visual Workbench to create an .RC file that contains the custom or data resource.

Custom data can be entered in an .RC file as null-terminated quoted strings, or as integers in decimal, hexadecimal, or octal format. For more information see the Software Development Kit documentation.

2.	From the App Studio file menu, choose Set Includes.

The Set Includes dialog box appears.

3.	In the Compile-Time Directives box, type an include statement that gives the name of the file containing your custom resource. For example:

#include mydata.rc

Make sure the syntax and spelling of what you enter is correct.  The contents of the Compile-Time Directives box is inserted into the resource script file exactly as you type it.

4.	Choose OK to record your changes. The custom or data resource is included in your application at compile time.


Opening the Binary Editor

   To open a resource for binary editing:

1.	Move to the resource browser window.

2.	In the Type box, choose the resource type you want to edit.

3.	In the Resources box, select the specific resource you want to edit.

4.	From the Resource menu, choose Edit Binary Data .

Shortcut: CTRL+B.

The binary data window appears.

Note  If you use the resource browser window to open a resource whose format App Studio does not recognize (such as a VERSION, RCDATA, or custom resource), App Studio automatically opens the resource in the binary data editor.

Note  If you want to use the binary data editor on a resource already being edited in another App Studio editor window, close the other editor window first.


Editing Data

   To edit a resource in the binary data editor:

1.	Select the byte you want to edit.

The TAB key moves the focus between the hexadecimal and ASCII sections of the editor window. PAGEUP and PAGEDOWN move you through the resource one screen at a time. You can also move to the top of the resource with CTRL+HOME and to the end with CTRL+END.

2.	Type the new value.


String Editor Topics

How Do I?	Brief	Click
Learn about using the string editor and string tables	Using the string table editor
See a list of shortcut keys	List of shortcut keys for the string table editor
Create a new string table	Opening a new or existing string table
Find a string table entry	Using the string table editor's Find command
Add, delete, and move a string	Adding, deleting, or moving a string
Edit a string's properties	Editing a string; adding special characters to a string


Using the String Editor

The App Studio string editor is a window that, along with its associated property page, allows you to edit or add to a program's standard Windows string table resource.

You can use the string editor to:

Create a new string table.

View the string segments in a program.

Add or delete individual strings, or move them from one segment to another.

Change a string, or its name or value.

String Tables

In programming for Windows, strings can be stored in a resource type called a string table. An application can have only one string table.

In a string table, strings are grouped into segments, or blocks, of 16 strings each. The segment a string belongs to is determined by the value of its identifier; for example, strings with identifiers of 0 to 15 are in one segment, strings with values of 16 to 31 are in a second segment, and so on. Thus, to move a string from one segment to another you need to change its identifier.

Individual string segments are loaded on demand in order to conserve memory. For this reason, programmers usually try to group strings into logical groupings of sixteen or less and then use each group or segment only when it's needed.


String Table Editor Shortcuts

Keyboard Shortcuts

To:	Press:
Find text	ALT+F3, CTRL+F
Find next occurrence of text	F3
Add new string	INS
Delete current string	DEL


Opening a New or Existing String Table

You use App Studio to create your application's string table, or use the string table editor to edit an existing one.

  To create a new string table:

On the App Studio toolbar, click the string table button [image].

− Or −

In the resource browser window, click New, or from the Resource menu, choose New (CTRL+R). Then select String from the list of choices and click or press ENTER.

The string editor window appears.

Note  Windows will not allow you to create empty string tables. If you create a string table with no entries, it is deleted automatically when you save the file.

Once you create your application's string table, you can use the App Studio resource browser window to view a list of string segments in the string table and to jump to the beginning of a selected segment.

  To open an existing string table for editing:

1.	In the resource browser window, use the Type box to select the String Table resource type.

- Or -

Use the string table button [image] to open an existing string table.

A list of the string segments in your application's string table appears.

2.	In the Resources box, select the string segment you want to edit.

Selecting a specific segment of the string table allows you to easily jump to a specific group of strings. However, opening the string editor gives you access to the entire string table.

3.	Choose Open.

- Or -

Select the resource and press ENTER.

- Or -

Double-click the resource.

- Or -

From the Resource menu, choose Open.

The string editor window appears.


Finding a String Table Entry

The string table editor includes a Find command to let you quickly locate strings in the string table by either their caption or resource identifier.

  To find a string in the string table:

1.	Open the string table by selecting it in the Type box of the resource browser window and then clicking any of the segments listed in the Resources box.

2.	At the bottom of the string editor window, choose Find.

The Find String dialog box appears.

3.	In the Find What box, type the caption text or resource identifier of the string you want to find. Turn the Match Case option on or off as appropriate.

4.	Press ENTER.

If a string or its identifier in the string table matches what you typed, it is selected.


Adding, Deleting, and Moving a String

  To add a string table entry:

1.	Select the new-item box (an empty rectangle) at the end of a string segment.

2.	Type the new string.

Focus shifts to the Properties window as you start typing, and the string is given the next identifier in sequence.

− Or −

1.	Select an existing entry in the string table.

2.	Choose the New command at the bottom of the string editor window, or from the Resource menu, choose New String (INS).

A new string is created and given the next available identifier after the currently selected string.

3.	Type the new string.

Note  Null strings are not allowed in Windows string tables. If you create an entry in the string table that is a null string, the entry is deleted when you close the string editor.

  To delete a string in the string editor:

1.	Select the string you want to delete.

2.	Choose Delete at the bottom of the string editor window, or from the Edit menu, choose Delete (DEL).

  To move a string from one segment to another:

1.	Select the string you want to move.

2.	Move to the General property page. In the ID box, change the string's value so that it falls in the range you want.

For example, to move a string with a name of IDS_MYSTRING and a value of 100 to a segment in the 200 range, type the following in the ID box:

IDS_MYSTRING=201

3.	Press ENTER to record the change.

  To move a string from one resource script (.RC) file to another:

1.	Open the string editor windows in both resource script files.

2.	Use the drag and drop method.

− Or −

Use the File menu's Cut and Paste commands.

Note  If the moved string's symbol name or value conflicts with an existing identifier in the destination file, the symbol name is changed (if a symbol by that name already exists) or the symbol value is changed (if a symbol with that value already exists).


Editing a String's Properties

  To change a string or its identifier:

1.	Select the string you want to edit.

2.	Move to the string's General property page.

3.	In the Caption box, modify the string itself.

In the ID box, modify the string's identifier:

Type in a new symbol name or choose one from the list.

Change a string's value by typing the symbol name followed by an equal sign and the new value; for example

IDS_ERROR_MSG=2350

For more information on editing symbols, see Symbol Browser Topics.

  To add formatting or special characters to a string:

Use the standard escape sequences shown below:

To Get This:	Type This:
New line	\n (or press CTRL+ENTER when typing in the string)
Carriage return	\r
Tab	\t (or press CTRL+TAB when typing the string)
Backslash (\)	\\
ASCII character	\ddd (octal notation)
Alert (bell)	\a


Symbol Browser Topics

How Do I?	Brief	Click
Change a symbol name or value	Editing a symbol or symbol name; changing a symbol's numerical value
Manage symbols with the symbol browser	Creating new symbols; changing unassigned symbols; using the View Use command
Learn about symbol name and value restrictions	Name and value limitations when creating symbols


 Changing a Symbol Name or Value

 Changing a Symbol or Symbol Name

 Changing a Symbol's Numerical Value


change a symbol name or value
 Changing a Symbol Name or Value

A symbol is an identifier that consists of a text string (name) mapped to an integer value. Symbols provide a descriptive way of referring to resources and user-interface objects in your source code, and also while you're working with them in App Studio.

When you create a new resource or resource object, App Studio provides a default name for the resource (for example, IDC_RADIO1) and assigns a value to it. The name-plus-value definition is stored in RESOURCE.H, a file generated by App Studio.

In working with symbols from within App Studio, you can

Change the symbol associated with a resource or object.

Change a symbol's name or value in the Symbol Browser (if the symbol hasn't been used yet) or in the Properties window (if the symbol is already in use by a single object).

Use the Symbol Browser to browse existing symbols, add new symbols, and change or delete unused symbols.

Note  When you are copying resources or resource objects from one .RC file to another, App Studio may change the transferred resource's symbol value, or symbol name and value, to avoid conflicts with symbol names or values in the existing file.


 Changing a Symbol or Symbol Name

When you create a new resource or resource object, App Studio assigns it a default name [image] for example, IDD_DIALOG1. Use the Properties window to change the default symbol name or to change the name of any symbol already associated with a resource.

  To change a resource's symbol name:

1.	Open the Symbol Browser, select the symbol you want to change, and when the Change Symbol dialog box appears, choose View Use.

− Or −

Select the resource and move to the appropriate property page (usually the General property page), or type CTRL+Q to move directly to the property page ID box.

This moves you to the property page of the resource where the symbol is used.

2.	In the ID box, type a new symbol name or select from the list of existing symbols.

3.	Press ENTER to accept the change.

If you typed a new symbol name, App Studio assigns it a value automatically.


 Changing a Symbol's Numerical Value

Usually you can let App Studio assign the numerical value associated with the symbol names you define. However, there may be times when you need to change the symbol value associated with a resource or value [image] if, for example, you want a group of controls or a series of related strings in the string table to have sequential IDs.

For symbols already associated with a single resource, use the Properties window to change the symbol value. For symbols associated with more than one resource or object, make the changes directly in RESOURCE.H using a text editor.

  To change a symbol value using the Properties window (applies only to symbols assigned to a single resource or object):

1.	Open the Symbol Browser, select the symbol you want to change, and when the Change Symbol dialog box appears, choose View Use.

- Or -

Select the resource and move to the appropriate property page (usually the General property page), or type CTRL+Q to move directly to the property page ID box.

This moves you to the property page of the resource where the symbol is used.

2.	In the ID box, type the symbol name followed by an equals sign and an integer. For example,

IDC_EDITNAME=5100

3.	Press ENTER to accept the change.

The new value is stored in the symbol header file the next time you save. Only the symbol name remains in the ID box; the equals sign and value are not displayed after they are validated.

  To change the numeric value of a symbol assigned to more than one resource or object:

1.	End your App Studio editing session by closing the current resource file or exiting App Studio.

2.	Load RESOURCE.H into Visual Workbench and make the necessary changes.

3. Save RESOURCE.H.

The next time you open the project's .RC file in App Studio, App Studio uses the new symbol values.

Note  While editing RESOURCE.H take special care not to define duplicate symbols. App Studio can only detect duplicate symbols if they are created from within App Studio.


 Managing Symbols with the Symbol Browser

 Creating New Symbols

 Changing Unassigned Symbols

 Opening the Resource Editor for a Given Symbol


 Managing Symbols with the Symbol Browser

As your application grows in size and sophistication, so do the number of resources and symbols that must be created. Large numbers of symbols scattered throughout several files can be difficult to keep track of. The Symbol Browser simplifies symbol management by offering a central tool through which you can:

Quickly browse existing symbol definitions to see the value of each symbol, which symbols are being used, and the resources assigned to each.

Create new symbols.

Change the name and value of a symbol that is not in use.

Delete a symbol if it is not being used.

Move quickly to the appropriate App Studio resource editor where the symbol is being used with the View Use command.

   To access the Symbol Browser dialog box:

From the Edit menu, choose Symbols.

Toolbar shortcut: .

Shortcut: CTRL+I.


 Creating New Symbols

When you are beginning a new project, you may find it convenient to map out the symbol names you need before creating the resources they will be assigned to.

  To create a new symbol using the Symbol Browser:

1.	In the Symbol Browser dialog box, choose New.

The New Symbol dialog box appears.

2.	In the Name box, type a symbol name.

3.	Accept the symbol value assigned by App Studio, or, in the Value box, type a new value.

4.	Choose OK or press ENTER to place the new symbol into the symbol list. The symbol appears in alphabetical order.

If you enter a symbol name that already exists, a message box appears stating that a symbol with that name is already defined. You cannot define two or more symbols with the same name, but you can define different symbols with the same numeric value.

For additional information on symbol names and values, see Symbol Name Restrictions and Symbol Value Restrictions.


 Changing Unassigned Symbols

While in the Symbol Browser you can edit or delete existing symbols that are not already assigned to a resource or object. You can change existing symbols that are in use in only one place by using the Change command to move to the appropriate resource's property page or by moving to the property page directly. A check mark in the In Use column of the SymbolBrowser indicates that the symbol is being used.

If Show Read-Only Symbols is selected, read-only symbols are also displayed. Editable symbols are displayed as bold text and read-only symbols are displayed as normal text. You cannot change read-only symbols.

   To change an unassigned symbol using the Symbol Browser:

1.	Select the unassigned symbol you want and choose Change.

The Change Symbol dialog box appears.

2.	Edit the symbol's name or value in the boxes provided, then press ENTER to accept the change.

   To delete an unassigned symbol using the Symbol Browser:

Select the unassigned symbol that you want to delete and choose Delete or press the DEL key.

Note  Before deleting an unused symbol in a resource file, make sure it is not used elsewhere in the program or by resource files included at compile time.


 Opening the Resource Editor for a Given Symbol

When you are browsing symbols in the Symbol Editor you may want more information on how a particular symbol is used. The View Use command provides a quick way to get this information.

   To move to the resource editor where a symbol is being used:

1.	Select the symbol you want in the Name box of the Symbol Browser.

2.	Select the resource that interests you in the Used by box.

3.	Choose View Use.

The editor for the resource you selected appears.


 Symbol Name Restrictions

 Symbol Value Restrictions


 Symbol Name Restrictions

There are several restrictions you should be aware of when using symbol names and values.

All symbol names must be unique within the scope of the application. This prevents conflicting symbol definitions in the header files. Legal characters for a symbol name include A-Z, a-z, 0-9, and the underscore ( _ ). Symbol names cannot begin with a number, are case insensitive, and are limited to 247 characters.

Symbol names can be used more than once in your application. For example, if you are writing a data entry program with several dialogs containing an edit box for a person's Social Security number, you may want to give all the related edit boxes a symbol name of IDC_SSN. To do this, you can define a single symbol and use it as many times as needed.

While it is not required, symbol names are often given descriptive prefixes which indicate the kind of resource or object they represent. The Microsoft Foundation Class Library uses the following symbol naming conventions:

Category	Prefix	Use
Resources	IDR_ IDD_ IDC_ IDI_ IDB_	Accelerator or Menu resource Dialog Cursor Icon Bitmap
Menu Items and Commands	IDM_ ID_	Menu item Command
Controls and Child Windows	IDC_	Control
Strings	IDS_	String in the string table


 Symbol Value Restrictions

In App Studio a symbol value can be any integer expressed in the normal manner for #define preprocessor directives. Here are some examples of symbol values:

18

4001

0x0012

-3456

Symbol values for resources can be in the range from 0 to 32767. Symbol values for resource objects (such as dialog box controls or individual strings in the string table) can be from 0 to 65534 or from -32768 to 32767.

In App Studio you cannot define symbol values using other symbol strings. For example, the following symbol definition is not supported:

#define IDC_MYEDIT  IDC_OTHEREDIT  //not supported

You also cannot use preprocessor macros with arguments as value definitions. For example,

#define   IDD_ABOUT  ID(7) //not supported

is not a valid expression in App Studio regardless of what ID evaluates to at compile time.

If you have an existing file containing symbols defined with expressions, see Using Read-Only or Calculated Symbols for instructions on how to include the symbols as read-only symbols.


Menu Editor Topics

How Do I?	Brief	Click
Learn to work with menus and menu items	Using the menu editor; shortcut keys for the menu editor
Create and edit menu resources	Creating a new menu resource; editing an existing menu resource
Create menus or menu items	Creating drop-down or cascading menus; adding a menu item
Select menus or menu items	Selecting in the menu editor
Move and copy menus or menu items	Moving or copying menu items
View the menu resource as a drop-down menu	Using the Resource menu View as Popup command
Associate a menu item with an accelerator key	Linking accelerator keys and menu items; adding the name of the key to the menu item caption


Working with Menus and Menu Items

You can create and edit menus in App Studio by working directly with a menu bar that closely resembles the one in your finished application.

In addition, you can use the Visual C++ for Windows NT ClassWizard to hook menu items up to code. For more information, see ClassWizard Topics.

Shortcut keys

To:	Press:
View menu as pop-up	CTRL+U
Insert empty menu at current location	INS
Delete menu item	DEL


Creating and Editing Menu Resources

   To create a new menu resource:

In the resource browser window, click New, or from the Resource menu, choose New (CTRL+R). Then select Menu from the list of choices and click OK or press ENTER.

Toolbar shortcut: .

The menu editor window appears.

   To edit an existing menu resource:

1.	Move to the resource browser window.

2.	In the Type box, select Menu.

A list of the menu resources in the current file appears in the Resources box.

3.	In the Resources box, select the menu resource you want to edit.

4.	Choose Open.

- Or -

Select the resource and press ENTER.

- Or -

Double-click the resource.

- Or -

From the Resource menu, choose Open.

The menu editor window appears.


Creating Menus or Menu Items

   To create a drop-down menu on the menu bar:

1.	Click the new-item box (an empty rectangle) on the menu bar to select it. You can also move to the new-item box with the TAB (move right) and SHIFT+TAB (move left) keys or the right and left arrow keys.

2.	Type the name of the menu. When you start typing, focus automatically shifts to the General property page, and the text you type appears both in the Caption box and in the menu-editor window.

You can define a mnemonic key that allows the user to select the drop-down menu by simultaneously pressing a single letter and the ALT key. You specify the letter that represents the mnemonic character by placing an ampersand (&) in front of it. Make sure all of the mnemonics on a menu are unique.

Once you have given the menu a name on the menu bar, the new-item box shifts to the right, and another new-item box opens below for adding menu items.

Note  To create a single-item menu on the menu bar, clear the Popup option on the General property page.

   To create a menu item:

1.	First create a drop-down menu according to the steps outlined in the previous procedure.

2.	Select the menu's new-item box.

− Or −

Select an existing menu item and press INS. The new-item box is inserted before the selected item.

3.	Type the name of the menu item. When you start typing, focus automatically shifts to the General property page, and the text you type appears in the Caption box.

You can define a mnemonic key that allows the user to select the drop-down menu by simultaneously pressing a single letter and the ALT key. You specify the letter that represents the mnemonic character by placing an ampersand (&) in front of it.

4.	In the ID box, type in the menu item ID, or select an existing command identifier. If you do not enter an ID, App Studio will enter it for you.

5.	On the General property page, select the menu item styles that apply.

For information on what each menu item style means, click the Help button on the property page.

6.	In the General property page's Prompt box, type the prompt string you want to appear in your application's status bar. This feature is only available with Microsoft Foundation Class Library resource script (.RC) files.

This creates an entry in the string table with the same resource identifier as the menu item you created.

7.	Press ENTER to complete the menu item. The new-item box is re-selected so you can easily create additional menu items.

   To create a cascading (hierarchical) menu:

1.	Select the new-item box on the drop-down menu where you want the cascading menu to appear. Then type the name of the menu item that, when selected, causes the cascading menu to appear.

− Or −

Select an existing menu item that you want to be the parent item of the cascading menu.

2.	On the General property page, select the Popup check box. The menu item is marked with the cascading menu symbol [image], and a new-item box appears to the right.

3.	Add additional menu items to the cascading menu according to the instructions in the previous procedure.


Selecting Menus or Menu Items

  To select a drop-down or cascading menu and display its menu items:

Click the menu caption on the menu bar or the parent item of the cascading menu. Then click the menu item you want.

− Or −

Move to the menu caption with the TAB (move right) and SHIFT+TAB (move left) keys or the right and left arrow keys.

   To select one or more menu items:

1.	Click the drop-down or cascading menu you want.

Its menu items are displayed.

2.	Click to select a menu item, or hold down the SHIFT key to select multiple menu items. Holding down the SHIFT key and clicking an already-selected menu item deselects it.

− Or −

With the mouse pointer outside the menu, hold down the left mouse button and draw a selection box around the menu items you want to select.


Moving and Copying Menus or Menu Items

The simplest way to edit a menu resource is to use the drag and drop method. You can also use the Cut, Copy, and Paste commands on the App Studio Edit menu.

   To move or copy drop-down menus or menu items using drag and drop:

1.	Drag (or to copy, hold down the CTRL key and drag) the item you want to:

A new location in the current menu.

A different menu. (You can navigate into other menus by dragging the mouse cursor over them.)

2.	Drop the menu item when the insertion guides show the position you want.

   To move or copy menus or menu items using the App Studio Edit menu:

1.	Select one or more menus or menu items.

2.	From the Edit menu, choose Cut (to move) or Copy (to copy) the objects. You can also use the keyboard shortcuts for Cut (CTRL+X or SHIFT+DEL) and Copy (CTRL+C or SHIFT+INS).

3.	If you are moving the items to another menu resource or resource script file, make that menu editor window active.

4.	Select the menu or menu item you want. The moved or copied item is placed before the item you select.

5.	From the Edit menu, choose Paste.


Viewing the Menu Resource as a Drop-down Menu

Normally, when you are working in the menu editor, a menu resource is displayed as a menu bar with top-level menu items and drop-down menus. However, you may want to store a single menu as a separate menu resource so you can add it as a drop-down menu to your application's main menu bar while the program is running. To see what the separate menu resource looks like as a drop-down menu, use the menu editor's View as Popup command.

  To view a menu resource as a drop-down menu:

From the Resource menu, choose View as Popup.

Shortcut: CTRL+U.

To change back to the menu-bar view, choose View as Popup again.


Associating a Menu Item with an Accelerator Key

Many times you want a menu item and a keyboard combination to issue the same program command. You do this by assigning the same resource identifier to the menu item and to an entry in your application's accelerator table. You then edit the menu item's caption to show the name of the accelerator key.

   To associate a menu item with an accelerator key:

1.	In the menu editor, select the menu item you want and move to the General property page.

2.	In the ID box, give the menu item a descriptive command identifier (for example, ID_FILE_OPEN).

3.	In the Caption box, add the name of the accelerator key to the menu caption:

Following the menu caption, type the escape sequence for the tab key (\t), so that all of the menu's accelerator keys are left-aligned.

Type the name of the modifier key (CTRL, ALT, or SHIFT) followed by a plus sign and the name, letter, or symbol of the additional key.

For example, if you assign CTRL+O to the File menu's Open command, you modify the menu's caption so that it looks like this:

Open\tCtrl+O

The menu item in the menu editor is updated to reflect the new caption as you type it.

4.	Create the accelerator table entry and assign it the same identifier as the menu item. Use a key combination that you think will be easy to remember.

For more information on creating and naming accelerator resources, see the Accelerator Editor.


Dialog Editor Topics

How Do I?	Brief	Click
Create and edit dialog boxes	Creating a new dialog box template; opening an existing dialog box for editing
See a list of shortcut keys	Toolbar, palette and keyboard shortcuts for the dialog editor
Add controls to a dialog box	Showing the control palette; alternative methods for adding controls
Place and size controls	Selecting, moving, copying, or deleting controls; sizing individual controls
Arrange controls	Using Snap to Grid; aligning, spacing, and resizing controls;grouping controls
Change the tab order	Setting and changing the dialog-box tab order
Define dialog box keyboard access	Defining mnemonic keys for dialog-box controls
Change the dominant control	Using CTRL-click to change the dominant control
Use custom controls	Using user-defined controls
Create a form view	Creating a dialog-box template for use with the CFormView or CDialogBar classes
Test a dialog box	Using the dialog editor's test mode to test a dialog box


 Dialog Editor Keyboard Shortcuts

 Control Palette

 Dialog Editor Toolbar


 Control Palette

Tool	Button
Pointer
Pushbutton
Check Box
Edit Control
Combo Box
List Box
Group Box
Radio Button
Static Text
Static graphic
Horizontal Scroll
Vertical Scroll
User-Defined Control


 Dialog Editor Keyboard Shortcuts

To:	Press:
Move to the next control	TAB
Move to the previous control	SHIFT+TAB
Move control right one DLU	RIGHT ARROW
Move control left one DLU	LEFT ARROW
Move control up one DLU	UP ARROW
Move control down DLU	DOWN ARROW
Expand the selected control horizontally	SHIFT+RIGHT ARROW
Contract the selected control horizontally	SHIFT+LEFT ARROW
Expand the selected control vertically	SHIFT+DOWN ARROW
Contract the selected control vertically	SHIFT+UP ARROW
Align selected controls along left edge	CTRL+LEFT ARROW
Align selected controls along right edge	CTRL+RIGHT ARROW
Align selected controls along top edge	CTRL+UP ARROW
Align selected controls along bottom edge	CTRL+DOWN ARROW
Align selected controls horizontally on centerlines	F9
Align selected controls vertically on centerlines	SHIFT+F9
Center selected control vertically in dialog box	CTRL+F9
Center selected control horizontally in dialog box	CTRL+SHIFT+F9
Space selected controls evenly across	ALT+RIGHT ARROW
Space selected controls evenly down	ALT+DOWN ARROW
Align buttons at right edge of dialog box	CTRL+B
Align buttons at bottom of dialog box	CTRL+SHIFT+B
Make selected controls same width	CTRL+MINUS
Make selected controls same height	CTRL+BACKSLASH
Make selected controls same height and width	CTRL+EQUAL
Size control to content	F7
Show or hide alignment grid	CTRL+G
Set tab order	CTRL+D


dialog editor toolbar (App Studio)
 Dialog Editor Toolbar

Tool	Toolbar button	Description	Shortcut key
Test		Tests controls.	CTRL+T
Align left		Aligns the selected controls along their left side.	CTRL+LEFT ARROW
Align right		Aligns the selected controls along their right side.	CTRL+RIGHT ARROW
Align top		Aligns the selected controls along their top edges.	CTRL+UP ARROW
Align bottom		Aligns the selected controls along their bottom edges.	CTRL+TOP ARROW
Center vertical		Centers controls vertically in the dialog.	CTRL+F9
Center horizontal		Centers controls horizontally in the dialog.	CTRL+SHIFT+F9
Space evenly across		Spaces controls evenly between the leftmost and the rightmost control selected.	ALT+LEFT ARROW or ALT+RIGHT ARROW
Space evenly down		Spaces controls evenly between the topmost and the bottommost control selected.	ALT+UP ARROW or ALT+DOWN ARROW
Make same width		Sizes controls to be the same width.	CTRL+-
Make same height		Sizes controls to be the same height.	CTRL+\
Make same size		Sizes controls to be the same size.	CTRL+=
Snap to grid		Turns grid on and off.	CTRL+G


  Creating a New Dialog-Box Template

  Editing an Existing Dialog Box


creating a new dialog box template
 Creating a New Dialog-Box Template

  To create a new dialog-box template:

In the resource browser window, click New, or from the Resources menu, choose New (CTRL+R). Then select Dialog from the list of choices.

Toolbar shortcut: .

The dialog box editor appears. Press ENTER to move to the property page and type a name for the new dialog box. You can use the Properties window at any time to change the dialog box's properties.

When the dialog box is created, AppStudio assigns it a unique symbol name and value. If you need to change the symbol value you can use the ID box on the General property page. Type the symbol name followed by an equals sign and a new value. For example,

IDD_DIALOG1=1001

Now you can place controls in the dialog.


 Editing an Existing Dialog Box

  To edit an existing dialog box:

1.	Move to the resource browser window.

2.	In the Type box, select Dialog.

A list of the dialog resources in the current file appears in the Resources box.

3.	In the Resources box, select the name or identifier of the dialog box you want to edit.

4.	Choose Open.

Or select the resource and press ENTER.

Or double-click the resource.

Or from the Resource menu, choose Open.

The dialog-box editor window appears.


  Showing or Hiding the Control Palette

  Adding Controls to a Dialog Box


 Showing or Hiding the Control Palette

You add controls to a dialog box by selecting the control you want from the control palette. When displayed, the palette stays positioned above other open windows on your desktop.

  To show or hide the control palette:

Press F2 to display or hide the control palette.

− Or −

From the Window menu, choose Show Control Palette or Hide Control Palette.


 Adding Controls to a Dialog Box

  To add a control to a dialog box using drag and drop:

1.	Drag a control from the control palette to the dialog window.

As you drag the control into the dialog box, a dotted outline of the control indicates its position.

2.	When the dotted outline of the control is in the position you want, release the left mouse button.

The control is given a standard size appropriate to that type of control.

  To add controls to a dialog box using point and click:

1.	On the control palette, click the button for the control you want.

Or, to add multiple controls of the same type, hold down the CTRL key and click the control you want.

2.	Move the mouse pointer to the dialog box and click at the position(s) you want.

The control is given a standard size appropriate to that type of control.

3.	Press ESC when you are finished placing controls if you created multiple controls by using the CTRL-click method.

 To add controls to a dialog box by "drawing" with the pointing device:

1.	On the control palette, click the control you want.

2.	Place the pointer where you want the upper-left corner of the control to be located.

3.	Hold down the left mouse button.

4.	Move the mouse pointer to the right and down; a dotted outline of the control appears.

5.	When the control is the size you want, release the mouse button.

6.	Press ESC when you are finished placing controls if you created multiple controls by using the CTRL-click method.

After you have added a control to the dialog box, you can change its caption or any other of its properties in the Properties window.


  Selecting Controls

  Moving Controls

  Deleting and Copying Controls

  Sizing Individual Controls


 Selecting Controls

When you are sizing or aligning multiple controls, App Studio uses the "dominant control" to determine how the other controls are sized or aligned. When multiple controls are selected, the dominant control has solid sizing handles; all the other selected controls have hollow sizing handles. You can set the dominant control by holding down the CTRL key while clicking with the mouse.

  To select a control:

Point to the control you want and click. The selected object (control or dialog box) is deselected.

− Or −

Use TAB to move forward or SHIFT+TAB to move backward through the controls in the dialog box.

 To select more than one control:

1.	From the control palette, make sure the pointer tool is selected.

2.	Hold down the left mouse button and drag to draw a selection box around the controls you want to select. Controls partially outside the selection box are not selected.

When you release the mouse button, all controls inside the selection box are selected.

Tip  You can select multiple controls by clicking them individually while holding down the SHIFT key. In addition, clicking a selected control with the SHIFT key held down deselects it.

Once you have selected one or more controls, you can remove or add individual controls without disturbing the selection as a whole.

  To remove from or add to an existing selection:

Hold down the SHIFT key and click the control you want to remove from or add to the existing selection.


 Moving Controls

You can use the following procedures to move one or more controls from one location to another in a dialog box or from one dialog box to another. If Snap to Grid is on, the control snaps to the alignment grid. For information on other ways to align multiple controls, see Aligning Controls.

  To move a control from one location to another in a dialog box:

Drag the control to its new location.

− Or −

Select the control and use the arrow keys to move the control one DLU at a time.

  To move a control from one dialog box to another:

If both dialog boxes are visible, drag the control to its new location. (Hold down the CTRL key while dragging if you just want to copy the control.)

− Or −

Use the File menu's Cut and Paste commands. The control is placed in the same position as in the original dialog box.

Note  In rare cases you may need to place a control outside of a dialog box. To do this, hold down the ALT key while dragging the control.


 Deleting and Copying Controls

 To delete a control:

1.	Select the control.

2.	From the Edit Menu, choose Cut or Delete.

Shortcut: CTRL+X (Cut); DEL (Delete).

  To copy a control:

Drag the control while holding down the CTRL key.

-Or-

Use the Edit menu's Copy and Paste commands.

Shortcut: CTRL+C (Copy); CTRL+V (Paste).

When you paste a control into a new dialog, it is placed in the same position as it was in the old dialog


 Sizing Individual Controls

Use the sizing handles to resize a control. When the mouse cursor is positioned on a sizing handle, it changes shape to indicate the direction in which the control will be resized. Active sizing handles are solid; if a sizing handle is hollow, the control cannot be resized along that axis. For information on sizing multiple controls, see Resizing Controls.

When you change the size of a control, its final shape may be affected by whether you have Snap to Grid turned on.

  To resize a control:

1.	Click the control or select it with the TAB key.

2.	Use the sizing handles to change the size of the control:

Sizing handles at the top and sides change the horizontal or vertical size.

Sizing handles at the corners change both horizontal and vertical size.

-Or-

Use the SHIFT key plus the arrow keys to resize the control one DLU at a time.

  To resize a control to fit its caption:

1.	Select the control.

2.	From the Layout menu, choose Size to Content.

Shortcut: F7.

  To set the size of the combo box drop-down area:

When you select a drop-down or drop-list combo box for sizing, only the right and left sizing handles are active. Use these handles to set the width of the combo box as it is initially displayed. You can also set the vertical size of the drop-down portion of the combo box.

1.	Click the drop-down arrow at the right of the combo box.

The outline of the control changes to show the size of the combo box with the drop-down area extended.

2.	Use the bottom sizing handle to change the initial size of the drop-down area.

3.	Click the drop-down arrow again to close the drop-down portion of the combo box.


Changing Tab Order

Tab order is the order in which the tab key moves the input focus from one control to the next within a dialog box. To make a control part of the tab order, select the Tabstop option (normally already selected) on the control's General property page.

Even controls that do not have the Tabstop property set need to be part of the tab order. Defining mnemonics for controls without a caption is an example of why this can be important. Static text that contains a mnemonic for a related control must immediately precede the related control in the tab order.

Note  If your dialog box contains overlapping controls, changing the tab order may change the way the controls are displayed. Controls which come first in the tab order are always displayed on top of any overlapping controls that follow them in the tab order.

  To change the tab order for all controls in a dialog box:

1.	From the Layout menu, choose Set Tab Order .

Shortcut: CTRL+D.

A number at the upper left of each control shows the current tab order.

2.	Set the tab order by clicking each control in the same order you want the TAB key to follow.

3.	Press ENTER to exit Set Tab Order mode.

To change the existing tab order, you usually need to change the selected control first, as explained in the following procedure. The selected control determines the number of the control you click next. For example, if you are in Set Tab Order mode and control number 1 is selected, the next control you click is set to number 2.

  To change the existing tab order:

1.	From the Layout menu, choose Set Tab Order.

Shortcut: CTRL+D.

2.	Change the selected control. To do this, hold down the CTRL key and click the control prior to the one where you want the changed order to begin.

For example, if you want to change the order of controls 7 through 9, select control 6 first.

Note  To set a specific control to number 1 (first in the tab order), double-click the control.

3.	Reset the tab order by clicking in the order you want the tab key to follow.

4.	Press ENTER to exit Set Tab Order mode.


Defining Dialog-Box Keyboard Access

Normally keyboard users move the input focus from one control to another in a dialog box with the TAB and arrow keys. However, you can define a mnemonic key that allows users to choose the control by pressing a single key.

  To define a mnemonic key for a control with its own visible caption (pushbuttons, check boxes, and radio buttons):

1.	Select the control and move to the General property page.

2.	In the Caption box, type an ampersand (&) in front of the letter you want as the mnemonic for that control.

An underline appears in the displayed caption to indicate the mnemonic key.

  To define a mnemonic for a control without a visible caption:

1.	Make a caption for the control by using a static text control. In the static text caption, type an ampersand (&) in front of the letter you want as the mnemonic.

2.	Make sure the static text control immediately precedes the control it labels in the tab order.


Changing the Dominant Control

When you are resizing or aligning multiple controls, App Studio uses the dominant control to determine how the other controls are sized or aligned. When multiple controls are selected, the dominant control has solid sizing handles; all the other selected controls have hollow sizing handles.

  To change the dominant control when more than one control is selected:

Hold down the CTRL key and click the control you want to influence the size or location of the others.

The sizing handles change from hollow to solid. All further resizing or alignment is based on this control.


  Using Snap to Grid

  Aligning Controls

  Making Spacing Even

  Resizing Controls

  Grouping Controls


arranging controls
 Using Snap to Grid

When you are placing or arranging controls in a dialog box, you can use the alignment grid for more precise positioning. When the grid is turned on, controls appear to "snap to" the dotted lines of the grid as if magnetized. You can turn this "snap to grid" feature on and off, and change the size of the grid cells.

  To turn Snap to Grid on and off for the currently active dialog editor window:

On the App Studio toolbar, click Snap to Grid [image].

Shortcut: CTRL+G.

  To turn Snap to Grid on or off for all dialog editor windows:

1.	On the Layout menu, choose Grid Settings. The Grid Settings dialog box appears.

2.	Turn the Snap to Grid check box on or off.

You can still control Snap to Grid in individual dialog editor windows using the Snap to Grid button on the dialog editor toolbar.

  To change the size of the layout grid:

1.	On the Layout menu, choose Grid Settings. The Grid Settings dialog box appears.

2.	Enter the height and width in DLUs for the cells in the grid. The minimum height or width is 4 DLUs.


 Aligning Controls

App Studio provides layout tools you can use to align and size controls automatically. For most tasks, you can use the dialog editor toolbar. All commands are also available on the Layout menu and most have keyboard equivalents. Many layout commands are available only when more than one control is selected (see Selecting Controls).

  To align controls:

1.	Select the controls you want to align.

2.	Make sure the correct dominant control is selected. The final position of the group of controls depends on the position of the dominant control.

3.	Choose one of the following tools on the toolbar:

Align Left		Aligns the selected controls along their left side.	CTRL+LEFT ARROW
Align Right		Aligns the selected controls along their right side.	CTRL+RIGHT ARROW
Align Top		Aligns the selected controls along their top edges.	CTRL+UP ARROW
Align Bottom		Aligns the selected controls along their bottom edges.	CTRL+DOWN ARROW
  To align controls on their center, vertically or horizontally:

1.	Select the controls you want to center.

2.	Make sure the correct dominant control is selected. The final position of the group of controls depends on the position of the dominant control.

3.	From the Layout menu, choose Align Vert. Center or Align Horiz. Center.

Shortcut: F9 (Align Vert. Center); SHIFT+F9 (Align Horiz. Center)


 Making Spacing Even

  To even the spacing between controls:

1.	Select the controls you want to rearrange.

2.	Choose one of the following tools on the toolbar:

Space Evenly Across		Controls are spaced evenly between the leftmost and the rightmost control selected.	ALT+LEFT ARROW or ALT+RIGHT ARROW
Space Evenly Down		Controls are spaced evenly between the topmost and the bottommost control selected.	ALT+UP ARROW or ALT+DOWN ARROW
  To center controls in the dialog box:

1.	Select the control or controls you want to rearrange.

2.	Choose one of the following tools on the toolbar:

Center Vertical		Controls are centered vertically in the dialog.	CTRL+F9
Center Horizontal		Controls are centered horizontally in the dialog.	CTRL+SHIFT+F9
  To arrange pushbuttons along the right or bottom of the dialog box:

1.	Select one or more pushbuttons.

2.	From the Layout menu, choose Arrange Buttons, then choose Right or Bottom.

The selected buttons are positioned in a standard arrangement along the bottom or right of the dialog box. If controls other than pushbuttons are selected, their position is not affected.


 Resizing Controls

  To make controls the same size, height, or width:

1.	Select the controls you want to resize.

2.	Choose one of the following tools on the toolbar:

Make Same Width		CTRL+ -
Make Same Height		CTRL+\
Make Same Size		CTRL+=
  To size a control based on its content:

1.	Select the control.

2.	From the Layout menu, choose Size to Content.

The control is sized to the height and width of its caption text.


 Grouping Controls

Use the group box control to visually link a group of radio buttons or related check boxes. Once a number of controls are grouped, you can set the Group property for the first control and clear it for the remaining controls so the user can move among the grouped controls with the arrow keys.

  To create a group of radio buttons or check boxes:

1.	Click the group box control [image] on the control palette and draw the group box to the approximate size you want.

2.	Type an appropriate caption, or leave the Caption box on the property page blank if you want no caption to appear.

3.	Place the radio buttons or check boxes and adjust the size of the group box as necessary.

4.	Set the tab order for the dialog box. The controls in the group should follow each other sequentially in the tab order.

5.	On the General property page for the first control in the group, set the Group property. For radio buttons, also set the Tabstop property for the first control in the group.

6.	Make sure the rest of the controls in the group do not have the Group property set.

7.	Move to the control that, based on the tab order, immediately follows the last control in the group. Set the Group property for this control.


using custom controls
Working with User-Defined Controls

  To edit user-defined control properties:

1.	Select the control and move to its General property page.

2.	Enter or modify the information as appropriate.

  To place user-defined controls:

When you are designing a dialog box that contains custom controls, the custom control displays as a gray square. In test mode the custom control also displays as a gray square, and its run-time behavior is not simulated. The user-defined control property page allows you to

Identify the name of the control's Windows class.

Type in a 32-bit hexadecimal value that sets the control's style.

Note  User-defined controls include controls created in the format described in the documentation for the Windows Software Development Kit.


Creating a Form View

You can use App Studio to create a dialog-box template that is used as a "form view," a CView-compatible window that contains dialog-box controls. An example of an application that might need a form view is one in which the primary program function is data entry. In this case, the program's main view contains nothing but dialog-box controls for entering data.

To construct a form view, you create a dialog box as you normally would but set several style properties differently (see the following procedure). You then incorporate the form view into your program using the Microsoft Foundation Class Library CFormView class. You can use the same procedure to create a template for use with the CDialogBar class. For more information, see the Class Library Reference.

  To create a dialog-box template for use with the CFormView or CDialogBar class:

1.	Use the dialog editor in the usual way to create a dialog-box template with the controls arranged as you want them to appear in the form view.

2.	Move to the Styles property page and set the following properties:

In the Style box, select Child from the list of choices.

In the Border box, select None from the list of choices.

Clear the Visible property.

3.	On the General property page, clear the dialog-box template's caption.

4.	Incorporate the template into your program using the CFormView class.


Testing a Dialog Box

You can simulate the run-time behavior of a dialog box from within App Studio without compiling your program. This gives you immediate feedback on how the layout of controls appears and performs, and speeds up the user-interface design process.

When you are in test mode you can:

Type in text, select from combo-box lists, turn options on and off, and choose commands.

Test the tab order.

Test the grouping of controls such as radio buttons or check boxes.

Test the dialog's keyboard interface (the mnemonic keys for controls that have them defined).

Note  Connections to dialog-box code made using ClassWizard are not simulated during dialog-box test mode.

When you test a dialog box, it is usually displayed at a location relative to the main App Studio program window. If the dialog box's Absolute Align property is selected, the dialog box is displayed at a position relative to the upper-left corner of the screen.

  To test a dialog box:

1.	From the Resource menu, choose Test.

Toolbar shortcut: .

Shortcut: CTRL+T.

2.	To end the test session, take one of the following actions:

Press ESC.

Close the dialog box using its system menu.

Shortcut: ALT+F4.

Choose a pushbutton with a symbol name of IDOK or IDCANCEL.


Dialog Box Units of Measure

The location, height, and width of the current control is displayed in the lower-right corner of the App Studio status bar. When more than one control is selected, the position indicators show the position of the dominant control (the control with solid sizing handles). When the dialog box is selected, the status bar displays the position of the dialog box and the height and width of the dialog box.

The location and size of a dialog box, as well as the location and size of controls within it, are measured in dialog box units (DLUs). A DLU is based on the size of the dialog box font, normally 8-point MS Sans Serif. A horizontal DLU is the average width of the dialog box font divided by four. A vertical DLU is the average height of the font divided by eight.


Standard Control Types

The dialog editor lets you create dialog boxes that include the following standard control types:

pushbutton option button check box list box	combo box group box static graphic edit text	static text scroll bar user-defined control


Dominant Control

The dominant control is used by App Studio to determine how the other controls are sized or aligned when you are sizing or aligning multiple controls. When multiple controls are selected, the dominant control has solid sizing handles; all the other selected controls have hollow sizing handles. You can set the dominant control by holding down the CTRL key while clicking that control.


Graphics Editor Topics

How Do I?	Brief	Click
Learn about the graphics editor	Using the graphics editor
See a list of shortcut keys	Lists of toolbar and palette shortcuts for using the graphics editor
Create and edit graphics resources	Creating a new bitmap, cursor, or icon resource; opening an existing one
Edit graphical resource properties	Using the graphics editor property page
Draw and paint	Controlling the graphics palette; drawing, erasing, and filling; creating a custom brush
Resize and select	Selecting part of a bitmap; flipping a selection; resizing; using the Clipboard
Move and copy	Moving and copying; choosing an opaque or transparent background
Manage the graphics editor workspace	Using image-editor panes; zooming; using pixel grids
Edit icons and cursors	Editing icon and cursor images; using device descriptions; setting a hot spot
Edit toolbar graphics	Editing graphics for use with the CToolBar class
Work with colors	Selecting, picking up, or inverting colors; changing the number of colors
Manage colors and palettes	Creating, saving, and loading color palettes


Using the Graphics Editor

The App Studio graphics editor has a rich set of tools for drawing bitmaps, icons and cursors, as well as features to support the creation of toolbar bitmaps and the management of icon and cursor images.

With the graphics editor, you can

Create and edit bitmaps in 2 or 16 colors, in sizes up to 999 x 999 pixels.

Use a full complement of drawing tools.

Easily copy images from one bitmap to another.

Use custom brushes for special effects.

Draw cursors and icons with transparent and inverse-color regions.

Edit bitmaps for toolbar buttons.

Most editing procedures are the same for bitmaps, icons, and cursors. This chapter first shows the procedures common to all graphical resources. Later sections detail procedures and graphics-editor capabilities specific to icons, cursors, and toolbar-button images.

Note  Many of the graphics editor's functions require a mouse or other pointing device.

You edit bitmaps, icons, and cursors in App Studio's image-editor window, using the tools on the graphics palette. When an image-editor window is active, App Studio changes in these ways:

The graphics palette appears.

The properties window displays property pages specific to the graphical resource.

When the mouse pointer is over an image, the status bar displays the pointer's coordinates relative to the upper-left corner of the image.

The Delete item on the Edit menu changes to Clear.

When the image-editor window contains a cursor or an icon, three new commands [image] New Device Image, Open Device Image, and Delete Device Image [image] are added to the Resource menu, and the image-editor window has a control bar with controls for selecting and creating images and for setting the cursor's hot spot.

The Image menu is inserted between the Resource and Options menus.

The Hide/Show Graphics Palette command on the Window menu is enabled.

The Image-Editor Window

The image-editor window shows two views of an image. A splitter separates the two panes. You can drag the splitter from side to side to change the relative sizes of the panes. The active pane displays a selection border.

The Graphics Palette

The graphics palette has four parts, which are shown below:

The toolbox, which contains 15 tools for drawing, painting, erasing, and manipulating views.  The color indicator, which shows the foreground and background colors and (for icons and cursors) selectors for "screen" and "inverse" color. The color palette, which you click to select the foreground and background colors. The option selector, which you click to select brush widths and other drawing options.
To use the toolbox, color palette, and option selector, you click the desired tool, color, or option.

The Status Bar

The status bar, at the bottom of the App Studio frame window, displays two panes when an image-editor window is open. When the mouse cursor is over an image, the left pane shows the cursor's current position, in pixels, relative to the upper-left corner of the image. During a dragging operation, such as selecting, moving, and drawing a rectangle, the right pane shows the size, in pixels, of the affected area.

The Image Menu

The Image menu, which appears only when the graphics editor is active, has commands for editing images, managing color palettes, and setting image-editor window options.


 Graphics Editor Keyboard Shortcuts

 Graphics Editor Toolbox


 Graphics Editor Keyboard Shortcuts

To:	Press:
Increase the magnification factor	> (SHIFT+PERIOD)
Decrease the magnification factor	< (SHIFT+COMMA)
Use framed-rectangle tool	R
Use filled-rectangle tool	SHIFT+R
Use framed rounded-rectangle tool	N
Use filled rounded-rectangle tool	SHIFT+N
Use framed-ellipse tool	E
Use filled-ellipse tool	SHIFT+E
Use pencil tool	P
Use eraser tool	SHIFT+P
Use brush tool	D
Use selection tool	S
Use fill tool	F
Use line tool	L
Use airbrush tool	A
Pick up color	COMMA
Increase brush size	PLUS, EQUAL SIGN
Decrease brush size	MINUS
Use single-pixel brush	PERIOD
Flip along horizontal axis	X
Flip along vertical axis	Y
Toggle background-color opacity	O
Outline custom brush with foreground color	SHIFT+O
Toggle pixel grid	G
Zoom under cursor	M
Use zoom tool	Z
Use custom brush	CTRL+B
Halve size of custom brush	MINUS
Double size of custom brush	PLUS
New device image for icons and cursors	INS
Move to next pane	TAB, F6
Move to previous pane	SHIFT+TAB, SHIFT+F6
Select previous foreground color	[
Select next foreground color	]
Select previous background color	{
Select next background color	}
Show or hide pixel grid	G
Show or hide tile grid	CTRL+G


graphics editor palette
 Graphics Editor Toolbox

Tool	Button	Description	Shortcut key
Eraser		Paints over the image with the current background color when you press the left mouse button, and fills areas of the current foreground color with the current background color when you press the right mouse button.	SHIFT+P
Pencil		Draws in a constant width of one pixel.	P
Selection		Selects the area to edit.	S
Brush		Colors area, whose size and shape are determined by the option selector.	D
Airbrush		Colors pixels randomly distributed around the center of the brush.	A
Fill		Fills the area with the drawing color or the background color.	F
Line		Draws a line.	L
Color pickup		Makes any color on the bitmap the current drawing color or background color.	COMMA
Zoom		Selects a magnification factor as well as the portion of the image that appears in the "zoomed" view.	Z
Framed rectangle		Draws a rectangle framed with the foreground or background color	R
Framed round rectangle		Draws a rectangle framed with the foreground or background color and with rounded corners.	N
Framed ellipse		Draws an ellipse framed with the foreground or background color.	E
Filled rectangle		Draws a rectangle filled with a foreground color.	SHIFT+R
Filled round rectangle		Draws a rectangle filled with the foreground or background color and with rounded corners.	SHIFT+N
Filled ellipse		Draws an ellipse filled with the foreground or background color.	SHIFT+E


  Creating New Graphical Resources

  Opening Existing Graphical Resources


 Creating New Graphical Resources

You can import existing bitmaps, icons, and cursors and add them to your project, and you can open files that are not part of a project for "stand-alone" editing. For information on importing resources, see Transferring Resources Between Files.

Note  Most graphics-editor operations are the same for all kinds of graphical resources. Unless the text states otherwise, the procedures described in this section can be performed on bitmaps, cursors, or icons.

New graphical resources are always added to the current resource script file. If more than one file is open when you want to create the bitmap, click the resource browser window of the file to which you want to add the new bitmap.

  To create a new graphical resource:

On the App Studio toolbar, click the button for the resource you want to create:

The bitmap button	.

The cursor button	.

The icon button	.

− Or −

In the resource browser window, click New, or from the Resource menu, choose New.

Shortcut: CTRL+R.

Then select Bitmap, Icon, or Cursor from the list of choices and click OK or press ENTER.

The image-editor window appears.

  To create a new graphical resource for stand-alone editing:

1.	From the File menu, choose New.

Shortcut: CTRL+N.

2.	From the New dialog box, choose Bitmap, Icon, or Cursor.

3.	Choose OK.

The image editor window appears.


 Opening Existing Graphical Resources

  To open an existing graphical resource for stand-alone editing:

1.	From the File menu, choose Open.

Shortcut: CTRL+O.

The Open dialog box appears.

2.	Use the Open dialog box to navigate directories and choose a filename.

  To edit an existing graphical resource:

1.	Move to the resource browser window.

2.	In the Type box, select Bitmap, Icon, or Cursor.

A list of the resources in the current file appears in the Resources box.

3.	In the Resources box, select the bitmap resource you want to edit.

4.	Choose Open.

The image editor window appears.

Tip  The Properties window displays a thumbnail view of each graphical resource as you select its entry in the Resources box. To browse through the bitmaps in the file you are working on, select the first bitmap and then press the DOWN arrow key until the desired bitmap appears.


Editing Graphical Resource Properties

You use the Properties window to change most resource properties. Exceptions are the Width, Height, and Colors properties of icons and cursors, which you change by editing the Registry (see Editing Device Descriptions), and the cursor's hot spot (see Setting a Cursor's Hot Spot).

  To change a bitmap's properties:

1.	Select the bitmap whose properties you want to change.

2.	Activate the General property page by pressing ENTER or clicking the Properties window.

3.	Change any or all of these properties:

In the ID box, modify the resource's identifier. For a bitmap, App Studio by default assigns the next available identifier in a series: IDB_BITMAP1, IDB_BITMAP2, and so forth. Similar names are used for icons and cursors.

In the Width and Height boxes, modify the bitmap's width and height (in pixels). The default value for each is 48.

If you change the dimensions of a bitmap using the General property page, the image is cropped or "blank" space is added to the right of or below the existing image.

In the Colors list box, select Monochrome or 16. If you have already drawn the bitmap with a 16-color palette, selecting Monochrome causes App Studio to substitute black and white for the colors in the bitmap. Contrast is not always maintained: for example, adjacent areas of red and green are both converted to black.

In the Filename box, modify the name of the file in which the bitmap is to be stored. By default, App Studio assigns a base filename created by removing the first four characters ("IDB_") from the default identifier and adding the extension .BMP.

Check the Save Compressed check box to cause App Studio to save the bitmap in a compressed format.


  Selecting in a Bitmap

  Flipping the Selection

  Resizing a Bitmap

  Using the Clipboard


 Selecting in a Bitmap

The selection tool defines an area of the bitmap that you can cut, copy, clear, resize, invert, or move. You can also create a custom brush from the selection. See Creating a Custom Brush.

  To select an area of the bitmap:

1.	In the toolbox, click the selection tool [image].

Shortcut: S.

2.	Move the cursor to one corner of the bitmap area that you want to select. Cross hairs appear when the cursor is over the bitmap.

3.	Drag the cursor to the opposite corner of the area you want to select. A rectangle shows which pixels will be selected. All pixels within the rectangle, including those "under the rectangle," are included in the selection.

4.	Release the button. The "selection border," a rectangular frame, encloses the selected area. Now any operation you perform will affect only the pixels within the rectangle.

  To select the entire bitmap:

Click the bitmap outside the current selection.

− Or −

Press ESC.

− Or −

Choose another tool in the toolbox.


 Flipping the Selection

  To flip the selection along the vertical axis:

From the Image menu, choose Flip Horizontal.

Shortcut: X.

  To flip the selection along the horizontal axis:

From the Image menu, choose Flip Vertical.

Shortcut: Y.


 Resizing a Bitmap

App Studio's behavior in resizing a bitmap depends on whether the selection includes the entire bitmap or just part of it:

When the selection includes only a part of the bitmap, App Studio shrinks the selection by deleting rows or columns of pixels and filling the vacated regions with the current background color, or it stretches the selection by duplicating rows or columns of pixels.

When the selection includes the entire bitmap, App Studio either shrinks and stretches the bitmap, or crops and extends it.

There are two ways to resize the bitmap: the resizing handles and the Properties window. You drag the sizing handles to change the size of all or part of a bitmap. Sizing handles that you can drag are solid. You cannot drag handles that are hollow. You can use the Properties window to resize only the entire bitmap, not a selected part.

  To crop or extend an entire bitmap:

1.	Select the entire bitmap.

If a part of the bitmap is currently selected and you want to select the entire bitmap, click anywhere on the bitmap outside the current selection border, press ESC, or choose another drawing tool.

2.	Drag a sizing handle until the bitmap is the desired size.

Normally, App Studio crops or enlarges a bitmap when you resize it by moving a sizing handle. If you hold down the SHIFT key as you move a sizing handle, App Studio shrinks or stretches the bitmap.

  To shrink or stretch an entire bitmap:

1.	Select the entire bitmap.

If a part of the bitmap is currently selected and you want to select the entire bitmap, click anywhere on the bitmap outside the current selection border, press ESC, or choose another drawing tool.

2.	Hold down the SHIFT key and drag a sizing handle until the bitmap is the desired size.

  To shrink or stretch part of a bitmap:

1.	Select the part of the bitmap you want to resize (see Selecting in a Bitmap).

2.	Drag one of the sizing handles until the selection is the desired size.

  To resize a bitmap using the Height and Width properties:

1.	Click the Properties window to activate it.

2.	Type the desired dimensions in the Width and Height boxes.

If you are increasing the size of the bitmap, App Studio extends the bitmap to the right and downward, filling the new region with the current background color.

If you are decreasing the size of the bitmap, App Studio crops the bitmap on the right or bottom edge, or both.

You can use the Width and Height properties only to resize the entire bitmap, not to resize a partial selection.


 Using the Clipboard

You can perform standard editing operations [image] cutting, copying, clearing, and moving [image] with the selection, whether the selection is the entire bitmap or just a part of it. Because the graphics editor uses the Windows Clipboard, you can transfer images between App Studio and other applications for Windows, such as Paintbrush and Microsoft Word for Windows.

In addition, you can resize the selection, whether it includes the entire bitmap or just a part. See Resizing a Bitmap.

  To cut the current selection and copy it to the Clipboard:

From the Edit menu, choose Cut.

The original area of the selection is filled with the current background color, and the selection is now in the Clipboard.

  To copy the current selection to the Clipboard:

1.	From the Edit menu, choose Copy.

Shortcut: CTRL+C.

The selection is now in the Clipboard.

2.	From the Edit menu, choose Paste.

Shortcut: CTRL+V.

The Clipboard contents, surrounded by the selection border, appear in the upper-left corner of the pane.

3.	Position the cursor within the selection border and drag the Clipboard contents to the desired location on the bitmap.

4.	To copy the Clipboard contents into the bitmap at the desired location, click outside of the selection border or choose a new tool.

  To clear the current selection without copying it to the Clipboard:

From the Edit menu, choose Clear.

Shortcut: DEL.

The original area of the selection is filled with the current background color.

  To paste the Clipboard contents into the bitmap:

1.	From the Edit menu, choose Paste.

Shortcut: CTRL+V.

The Clipboard contents, surrounded by the selection border, appear in the upper-left corner of the pane.

2.	Position the cursor within the selection border and drag the Clipboard contents to the desired location on the bitmap.

3.	To copy the Clipboard contents into the bitmap at the desired location, click outside of the selection border or choose a new tool.


  Showing and Hiding the Graphics Palette

  Freehand Drawing and Erasing

  Drawing Lines and Closed Figures

  Filling Bounded Areas

  Creating a Custom Brush


 Showing and Hiding the Graphics Palette

The graphics editor's freehand drawing and erasing tools all work in the same way: you select the tool and, if necessary, select foreground and background colors as well as size and shape options. You then move the cursor to the bitmap and click or drag to draw and erase.

Several tools have options, which appear in the option selector.

Since many of the drawing tools are available from the keyboard, sometimes it is useful to be able to hide the graphics palette.

  To show or hide the graphics palette:

Press F2.


 Freehand Drawing and Erasing

  To select and use a drawing tool:

1.	Click the tool's button on the toolbox.

Tool	Icon	Function	Shortcut
Eraser		Paints over the image with the current background color when you press the left mouse button and fills areas of the current foreground color with the current background color when you press the right mouse button.	SHIFT+P
Pencil		Draws in a constant width of one pixel.	P
Brush		Colors area, whose size and shape are determined by the option selector.	D
Airbrush		Randomly distributes color pixels around the center of the brush.	A
2.	If necessary, select colors and a brush:

In the color palette, click the left mouse button to select a foreground color, or with the right button to select a background color.

In the option selector, click a shape representing the brush you want to use. A rectangle appears around the option you have selected.

3.	Move the cursor to the place on the bitmap where you want to start drawing or painting. The brush or cursor appears on the bitmap.

4.	Press the left mouse button (for the foreground color) or the right mouse button (for the background color), and hold it down as you draw.

5.	Release the mouse button.

  To resize the brush tool or eraser tool to a single pixel:

Press the PERIOD key.

  To change the size of the brush, airbrush, or eraser:

Press the PLUS SIGN key to increase the brush size, or the MINUS SIGN key to decrease it.

− Or −

Press the PERIOD key to choose the smallest size.

− Or −

Choose a brush in the option selector.


 Drawing Lines and Closed Figures

App Studio's tools for drawing lines and closed figures all work in the same way: you put the cursor at one point and drag to another. For lines, these points are the endpoints. For closed figures, these points are opposite corners of a rectangle bounding the figure.

Lines are drawn in a width determined by the current brush selection, and framed figures are drawn in a width determined by the current width selection. Lines and all figures, both framed and filled, are drawn in the current foreground color if you press the left mouse button or in the current background color if you press the right mouse button.

  To draw a line:

1.	From the toolbox, select the line tool [image].

Shortcut: L.

2.	If necessary, select colors: in the color palette, click with the left mouse button to select a foreground color or with the right button to select a background color.

3.	If necessary, select a brush: in the option selector, click a shape representing the brush you want to use. Your selection is highlighted.

4.	Place the cursor at the line's starting point.

5.	Drag the cursor to the line's endpoint.

6.	Release the mouse button.

  To draw a closed figure:

1.	From the toolbox, select a closed-figure drawing tool:

	Framed rectangle	Draws a rectangle framed with the foreground or background color.	R
	Filled rectangle	Draws a rectangle filled with the foreground or background color.	SHIFT+R
	Framed round rectangle	Draws a rectangle with rounded corners framed with the foreground or background color.	N
	Filled round rectangle	Draws a rectangle with rounded corners and filled with the foreground or background color.	SHIFT+N
	Framed ellipse	Draws an ellipse framed with the foreground or background color.	E
	Filled ellipse tool	Draws an ellipse filled with the foreground or background color.	SHIFT+E
2.	If necessary, select colors: in the color palette, click the left mouse button to select a foreground color or with the right button to select a background color.

3.	If necessary, select a line width: in the option selector, click a shape representing the brush you want to use. A rectangle appears around the option you have selected.

4.	Move the cursor to one corner of the rectangular area in which you want to draw the figure.

5.	Drag to the diagonally opposite corner.

6. Release the mouse button.


 Filling Bounded Areas

The graphics editor provides the fill (or "paint bucket") tool for filling any enclosed bitmap area with the current drawing color or the current background color.

  To use the fill tool :

1.	From the toolbox, choose the fill tool [image].

Shortcut: F.

2.	If necessary, choose drawing colors: in the color palette, click the left button to select a foreground color or the right button to select a background color.

3.	Move the fill tool to the area you want to fill.

4.	Click the left or right mouse button to fill with the foreground color or the background color, respectively.


 Creating a Custom Brush

A custom brush is a rectangular portion of a bitmap that you "pick up" and use like one of the graphics editor's ready-made brushes. All operations you can perform on a selection, you can perform on a custom brush as well.

  To create a custom brush:

1.	Select the part of the bitmap that you want to use for a brush. See Selecting in a Bitmap.

2.	Press CTRL+B.

Pixels in a custom brush that match the current background color are normally "transparent": they do not paint over the existing image. You can change this behavior so that background-color pixels paint over the existing image. See Choosing Opaque and Transparent Backgrounds.

  To draw custom brush shapes in the background color:

1.	Select an opaque or transparent background.

2.	Set the background color to the color in which you want to draw.

3.	Position the custom brush where you want to draw.

4.	Press the right mouse button.

Any opaque regions of the custom brush are drawn in the background color.

  To double or halve the custom brush size:

Press PLUS to double the brush size, or MINUS to halve it.

  To cancel the custom brush:

Press ESC or choose another drawing tool.


  Moving and Copying

  Choosing Opaque and Transparent Backgrounds


moving and copying (graphics editor)
 Moving and Copying

  To move the selection:

1.	Position the cursor inside the selection border or anywhere on it except the sizing handles. For more information, see Selecting in a Bitmap

2.	Drag the selection to its new location.

The original area of the selection is filled with the current background color.

3.	To anchor the selection into the bitmap at its new location, click outside the selection border or choose a new tool.

  To copy the selection:

1.	Position the cursor inside the selection border or anywhere on it except the sizing handles.

2.	Hold down the CTRL key as you drag the selection to a new location.

The area of the original selection is unchanged.

3.	To copy the selection into the bitmap at its current location, click outside the selection cursor or choose a new tool.

  To draw with the selection:

1.	Position the cursor inside the selection border or anywhere on it except the sizing handles.

2.	Hold down the SHIFT key as you drag the selection.

Copies of the selection are left along the dragging path. The more slowly you drag, the more copies are made.


 Choosing Opaque and Transparent Backgrounds

When you move or copy a selection, any pixels in the selection that match the current background color are by default "transparent": they do not obscure pixels in the target location. (A custom brush behaves the same way. See Creating a Custom Brush.)

  To toggle the background-color transparency:

In the option selector, click the appropriate button:

Shortcut: O.

  Opaque background: existing image is obscured by all parts of the selection.

  Transparent background: existing image shows through parts of the selection that match the current background color.

You can change the background color while a selection is already in effect to change which parts of the image are transparent.


  Using Image-Editor Window Panes

  Zooming In and Out

  Changing the Magnification Factor

  Displaying and Hiding Pixel Grids


 Using Image Editor Window Panes

Normally the image-editor window displays a bitmap in two panes separated by a splitter. One view is actual size, and the other is enlarged (the default enlargement factor is 6). The views in the two panes are updated automatically: changes you make in one pane are immediately shown in the other. The two panes make it easy for you to work on an enlarged "picture" of your bitmap in which you can distinguish individual pixels and at the same time observe the effect of your work on the actual-size view of the image.

If the bitmap is 200 x 200 pixels or larger, however, only one pane is displayed initially. Move the splitter to display both panes.

You can use the two panes in other ways. For example, you might enlarge the smaller pane and use the two panes to show different regions of a large bitmap.

You move the splitter to change the relative sizes of the panes. The splitter can move all the way to either side if you want to work on only one pane.

  To select an image-editor window pane:

Press TAB or F6, or click anywhere on the pane. The selection border then shows that the pane is active.

  To size the image-editor window panes:

1.	Position the cursor on the splitter.

The cursor turns into a two-headed arrow.

2.	Drag the splitter to the right or to the left.


 Zooming In and Out

By default, the graphics editor displays the view in the left pane at actual size and the view in the right pane at 6 times actual size. There are several methods to change the magnification factorthe ratio between actual and displayed sizeof the image you are editing and to toggle between an actual-size view and an enlarged view:

The Zoom tool lets you select a magnification factor by clicking and lets you choose in advance the portion of the image that appears in the "zoomed" view.

Zoom In/Out on the Image menu toggles between the enlarged view and the actual-size view.

Zoom Under Cursor, available from the keyboard only, centers the part of the image that is under the mouse pointer in the image-editor pane.

  To zoom in or out on an image-window pane:

1.	On the toolbox, click the Zoom tool [image].

Shortcut: Z.

2.	Position the mouse pointer over the pane you want to zoom in or out.

If you are zooming in on an actual-size view and the magnified view will not fit in the pane, a tracking rectangle shows the part of the bitmap that will appear in the magnified view. Position the tracking rectangle over the area you want to view.

3.	Click the pane you want to zoom in or out.

If you have used the Zoom Decrease or Zoom Increase command (see Changing the Magnification Factor) to change the zoom factor for the active pane, the current factor is used. Otherwise the default factor of 6 is used.

  To zoom in on the part of the image under the cursor:

1.	Position the mouse cursor on the point that you want to have centered in the zoomed view.

2.	Press M.

  To toggle the magnification factor:

Press M.


 Changing the Magnification Factor

The magnification factor is the ratio between actual size of the bitmap and the displayed size. The default is 6, and the range is from 1 to 10.

  To change the magnification factor:

1.	Select the image-editor pane whose magnification factor you want to change.

2.	On the toolbox, choose the Zoom tool [image].

Shortcut: Z.

The cursor changes to the Zoom tool, and magnification-factor options appear in the option selector. If the current magnification factor matches an option, that option is highlighted.

3.	Click the desired magnification factor.

− Or −

1.	Select the image-editor pane whose magnification factor you want to change.

2.	Press > to increase the magnification factor or < to decrease the magnification factor.

Shortcuts:	increase SHIFT+PERIOD

decrease SHIFT+COMMA


 Displaying and Hiding Pixel Grids

For all image-editor window panes with a magnification factor of 4 or greater, you can display a grid that delimits the individual pixels in the image. See Changing the Magnification Factor.

  To display or hide the pixel grid:

1.	From the Image menu, choose Grid Settings.

2.	In the Grid Settings dialog box, check the Pixel Grid box to display the grid or clear the box to hide the grid.

3.	Click OK.

-Or-

Press G to toggle the grid display.

You can also display a tile grid to simplify editing of toolbar graphics. See Editing Toolbar Graphics.


  Creating, Selecting, and Deleting  Images

  Editing Device Descriptions

  Drawing with Screen and Inverse Colors

  Setting a Cursor's Hot Spot


creating, selecting and deleting images
 Creating, Selecting, and Deleting Images

Icons and cursors are like bitmaps, and you edit them in the same ways. But icons and cursors have attributes that distinguish them from bitmaps. Each icon or cursor resource contains multiple images that differ according to the target display device. In addition, cursors have a "hot spot" [image] the location Windows uses to track the cursor's position.

When you create a new icon or cursor, the graphics editor first creates an image for the current display device. The image is initially filled with the "screen" (transparent) color. If the image is a cursor, the hot spot is initially the upper-left corner (coordinates 0,0).

By default, the graphics editor creates images for the following devices:

Device	Colors	Width	Height
EGA/VGA	16	32	32
Monochrome	2	32	32
CGA	2	32	16
You can create images for other devices if you first create descriptions for those devices in the Registry. See Editing Device Descriptions.

  To create a new image:

1.	On the control bar of the image editor window, click the Device Image button [image].

Shortcut: INS.

The New Cursor Image or New Icon Image dialog box appears. This dialog box lists all devices for which there is not an image in the current resource.

2.	Select the device from the dialog box.

3.	Click OK.

4.	Edit the new image. In many cases you can copy an image for another device and paste it into the new image.

When you open an existing icon or cursor, the image most closely matching the current display device is opened by default.

  To select a device image:

On the control bar of the image-editor window, select a device image from the Device list box.

Shortcut: 	PAGE UP for previous image

PAGE DOWN for next image

  To delete a device image:

1.	Display the device image you want to delete.

2.	From the Resource menu, choose Delete Device Image.

If this is the last image for the icon or cursor, App Studio displays a message box informing you that the resource will be deleted. Choose OK to delete the resource or Cancel to not delete the image. You cannot delete the last remaining image of a resource opened for stand-alone editing.

3.	If the image is the last one in the resource, choose OK to delete the resource from the resource file, or Cancel to cancel the operation.


 Editing Device Descriptions

App Studio's key in the Registry contains information about the display devices for which App Studio can create icons and cursors. Display devices are described in the keys labeled "IconDevices" and "CursorDevices." Each device description has the form:

DeviceName = ColorCount, Width, Height

The ColorCount entry must be 2 or 16, and the Width and Height must each be less than or equal to 999.

If the App Studio key in the Registry does not contain a IconDevices key, the following device descriptions are used by default:

EGA/VGA=16, 32, 32
Monochrome=2, 32, 32
CGA=2, 32, 16

If the App Studio key does not contain a CursorDevices key, the following device description is used by default:

Monochrome=2, 32, 32

For information on adding device descriptions to the App Studio key in the Registry, see Initializing and Configuring App Studio.


 Drawing with Screen and Inverse Colors

Icon and cursor images are rectangular, but many do not appear so because parts of the image are "transparent": the underlying image on the screen shows through the icon or cursor. And when you drag an icon, parts of the image may appear in an inverted color. You create these effects by choosing screen- and inverse-color options from the color indicator on the graphics palette.

  To create transparent or inverse regions in an icon or cursor:

1.	On the graphics palette, click a selector.

The screen-color selector

The inverse-color selector

2.	Apply the screen or inverse color, using the methods described in Drawing and Painting.

The screen and inverse "colors" you apply to icons and cursors are really attributes. The colors indicate parts of the image possessing those attributes. You can change the colors that represent the screen- and inverse-color attributes for your convenience in editing. These changes do not affect the appearance of the icon or cursor in your application.

  To change the colors representing screen color and inverse color:

1.	On the graphics palette, double-click the screen-color or inverse-color indicator.

The Color dialog box appears.

2.	Choose a new color from the Color dialog box.


 Setting a Cursor's Hot Spot

The hotspot is the point to which Windows refers in tracking the cursor's position. By default, the cursor's hot spot is the upper-left corner (coordinates 0,0). The General property page and the image-window control bar show the hot spot coordinates.

  To set a cursor's hot spot:

1.	On the control bar of image-editor window, click the Hot Spot button [image], or from the Image menu, choose Set Cursor Hotspot.

2.	Click the pixel you want to designate as the cursor's hot spot.


Editing Toolbar Graphics

App Studio's graphics editor has special features to simplify creation of tiled graphics for toolbar buttons (see the class CToolBar in the Class Library Reference). All the button bitmaps for a toolbar are taken from one bitmap, which must contain one image for each button. All images must be the same size; the default is 16 x 15 pixels. Images must be side by side in the bitmap. Typically the order of the images in the bitmap is the order in which they are drawn on the screen.

Each button has one image. The various button states and styles (pressed, up, down, disabled, disabled down, and indeterminate) are generated from that one image. Although bitmaps can be any color, best results are achieved with images in black and shades of gray.

The graphics editor can superimpose a tile grid on the view of your bitmap. The tile grid delimits sections of the bitmap in dimensions you specify so that you can properly position tile images within the bitmap. When the tile grid is displayed, the graphics editor's behavior changes in ways that simplify resizing a tiled bitmap.

  To set the tile-grid dimensions:

1.	From the Image menu, select Grid Settings (CTRL+G).

The Grid Settings dialog box appears.

2.	In the Grid Settings dialog box, select the Pixel Grid check box if it is not already checked.

You cannot set the Tile Grid dimensions if the Pixel Grid check box is not checked.

3.	Check the Tile Grid check box (CTRL+G).

4.	If necessary, edit the Width and Height settings.

Typically, these settings are the same as the width and height of your button bitmaps.

5.	Click OK.

The image editor window now displays a tile grid.

  To toggle the display of the tile grid:

Press CTRL+G.

Tip  When the tile grid is displayed, the sizing handles on the selection border behave differently than they do when the tile grid is not displayed. (See Resizing a Bitmap.) When you drag the sizing handles, the bitmap is resized in increments of the tile dimensions.

  To create a new toolbar button:

1.	Display the tile grid.

2.	If necessary, select a background color for the new button.

3.	To resize the bitmap, drag the sizing handle on the right side of the bitmap to the right. The bitmap's width is increased by an amount equal to the tile grid's Width setting.

4.	If the new button is to be added at a position other than the right end of the bitmap, make room for it:

Select the rightmost button images, including the one at the new button's position.

Drag the selection to the right, using the tile grid to align the images.

5.	Draw the new button image in the space you have created.


  Selecting Foreground and Background Colors

  Picking Up Colors

  Inverting Colors

  Changing the Number of Colors in a Bitmap


 Selecting Foreground and Background Colors

Except for the eraser, the tools on the graphics palette draw with the current foreground or background color when you press the left or right mouse button, respectively.

  To select a foreground color:

With the left mouse button, click the desired color on the color palette.

  To select a background color:

With the right mouse button, click the desired color on the color palette.


 Picking Up Colors

The color-pickup tool makes any color on the bitmap the current foreground color or background color, depending on whether you press the left or the right mouse button. You can pick up a color on each button.

  To pick up a color:

1.	From the toolbox, select the color-pickup tool [image].

Shortcut: COMMA.

The cursor changes to the "eyedropper."

2.	Click the bitmap area containing the color you want to pick up:

Left mouse button for the foreground color

Right mouse button for the background color

After you pick up a color, the graphics editor reactivates the most recent tool you used before the color-pickup tool.

  To cancel the color-pickup tool:

Choose another tool or press ESC.


 Inverting Colors

So that you can tell how a bitmap will appear with inverted colors, App Studio provides a convenient way to invert colors in the selected part of the bitmap.

  To invert colors in the current selection:

From the Image menu, select Invert Colors.


 Changing the Number of Colors in a Bitmap

When you increase the number of colors in a bitmap, the image does not change but you can add more colors.

  To change the number of colors in a bitmap:

1.	Click the Properties window to activate it.

2.	Choose the appropriate setting in the Colors combo box.


  Creating Color Palettes

  Saving and Loading Palettes


 Creating Color Palettes

The graphics editor's color palette displays 24 of the 48 "ready-made" colors that are available. In addition to the ready-made colors, you can create your own custom colors. Color-palette selections can be saved to disk and reloaded as necessary.

  To change colors on the color palette:

1.	Double-click the color you want to change, or click the color and then from the Image menu choose Edit Foreground Color.

The Color dialog box appears. The color you are changing is outlined.

2.	Click the color you want to assign in place of the current color.

3.	Click OK.

  To create a custom color:

1.	Double-click on the color you want to change or from the Image menu choose Edit Palette Colors.

The Color dialog box appears.

2.	Choose Define Custom Colors.

The custom-color dialog box then appears.

3.	Click the Custom Colors box in which you want to store the new custom color.

4.	Define the color by typing in RGB or HSL values, or by moving the cross hairs on the color box.

5.	Set the luminance by moving the slider on the luminance bar.

6.	Many custom colors are dithered. If you want the solid color closest to the dithered color, choose the Color|Solid control. (If you later decide you want the dithered color, move the slider or the cross hairs again to restore the dithering.)

7.	Choose a disposition for the new color you have created:

To add the new color to the Custom Colors control, click Add to Custom Colors.

To substitute the new custom color for the current palette color, choose OK. The color will be available for later use only if you add it to the Custom Colors control.

To save the custom color for later use, without replacing the current palette color, add the color to Custom Colors control. Choose Cancel.

Custom-color definitions are saved in the Registry and are automatically loaded the next time you start App Studio.


 Saving and Loading Palettes

  To save a custom palette:

1.	From the Image menu, choose Save Palette Colors.

2.	Use the Save Palette Colors dialog box to navigate directories and enter a file name.

  To load a custom palette:

1.	From the Image menu, choose Get Palette Colors.

2.	Use the Get Palette Colors dialog box to navigate directories and choose a file name.

Tip  Since the graphics editor has no means to restore the default color palette, save the default color palette under a name such as STANDARD.PAL or DEFAULT.PAL so that you can restore the defaults without having to quit and restart App Studio.


App Studio Basics

How Do I?	Brief	Click
Learn about working with resources and files	Managing resource files with App Studio
See a list of shortcut keys	Lists of shortcut keys for the App Studio window
Create and open resource files	Creating a new resource file; opening an existing resource file; adding framework support to a resource file
Browse resources	Using the resource browser window to view the contents of a resource file
Create or edit a new resource	Creating a new resource; editing an existing resource; using drag and drop; using redo and undo
Edit resource properties	Using the App Studio Properties window
Transfer resources between files	Moving resources between files; importing or exporting graphics resources
Use advanced resource file techniques	Changing the name of the symbol header file; using shared symbols; including resources from other files


Working with Resources and Files

Resources

App Studio for Windows NT supports many different ways of working with resources. You can:

Load and save resource script (.RC) files and 16-bit compiled resource (.RES) files.

Use App Studio as a stand-alone editor for bitmaps, icons, or cursors.

Import or export graphics resources to or from your current resource file.

In most cases, it is easiest to work with App Studio's single .RC file. However, App Studio can accommodate other ways of organizing a project. You can:

Work with nested resource files and conditionally included resource files.

Include shared or read-only identifiers (symbols) that can't be modified by App Studio.

Include resources in your executable file (.EXE) that don't require editing (or that you don't want to be edited) during your current project (such as resources that are shared among several projects).

Include resource types not supported by App Studio.

When you create a new resource or an object within a resource, App Studio assigns it an identifier, or symbol, consisting of a text string mapped to an integer value. You can change the symbol name or value in the Properties window when you create the resource, and you can view existing symbols and add new ones with the Symbol Browser as you work.

Files

App Studio lets you open the following types of files:

File Extension	Description
.RC	Resource script file
.BMP, .DIB, .ICO, .CUR	Graphics files containing bitmaps, icons, or cursors
Important   App Studio for Windows NT cannot load and save .EXE files or dynamic-link libraries, or compiled resource script files that were created with Windows NT.
App Studio for Windows NT does not support resources or resource objects specific to Windows NT, such as the PUSHBOX control. To use Windows NT-specific resources from within App Studio, include them in your resource file as read-only (compile-time) resources. For information on how to use the Set Includes dialog box to add compile-time resources to your application, see Including Resources From Other Files.

You can save an existing resource script or graphics file as one of the following:

.RC

.BMP, .DIB, .ICO, or .CUR (if you are working with a graphics file only and not a resource script file)

App Studio also works with several additional files during your resource editing session:

Filename	Description
RESOURCE.H	Header file generated by App Studio; contains symbol definitions.
projectname.APS	Binary version of the current resource file; used by App Studio for quick loading.
projectname.CLW	File containing information about the current project; used by ClassWizard.


 Main Toolbar

 File Management Shortcuts

 Editing Shortcuts

 Resource Management Shortcuts

 Window Management Shortcuts

 Property Window Shortcuts


main toolbar (App Studio)
 Main Toolbar

Tool	Toolbar button	Shortcut key
New resource script		CTRL+N
Open file		CTRL+O
Save active file		CTRL+S
Undo		CTRL+Z
Redo		CTRL+A
New dialog box		CTRL+1
New menu resource		CTRL+2
New cursor		CTRL+3
New icon		CTRL+4
New bitmap		CTRL+5
New string table		CTRL+6
New accelerator table		CTRL+7
Symbol browser		CTRL+I
ClassWizard		CTRL+W
Context-sensitive Help		SHIFT+F1


 File Management Shortcuts

To:	Press:
Create a new file	CTRL+N
Create a new resource script	F11
Open a file	CTRL+O
Save the current resource script	CTRL+S, SHIFT+F12
Save resource script under different name or as different type	F12


 Editing Shortcuts

To:	Press:
Undo an action	CTRL+Z
Redo the last undo	CTRL+A
Delete to the Clipboard	CTRL+X, SHIFT+DEL
Copy to the Clipboard	CTRL+C, CTRL+INS
Paste from the Clipboard	CTRL+V, SHIFT+INS
Delete	DEL
View and change symbols	CTRL+I
Create a new resource	CTRL+R


 Resource Management Shortcuts

To:	Press:
Create new resource in resource browser window, string editor, accelerator editor, Symbol Browser	ALT+N
Create resource of type currently highlighted in the resource browser window	INS
Create a new dialog box	CTRL+1
Create a new menu	CTRL+2
Create a new cursor	CTRL+3
Create a new icon	CTRL+4
Create a new bitmap	CTRL+5
Create a new string table	CTRL+6
Create a new accelerator table	CTRL+7
Delete resource in resource browser window, string editor, accelerator editor, Symbol Browser	ALT+D
Open an existing resource selected in the resource browser window	ENTER, ALT+P
Open a resource for binary editing	CTRL+B
Activate resource's Properties window	ALT+ENTER, ENTER
Connect user-interface objects to code (invoke ClassWizard)	CTRL+W
Test a dialog box	CTRL+T
Open Properties window and select Styles page	CTRL+Y
Open Properties window and select General page	CTRL+E
Open Properties window and select ID control	CTRL+Q


 Window Management Shortcuts

To:	Press:
Hide or show the graphics palette or control palette	F2
Hide or show the Properties window	SHIFT+F2
Activate next window	CTRL+F6, CTRL+TAB
Activate previous window	CTRL+SHIFT+F6, CTRL+SHIFT+TAB
Close current window	CTRL+F4
Activate the Properties window	ALT+ENTER, ALT+F6, ENTER (except in resource browser window)
Activate resource browser window	CTRL+F2
Scroll vertically	PAGE UP, PAGE DOWN
Scroll horizontally	CTRL+PAGE UP, CTRL+PAGE DOWN
Move resource browser wondow focus to the Resources box	RIGHT ARROW
Move resource browser window focus to the Type box	LEFT ARROW
Shift resource browser focus window between Resources and Type boxes	TAB, SHIFT+TAB


 Property Window Shortcuts

To:	Press:
Activate Properties window	ALT+ENTER
Select next page	PAGE DOWN
Select previous page	PAGE UP
Move to next field	TAB
Move to previous field	SHIFT+TAB
Hide or show the Properties window	SHIFT+F2
Open Properties window and select Styles page	CTRL+Y
Open Properties window and select General page	CTRL+E
Open Properties window and select ID control	CTRL+Q
Accept changes	ENTER
Cancel change	ESC


  Creating a New Resource File

  Opening a Resource File

  Reading Resource Files Not Created with App Studio or AppWizard

  Converting Existing Resource Files to App Studio Format

  Adding Framework Support


creating and opening resource files
 Creating a New Resource File

You can use App Studio to create a new resource script file, a compiled resource (.RES) file, or a graphics resource file. You can also choose to include Microsoft Foundation Class Library for Windows NT™ support in the resource file you create.  App Studio can also create a compiled resource (.RES) file, although the situations in which this is required are rare.

This section provides two ways of starting a resource editing session from the Visual C++™ Visual Workbench. The instructions assume that you have started Visual Workbench and created a basic set of new project files using AppWizard.

  To create a new resource file:

1.	From the File menu, choose New.

The New dialog box appears.

2.	Choose a file type from the list of choices: bitmap, icon, cursor, resource script file (.RC), or compiled resource file (.RES).

3.	Set or clear the Use Microsoft Foundation Classes option as appropriate.

For information on features specific to Microsoft Foundation Class resource files, see Adding Framework Support.

− Or −

Click the New File button on the App Studio toolbar [image].

A new resource script file with Microsoft Foundation Class Library support is created.

Note  You can change the type of resource file created by changing the UseMfc settings in the Registry.


opening a Visual C++ resource file
 Opening a Resource File

  To open a resource file from Visual Workbench:

From the Tools menu, choose App Studio.

This executes App Studio and opens the .RC file with the same base name as the current project.

− Or −

1.	From the Options menu, choose Editor.

The Editor dialog box appears.

2.	Under Source Files, select the Open RC Files Using App Studio option (normally turned off).

3.	Click the Project Files button on the Visual Workbench toolbar and choose your project's .RC file.

− Or −

1.	From the Options menu, choose Editor.

The Editor dialog box appears.

2.	Under Source Files, select the Open RC Files Using App Studio option (normally turned off).

3.	From the File menu, choose Open.

4.	In the File Type box, choose *.RC from the list of file types.

5.	Open the .RC file for your project.

Visual Workbench executes App Studio and loads the project resource file.

  To open a resource file from App Studio:

1.	Start App Studio from the Windows Program Manager.

2.	From the App Studio File menu, choose Open.

3.	Open your project's .RC file for editing.

For information on a recommended file structure for Visual C++ for Windows NT projects, see the discussion of the files created by AppWizard in Chapter 7 of the Visual Workbench User's Guide.


 Reading Resource Files Not Created with App Studio or AppWizard

When you start a new Visual C++ project, you normally use AppWizard to create a set of basic starter files. These starter files include an App Studio-compatible .RC file that contains support for Microsoft Foundation Class Library features. However, you can also update existing .RC files for use with App Studio.

  To update an existing resource file for use with App Studio:

1.	Make a backup copy of your existing .RC file.

2.	Add the .RC file to your project using Visual Workbench (see Chapter 3 of the Visual Workbench User's Guide).

3.	Open the file in App Studio according to the instructions in the previous section.

Note  App Studio uses the include path set in Visual Workbench (from the Visual Workbench Options menu, choose Directories). In addition, relative include paths in an App Studio resource file must be based on the directory where the .RC file is currently located.

4.	Save the App Studio version of the resource file.

Reading in and then saving resource files not created by AppWizard or App Studio has two results that are important to be aware of:

App Studio makes several changes to how your resource files are organized so that you can work with all your resources in one place.

Several resource-related features supported by the Microsoft Foundation Class Library are automatically available when your resource script file includes the library file AFXRES.H. For instructions on how to manually add framework support to existing .RC files, see Adding Framework Support.


 Converting Existing Resource Files to App Studio Format

Saving a non-App Studio resource script file for the first time in App Studio has several important consequences:

Resources contained in files that were added to your old .RC file with include statements are written back to disk as part of the main App Studio resource file.

If your old project had dialog boxes in a separate .DLG file, this separate file is no longer needed since App Studio moves the dialog boxes into the main .RC file.

However, if you have resource files containing resources that you do not want to edit in App Studio, or that you want to continue to store in a separate resource file (such as a version resource file), move the resource to a separate file and add it back by using the File menu's Set Includes command. For more information, see Including Resources from Other Files.

Any symbol definitions included in your old .RC file are marked as read-only symbols by App Studio the first time you save the .RC file. To make the symbols available for modification and editing, remove them from the included header file and place them in the App Studio resource header, resource.h.

Symbols that are defined with expressions rather than integers and used in the resource file are evaluated by App Studio, but they are then written to the App Studio symbols header (.H) file as simple integers. To preserve the expressions for calculated symbol values, include them in a read-only symbols header file. For more information, see Using Read-Only or Calculated Symbols.

Conditional compilation statements in your old .RC file are evaluated by App Studio the first time the file is read in, but they are not written back to disk when you save the .RC file.

Note  To preserve conditional compilation statements you should place the sections of your old .RC file containing these statements in a separate file, then include the file using the File menu's Set Includes command. For more information, see Including Resources from Other Files.

Comments in your old .RC file are not preserved.

In most cases App Studio makes it easy and convenient to work with all your resources and symbols in a single App Studio file. However, App Studio also supports a nested resource file structure, conditionally included resource files, and expressions as symbol values if your project requires it. For more information, see Advanced Resource File Topics.


 Adding Framework Support

Normally when you build a Visual C++ application from scratch using AppWizard, you start by generating a basic set of files, including a resource file, that contain the core features of the Microsoft Foundation classes.

However, if you are editing a resource file that does not have include statements for the Microsoft Foundation Class Library resource and symbol files, the following features specific to the Microsoft Foundation Class Library are not available in App Studio:

ClassWizard

Menu prompt strings

List Contents for combo-box controls

You can, however, add framework support to existing resource script files that do not have it.

  To add framework support to .RC files that do not already have it:

1.	From the File menu, choose Set Includes.

The Set Includes dialog appears.

2.	In the Read-Only Symbol Directives box, replace the include statement for WINDOWS.H with the following:

#include "afxres.h"

3.	You may also need to add additional include files using the Compile-Time Directives box. For more information, see the Class Library Reference.

4. Close the resource file and then reopen it for the changes to take place.


browsing your application's resources
Browsing Resources

At the beginning of a resource editing session, the first App Studio window to appear is the resource browser. You can use the resource browser window to

View the resources in the file by category.

Create new resources.

Delete existing resources.

Move resources from one file to another.

View and edit a resource's basic properties in the Properties window.

   To browse your application's resources:

Select a resource in the Type box.

The resources in your file of the type or types you selected are listed in the Resources box.

Select a single resource by clicking with the mouse. Select multiple contiguous resources by holding down the SHIFT key and clicking. Select multiple discontiguous resources by holding down the CTRL key and clicking.

When a resource in the Resources box is selected but is not currently being edited in an App Studio editing window (or the editing window is minimized), you can view and edit the resource's basic properties in the Properties window. See the Resource property page for more information.


  Creating a New Resource

  Editing an Existing Resource

  Directly Manipulating User-Interface Objects

  Using Undo and Redo


working with resources
 Creating a New Resource

There are several ways to create a new resource in App Studio. You can use the resource browser window or the App Studio main toolbar.

   To create a new resource:

On the App Studio toolbar, click the button you want.

− Or −

1.	In the resource browser window, click New, or from the Resources menu, choose New.

Shortcut: CTRL+R.

2.	Select the resource you want from the list of choices and click OK.

The editor window for the resource you chose appears.


 Editing an Existing Resource

   To edit an existing resource:

1.	Move to the resource browser window.

2.	In the Type box, select the type of resource you want.

A list of the resources of that type in the current file appears in the Resources box.

3.	In the Resources box, select name or identifier of the resource you want to edit.

4.	Choose Open.

The editing window for the resource you chose appears.

Tip  There are other ways to open a resource for editing. In addition to choosing Open in the resource browser window, you can

Select the resource and press ENTER.

Double-click the resource.

Select the resource, and from the Resource menu, choose Open.

Tip  You can always activate the resource browser for the current file by pressing CTRL+F2.


 Directly Manipulating User-Interface Objects

In many cases App Studio allows you to edit user-interface objects by directly manipulating them. For example, you can

Place controls in a dialog box by dragging them from the control palette into the dialog box.

Rearrange menu items by moving them from one place to another with the mouse.

One of the most common direct-manipulation techniques is referred to throughout this manual as "drag and drop." This means that you position an object by dragging it with the mouse or other pointing device and dropping it in its new location.

  To move or reposition an object using drag and drop:

1.	Point to the object you want to move or position and hold down the left mouse button.

2.	While still holding down the button, drag the object to its new location.

3.	When the object is in position, drop it by releasing the button.


 Using Undo and Redo

Multiple-level undo and redo is a powerful tool for iterative design in App Studio. Undo reverses the effect of the last operation and redo reverses the effect of the last undo.

Normally you can undo your last ten actions, but you can change this number by changing the value in the Registry. Most common operations in App Studio can be undone, including actions such as dragging and dropping that involve moving from one App Studio window to another.

  To undo an operation:

From the Edit menu, choose Undo.

Toolbar shortcut: .

Shortcut: CTRL+Z.

  To redo an operation:

From the Edit menu, choose Redo.

Toolbar shortcut: .

Shortcut: CTRL+A.


  Using the Properties Window

  Viewing Property Pages

  Controlling the Properties Window


 Using the Properties Window

The Properties window is one of the most important features of App Studio; it allows you to control the appearance and behavior of the resources you create. Once you have used App Studio for a short time you will become quite familiar with how the Properties window works. To get a head start, however, there are a few things you should know:

The Properties window contains one or more property pages that apply to the resource or resource object that is currently selected.

If the editing window for the selected resource is closed or minimized, only the Resource property page (showing basic information about the resource) is available.

You can control whether the Properties window stays visible while you are working in another window (for example, an editor window) or is dismissed once you switch to another window.

Changes made on a property page take effect as soon as you make them. For an edit box, changes take effect as soon as you switch to another window or control.

You can use App Studio's property pages and multiple-level undo as a design tool. Experiment with various property settings and then back them out with CTRL+Z if they're not what you want.


 Viewing Property Pages

Property pages divide resource properties into logical groupings so that they are easier to view and edit.

  To display the Properties window:

From the Windows menu, choose Show Properties.

− Or −

Choose one of the following shortcuts:

For resources with a caption, select the resource and start typing the caption.

Press ENTER when a resource is selected in an editing window.

Press ALT+ENTER at any time.

Choose the Properties command at the bottom of the resource browser window.

Tip  You can display the Properties window quickly by double-clicking the object whose properties you want to edit.

  To move from one property page to another in the Properties window:

1.	In the Resources box, select the resource whose properties you want to edit.

2.	Display the Properties window if it is not currently displayed: from the Window menu, choose Show Properties.

3.	In the property page box at the upper-right corner of the Properties window, choose the category of properties you want to edit from the list of property pages.

Tip  With the Properties window displayed, you can quickly move from one property page to another using the PAGE UP and PAGE DOWN keys.


 Controlling the Properties Window

You can control the behavior of the Properties window to suit your working style or the nature of the resource editing task. Use the "pushpin" command button in the upper-left corner of the Properties window:

When the button is in the down position [image], the Properties window stays visible even when you are working in another window. This is convenient if, during an editing session, you want to move back and forth frequently between setting properties and editing objects. Pressing ENTER after you change a value in the Properties window returns you to the editing window but leaves the Properties window visible. Pressing Esc cancels any changes you made and returns you to the editing window.

When the button is in the up position [image], you can dismiss the active Properties window by pressing ENTER or ESC. This is useful if you want to concentrate on working in an editing window but need to bring up the Properties window briefly to change one or two values.


Transferring Resources Between Files

The easiest way to transfer resources from an existing resource file to your current resource file is to have both files open in App Studio at the same time. Then use drag and drop to move items from one resource browser window to another.

Note  Visual C++ provides a file that contains sample resources that you can use in your own application.

You can use the Resource menu's Import command to add bitmap, icon, or cursor files to your current App Studio project. You can save graphics resources to disk as separate files using the Export command.

  To copy resources from one file to another:

1.	Open both files. Make sure both resource browsers are visible.

2.	In the resource browser window of the "from" file, select the resource you want to copy.

3.	Drag the resource to the resource browser window of the "to" file.

Note  To avoid conflicts with symbol names or values in the existing file, App Studio may change the transferred resource's symbol value, or symbol name and value, when you copy it to the new file.

  To import a separate bitmap, icon, or cursor file into your current resource file:

1.	From the Resource menu, choose Import. The Import dialog box appears.

2.	Choose the name of the .BMP, .ICO, or .CUR file you want to import. When you choose OK, the file is added to the current resource file.

Tip  You can also transfer a bitmap, icon, or cursor into your current resource file by dragging it from a File Manager window and dropping it into the App Studio resource browser window.

  To save a bitmap, icon, or cursor as a separate file:

1.	Select the bitmap, icon, or cursor you want to export. App Studio exports the graphic selected in the resource browser window or the graphic in the currently active image-editor window.

2.	From the Resource menu, choose Export.

3.	Enter a new filename for the bitmap, icon, or cursor, or press ENTER to accept the current filename.

The graphics file is saved to disk.


  Advanced Resource File Topics

  Changing the Name of the Symbols Header File

  Using Read-Only or Calculated Symbols

  Including Resources from Other Files


advanced resource file techniques
 Advanced Resource File Topics

You can use the File menu's Set Includes command to modify App Studio's normal working arrangement of storing all resources in the project .RC file and all symbols in RESOURCE.H. (For more information on symbols, see Symbol Browser Topics.) Use the Symbol Header File box to change the name of the header file where App Studio stores the symbol definitions for your resource file.

Use the Read-Only Symbol Directives box to include header files with symbols that you don't want to be modified during an App Studio editing session. For example, you can use the Read-Only Symbol Directives box to include a symbol file that has been created to be shared among several projects. the Read-Only Symbol Directives box is also used to include Microsoft Foundation Class Library .H files.

Use the Compile-Time Directives box to include resource files that

Are created and edited separately from the resources in your main resource file.

Contain compile-time directives, such as directives that conditionally include resources.

Contain resources in a custom format.

The Compile Time Directives box is also used to include standard Microsoft Foundation Class Library resource files.

Once you've made changes to your resource file using the Set Includes dialog box, you need to close the file and then reopen it for the changes to take effect.


 Changing the Name of the Symbols Header File

Normally App Studio saves all symbol definitions to RESOURCE.H. However, you may need to change this include filename so you can, for example, work with more than one resource file in the same project.

  To change the name of the resource symbol header file:

1.	From the File menu, choose Set Includes.

The Set Includes dialog box appears.

2.	In the Symbol Header File box, type the new name for the include file.

3.	Choose OK.


 Using Read-Only or Calculated Symbols

The first time App Studio reads in a non-App Studio resource file it marks all the included header files it finds as read-only. Subsequently you can use the File menu's Set Includes command to add additional read-only symbol header files.

One reason you may want to use read-only symbol definitions is to share symbol files among several projects.

Another reason to use included symbol files is if you have existing resources with symbol definitions that use expressions rather than simple integers to define the symbol value. For example,

#define   IDC_CONTROL1 2100

#define   IDC_CONTROL2 IDC_CONTROL1+1

App Studio will correctly interpret these calculated symbols as long as

The calculated symbols are placed in a read-only symbols file.

Your resource file contains resources to which these calculated symbols are already assigned.

  To include read-only symbols in your resource file:

1.	From the File menu, choose Set Includes. The Set Includes dialog box appears.

2.	In the Read-Only Symbol Directives box, use the #include compiler directive to specify the file where you want the read-only symbols to be kept. (The file should not be called RESOURCE.H since that is the filename normally used by App Studio's main symbol header file.)

3.	Place the symbols in the file you specified.

The symbols in files included in this way are evaluated each time you open your resource file, but they are not rewritten to disk by App Studio when you save your file.

Important  What you type in the Read-Only Symbol Directives box is included in the resource file exactly as you type it, with no parsing. Make sure what you type does not contain any spelling or syntax errors.

You should use the Read-Only Symbol Directives box to include files with symbol definitions only, not resource definitions. App Studio places resources included with the Read-Only Symbol Directives box in the main resource file when it is saved, thus creating duplicate resource definitions.


 Including Resources from Other Files

Normally it is easy and convenient to work with App Studio's default arrangement of all resources in one .RC file. However, you can add resources in other files to your current project at compile time. Use the Compile-Time Directives box in the Set Includes dialog box.

There are several reasons to place resources in a file other than App Studio's main resource file:

To include resources that have already been developed and tested, and need no further modification.

To include resources that are being used by several different projects, or that are part of a source code version control system, and thus must exist in a central location where modifications will affect all projects.

To include resources (such as RCDATA resources) that are in a custom format.

To include statements in your resource file that execute conditionally at compile time by using compiler directives such as #ifdef and #elseif. For example, your project may have a group of resources that are bracketed by #ifdef _DEBUG ... #endif  and are thus included only if the constant _DEBUG is defined at compile time.

To include statements in your resource file that modify resource-file syntax by using #define to implement simple macros.

If you have sections in your existing resource files that meet any of these conditions, you should place the sections in one or more separate .RC files and include them in your project using the Set Includes dialog box. The projectname.RC2 file created by AppWizard in the RES subdirectory of a new project is used for this purpose.

  To include resource files that will be added to your project at compile time:

1.	Place the resources in a file with a unique filename. (projectname.RC is the filename used for App Studio's main resource file.)

2.	From the File menu, choose Set Includes. The Set Includes dialog box appears.

3.	In the Compile-Time Directives box, use the #include compiler directive to include the new resource file in the main App Studio resource file.

The resources in files included in this way are made a part of your executable at compile time. They are not available for editing or modification when you are working on your project's main .RC file. You need to work on included resource files in a separate App Studio resource script file.


Initializing and Configuring App Studio

With Windows NT, App Studio stores information about initialization and configuration within the configuration registry, the system configuration database. Most of the settings in the Registry are read-write: App Studio reads them at startup and writes them at the end of the session if they have changed. Other settings are read-only: App Studio reads them at startup but never writes them. The only way that you can change this read-only information is to use the Registry Editor, REGEDT32.EXE. For more information on using the Registry Editor, refer to Windows NT Help.

The Registry is divided into keys, which are represented as folders in the Registry Editor. To modify the keys specific to App Studio, open the App Studio key, which can be found under HKEY_CURRENT_USER\Software\Microsoft. The App Studio key is further subdivided into keys.

This appendix describes the read-only settings you can use to customize App Studios behavior. Each key contains one or more entries consisting of a value and a string or number, which are shown in the right-hand pane of the Registry Editor. The appendix shows both the key and the value. The Registry also requires that you provide the type for numbers and strings included in an entry. All numerical values within an entry (Booleans, levels, integers) should be of type REG_DWORD and that of strings should be REG_SZ.

Setting the Default .RC File Type

Key Name: App Studio\General
Name: UseMFC
Type: REG_DWORD
Data: Bool

This entry is equivalent to the Use Microsoft Foundation Classes check box in the New dialog box. If Bool is 1, the check box is checked by default; if Bool is 0, the check box is cleared by default. If the check box is checked, App Studio creates a resource script (.RC) file that supports Microsoft Foundation Class Library features such as ClassWizard. If the check box is cleared, App Studio creates a standard resource script (.RC) file.

Setting the Number of Undo Levels

Key Name: App Studio\General
Name: UndoLevels
Type: REG_DWORD
Data: levels

The number of undo operations is limited to the number specified by levels. If this entry does not appear in the Registry, the default of 10 is used.

Using Default Dialog-Box Buttons

Key Name: App Studio\Dialog Editor
Name: Initial Buttons
Type: REG_DWORD
Data: Bool

If Bool is 1, dialog-box templates are created with the OK and Cancel buttons. If Bool is 0, they are not.

Setting the Default Magnification Factor

Key Name: App Studio\Graphics Editor
Name: Default Zoom
Type: REG_DWORD
Data: int

Sets the default value for the ratio of magnified and actual-size views in the image editor window. The range is 2 to 10. If this entry does not appear in  the Registry, the default of 6 is used.

Describing Cursor Devices

Key Name: App Studio\Cursor Devices
Name: name
Type: REG_SZ
Data: colors[,]width[,]height

Specifies the names of display devices and the attributes of their corresponding cursor images. The name of the device is specified by name. It appears in the New Cursor Image dialog box when you add an image to a cursor. The colors, width, and height entries specify the number of colors supported by the device (subject to App Studios limit of 16 colors) and the image size in pixels. Windows currently supports only monochrome cursors.

Describing Icon Devices

Key Name: App Studio\Icon Devices
Name: name
Type: REG_SZ
Data: colors[,]width[,]height

Specifies the names of display devices and the attributes of their corresponding icon images. The name of the device is specified by name. It appears in the New Cursor Image dialog box when you add an image to a cursor. The colors, width, and height entries specify the number of colors supported by the device (subject to App Studios limit of 16 colors) and the image size in pixels.


ClassWizard Topics

How Do I?	Brief	Click
Learn about ClassWizard	Creating message−handling classes and editing message maps with ClassWizard
Add or import a class	Creating a new message−handling class with ClassWizard, or updating the ClassWizard (.CLW) file to recognize classes you've copied from another project.
Map messages to functions	Defining message−handling functions with ClassWizard
Work with dialog box data	Using ClassWizard to take advantage of the framework's built−in dialog data exchange and dialog data validation routines
Update ClassWizard when code changes	Updating ClassWizard for renamed, moved, or deleted classes; rebuilding the entire ClassWizard file
Update existing code for use with ClassWizard	Adding the special−format ClassWizard comments to existing code


Using ClassWizard

ClassWizard is like a programmer's assistant: it makes it easier for you to do certain routine tasks such as creating new classes, defining message handlers, and gathering data from controls in a dialog box or form view.

One of ClassWizard's main tasks is to work with Microsoft Foundation Class Library "message maps." A map is a message−dispatch table that associates Windows messages with class member functions. This eliminates the cumbersome switch statements needed in traditional programming for Windows.

With ClassWizard, you can:

Create new classes derived from any of the main framework base classes that handle Windows messages.

Browse the Windows messages associated with windows, dialog boxes, controls, menu items, and accelerators.

Create new message−handling member functions by clicking the messages you want to handle.

View messages having message handlers already defined and jump to the handler program code.

Define member variables that automatically initialize, gather, and validate data entered into dialog boxes or form views.

Important  ClassWizard never changes any of your code. It only works with the special−format message−map and data−map sections of your header and implementation files (for more information, see Adding a New Class). The Microsoft Foundation Class Library uses this information for message handling and dialog data exchange and validation.

The Visual C++ for Windows NT ClassWizard is used with Microsoft Foundation Class Library version 2.0 projects. For information on how to convert other projects (including Microsoft Foundation Class Library version 1.0 projects) for use with ClassWizard, see Updating Existing Code for Use with ClassWizard.

You can also update ClassWizard when you've made minor changes to the source code or rebuild the entire ClassWizard (.CLW) file when the changes you've made are more extensive.

While you can do any of these common programming functions without using ClassWizard, using ClassWizard together with the framework allows you to accomplish these common chores quickly and efficiently.


  Adding a New Class

  Importing Existing Classes


 Adding a New Class

Use ClassWizard to add error−free class declarations to your project for classes that contain message−handling functions.

Note  ClassWizard is only for use with user−interface classes that handle messages or manage dialog−box controls. To add a new class that does not handle messages, create the class directly in the Visual Workbench editor.

ClassWizard allows you to create classes derived from the Microsoft Foundation classes shown below:

Class	Description
CDialog	Dialog box
CDocument	Class for managing program data
CFormView	Window that can contain dialog−box controls
CFrameWnd	Main single document interface (SDI) frame window
CMDIChildWnd	Multiple document interface (MDI) child frame window
CView	Class for displaying program data
CScrollView	Scrolling window, derived from CView
CWnd	Custom window
CSplitterWnd	MDI child frame window containing a CSplitterWnd object
For more information on these classes, see the Class Library Reference.

When you use ClassWizard to create a new class derived from one of the framework classes listed above, it automatically places a complete and functional class in the header (.H) and implementation (.CPP) files you specify. ClassWizard keeps track of the class's message−handling and data−exchange members, and later you can use it to update this information.

   To add a new class to your project using ClassWizard:

1.	In Visual Workbench: from the Project menu, choose ClassWizard.

− Or −

From the Resource menu, choose ClassWizard.

Toolbar shortcut: .

Shortcut: CTRL+W.

Note  For classes associated with a dialog−box resource [image] classes derived from CDialog or CFormView [image] create the resource first in App Studio before you use ClassWizard to create the class.

2.	Choose Add Class. The Add Class dialog box appears.

In App Studio, if you are currently editing a dialog box that is not yet associated with a class, the Add Class dialog box appears automatically when you run ClassWizard.

3.	Type the name of your new class in the Class Name box, and in the boxes provided, type the names of the header and implementation files where the class is to be defined.

4.	In the Class Type box, select the name of the class or class type from which your current class is to be derived.

5.	In the Dialog ID box, select the name of the resource identifier from the list. If you are in App Studio, have a dialog box selected, and are creating a class based on CDialog or CFormView, the identifier is already filled in for you.

6.	Choose Create Class to create the class in the files you specified.

When you use ClassWizard to create a new class, it adds skeletal information on the new class to both the header and implementation files. If you specify filenames that don't yet exist, ClassWizard creates the new files and adds them to your project if Visual Workbench is running.

Note  ClassWizard only updates your project file if Visual Workbench is running. If this is not the case, you need to add the files to the project yourself.

When you add a new class using ClassWizard, special−format comments are placed in your code to mark the sections of the header and implementation files that ClassWizard edits. ClassWizard never modifies code that is outside these commented sections.

For most classes, there are two related sections of code that ClassWizard edits: the member−function definitions in the class header file and the message-map entries in the class implementation file.

The ClassWizard comments in the header file look like this:

//{{AFX_MSG(<classname>)

// ClassWizard adds member functions here

//}}AFX_MSG

The ClassWizard section in the implementation file is set off with comments that look like this:

//{{AFX_MSG_MAP(<classname>)

// ClassWizard adds message map macros here

//}}AFX_MSG_MAP

For more information about these comments, see Updating Existing Code for Use with ClassWizard.

For dialog boxes, ClassWizard creates and edits three other sections that are marked with special-format comments:

Member variable declarations in the class header file (//{{AFX_DATA...//}}AFX_DATA)

Member variable initialization in the class implementation file (//{{AFX_DATA_INIT...//}}AFX_DATA_INIT)

Data−exchange macros in the implementation file (//{{AFX_DATA_INIT...//}}AFX_DATA_INIT)

For more information, see Working with Dialog Box Data.


 Importing Existing Classes

If you add a message−handling class to your current project by copying code from another project, you can update ClassWizard so that it recognizes the new class.

Note  If the new code you have copied contains more than two or three new message−handling classes, you can save time by rebuilding the ClassWizard database file completely rather than importing each new class individually.For more information, see Rebuilding the ClassWizard File.

   To add a class copied from another project to the ClassWizard database:

1.	If the code you are importing doesn't already have ClassWizard comments in it, add the special−format comments ClassWizard uses to locate message−map entries. For more information, see Updating Existing Code for Use with ClassWizard.

2.	Bring up the main ClassWizard dialog box and choose Add Class. When the Add Class dialog box appears, choose Import Class.

3.	In the Import Class dialog box, type in the name of the new class and the name of the header and implementation files where it can be found.

4.	Choose OK to add the new class to the ClassWizard database.


  Defining Message Handlers

  Deleting Message Handlers

  Jumping to Source Code from ClassWizard


mapping messages to functions
 User−Interface Objects

ClassWizard lets you browse the messages associated with a user−interface object in your application and quickly define message−handling functions for them. ClassWizard also automatically updates the message−dispatch table, or message map, when you use ClassWizard to define message−handling functions.

The procedure for handling a message is very similar regardless of the kind of user−interface object you are working with. The following table shows the types of objects you work with in ClassWizard and the types of messages associated with them.

Object ID	Messages
Class name, represents the containing window	Windows messages appropriate to a CWnd−derived class: a dialog box, window, child window, MDI child window, or topmost frame window
Menu or accelerator identifier	COMMAND message (executes the program function) UPDATE_COMMAND_UI message (dynamically updates the menu item)
Control identifier	Control notification messages for the selected control type


 Defining Message Handlers

After creating a class with ClassWizard, or importing an existing class, you can use ClassWizard to browse the messages or control notifications associated with each object and to create handler routines (member functions) as appropriate. Selecting a message in ClassWizard provides a brief description of it, or you can press F1 for more detailed information.

The general procedure for using ClassWizard to define a message or command handler is as follows:

   To define a message handler with ClassWizard:

1.	In Visual Workbench: from the Project menu, choose ClassWizard. Shortcut: CTRL+W.

− Or −

In App Studio: select the user−interface object you want to work with. Then, from the Resource menu, choose ClassWizard.

Toolbar shortcut: .

Shortcut: CTRL+W

The main ClassWizard dialog box appears. If you are in Visual Workbench, ClassWizard displays information about the currently selected class name or the class you last edited with ClassWizard. If you are in App Studio, you see information about the user−interface object that is currently selected.

2.	In the Object IDs box, select the name of the user−interface object for which you want to define a message handler.

3.	In the Messages box, select the message for which you want to define a handler and choose Add Function or double−click the message name.

You can only select messages that do not already have a handler defined. A message with a handler already defined has a picture of a small hand next to it.

Note  The messages you see in the Messages box are those most appropriate to your class. You can change which messages you see by choosing the Class Info command and selecting a new set of messages in the Message Filter box. For information on handling custom messages, see Technical Note 6.

For messages that don't already have a handler defined in their base class, the Add Member Function dialog box appears.

Tip  Selecting a message displays a brief description of it at the bottom of the ClassWizard dialog box. You can get a more complete description of the message by pressing F1.

4.	For messages that don't already have a handler defined in their base class, type in the member function name you want and press ENTER, or press ENTER to accept the name proposed by ClassWizard. This returns you to the main ClassWizard dialog box.

A picture of a hand appears next to the message name to show that a member function is defined to handle the message. The name of the new message−handling function appears in the Member Functions box.

At this point you have several options. You can:

Add more message handlers.

Choose Edit Code to jump to the empty ClassWizard−generated function in your source code and begin defining the function's behavior.

Choose OK to close ClassWizard. You can return to ClassWizard any time during the development process.

Choose Cancel to cancel the changes you have made.

When you choose OK or Edit Code, ClassWizard updates your source code as follows:

A function declaration is inserted into the header file.

A complete, correct function definition with a skeletal implementation is inserted into the implementation file.

The class's message map is updated to include the new message−handling function.


 Deleting Message Handlers

Once you have defined a message handler with ClassWizard, you can also use ClassWizard to delete it. However, you must remove the function definition, as well as any references to the function, from the implementation file yourself. ClassWizard never makes changes to your implementation code [image] only to the message and data maps.

   To delete a message−handling function:

1.	In the main ClassWizard dialog box, from the Class Name box, select the class containing the message−handling function you want to delete.

2.	In the Member Functions box, select the name of the member function to delete.

3.	Use the Edit Code command to open the implementation file containing the member function in Visual Workbench. Delete the function header and function body, or copy it to a file not in the current project.

4.	Return to ClassWizard and choose Remove Function. This deletes the member function from the message−map entries for that class in both the header and implementation files.


 Jumping to Source Code from ClassWizard

If Visual Workbench is running, once you have defined a procedure with ClassWizard, you can use the Edit Code command to jump to the member−function definition and begin to add or modify code.

   To use the ClassWizard Edit Code command (available only when Visual Workbench is running):

1.	In the Member Functions box, select the function you want to edit.

2.	Choose Edit Code or double−click the function name.

ClassWizard switches to Visual Workbench and moves to the beginning of the member function.


  Working with Dialog Box Data

  Dialog Data Exchange

  DDX Value Variables

  DDX Control Variables

  Using DDX Variables

  Dialog Data Validation Types

  Custom Data Exchange and Validation


working with dialog-box data
 Working with Dialog Box Data

ClassWizard offers an easy way to take advantage of the dialog data exchange (DDX) and dialog data validation (DDV) capabilities of the Microsoft Foundation classes.

To use DDX, you define member variables in the dialog−box class and associate each of them with a dialog−box control. The framework transfers any initial values to the controls when the dialog box is displayed. It then updates the variables with user−entered data when the dialog box is dismissed by clicking OK.

With DDV, dialog box information entered by the user is validated automatically. You can set the validation boundaries: the maximum length for string values in an edit−box control or the minimum or maximum numeric values when you expect a number to be entered. You can also use ClassWizard to connect dialog box controls to your own custom data−validation routines.


 Dialog Data Exchange

ClassWizard lets you create variables that use the framework's automatic dialog data exchange capabilities. For each dialog box control you want to set an initial value for or gather data from, use ClassWizard to define a data member in the dialog class. The framework then transfers the initial value of each variable to the dialog box when it is created and updates each member variable when the dialog box is dismissed.

Note  You can also use CWnd::UpdateData to transfer data back and forth between controls and member variables while a dialog box is open.

   To define data members for dialog data exchange:

1.	Create your dialog box in App Studio, place in it the controls you want, and set the appropriate control styles in the Properties window. Then use ClassWizard to define a new dialog box class. For more information, see Adding a New Class .

2.	In the ClassWizard dialog box, choose Edit Variables. The Edit Member Variables dialog box appears.

3.	Select the control for which you want to set up DDX and choose Add Variable. The Add Member Variable dialog box appears.

4.	In the Member Variable Name dialog box, type the name of the new variable. ClassWizard provides the m_ prefix to identify it as a member variable.

5.	In the Property box, select whether this variable contains a value or is an object of the control's type.

For standard Windows controls, choose Value in the Property box to create a variable that contains the control's text or status as entered by the user. The framework automatically converts the control's data to the data type selected in the Variable Type box.

You can also choose Control in the Property box to create a Control variable that gives you access to the control itself.

6.	In the Variable Type box, choose from a list of variable types appropriate to the control.

Once you've defined a DDX Value variable for a standard Windows control, the framework automatically initializes and updates the variable for you.

ClassWizard initially provides seven DDX Value variables. For more information on creating additional variable types, see Technical Note 26.


 DDX Value Variables

Control	Variable Type
Edit box	CString, int, UINT, long, DWORD, float, double
Normal check box	BOOL
Three−state check box	int
Radio button (first in group)	int
Nonsorted list box	CString, int
Drop-list combo box	CString, int
All other list box and combo box types	CString
The following additional notes apply to using DDX Value variables:

Possible values for three−state check boxes are 0 (off), 1 (on), and 2 (indeterminate).

Values for a group of radio buttons range from 0 for the first button in the group to n1 for a group with n buttons. A value of 1 indicates that no buttons are selected.

When you are using a group of check boxes or radio buttons with a DDX variable, make sure the Auto property is set for all the controls in the group.

Set the Group property for the first radio button in a group, and make sure all the other radio buttons immediately follow the first button in the tab order.

To use an integer value with a combo box or list box, make sure the Sort property is turned off on the control's Styles property page.

You can define several types of DDX Control variables with ClassWizard.


 DDX Control Variables

Control	Variable Type
Edit box	CEdit
Check box	CButton
Radio button	CButton
Pushbutton	CButton
List box	CListBox
Combo box or drop list combo box	CComboBox
Static text	CStatic


 Using DDX Variables

You can set the initial value of DDX variables by editing the initialization code that ClassWizard places in the constructor for the dialog box class. (ClassWizard does not disturb these initialization statements once they have been put in place.) The framework transfers the values to the dialog box when it is created.

To see what the user typed once the dialog box is dismissed, access the values of the DDX variables just as you would any C++ member variable.


data validation types
 Dialog Data Validation Types

By default, ClassWizard supports the types of data validation shown in the following table, but you can add additional types (see Technical Note 26.)

Variable Type	Data Validation
CString	Maximum length
Numeric (int, UINT, long, DWORD, float, double)	Minimum value, maximum value
You can define the maximum length for a CString DDX variable or the minimum or maximum values for a numeric DDX variable at the time you create it. For example, the ClassWizard Edit Member Variables dialog box allows you to create a DDX integer variable associated with an edit box. The variable has a minimum value of 1 and a maximum value of 10.

At run time, if the value entered by the user exceeds the range you specify, the framework automatically displays a message box asking the user to reenter the value. The validation of DDX variables takes place all at once when the user chooses OK to accept the entries in the dialog box.


 Custom Data Exchange and Validation

Although you can write a dialog−box class that gathers and validates its own dialog−box data using custom message handlers, you may find that you have routines for data exchange and validation (containing your own variable types and data formats) that you want to use again and again. You can extend the ClassWizard user interface to reuse your own DDX and DDV routines.

For more information, see Technical Note 26.


  Updating ClassWizard

  Deleting Classes

  Renaming or Moving Classes

  Rebuilding the ClassWizard File


keeping ClassWizard updated
 Updating ClassWizard

It's very likely that as your program develops you'll need to delete or modify a class, delete some resources and add others, or move a class from one source file to another. ClassWizard is designed to keep in sync with your code as you make these changes: it asks you for the updated information when you next edit the affected class.

ClassWizard stores the information about your application's classes in a file with the file extension .CLW. To accommodate source files that have changed, ClassWizard displays the Repair Class Information dialog box whenever it finds that the information in the .CLW file is out of date.

The Repair Class Information dialog box has two main functions:

Delete obsolete classes from the ClassWizard database.

Update the ClassWizard database with the new name or location of classes that you have changed or moved.


 Deleting Classes

When you delete a class from your header and implementation files, the next time you select that class in ClassWizard, you are prompted to update the information in the ClassWizard database.

   To delete a message−handling class created with ClassWizard:

1.	Remove the class from your header and implementation files.

2.	Open ClassWizard, and in the Class box, select the class you have modified.

ClassWizard displays a message box warning you that the class cannot be found. Then the Repair Class Information dialog box appears.

3.	Choose Remove.

The class is deleted from the ClassWizard file.


 Renaming or Moving Classes

When you change the name of a class or move it from one implementation file to another, you're prompted to update the information in the .CLW file the next time you edit the class in ClassWizard.

   To change the name of a class or move it from one file to another:

1.	Make the desired changes to your source files.

Note  When you change the name of a class, remember to change it everywhere, including the special−format comments ClassWizard uses. For example,

//{{AFX_MSG_MAP(OldClass)

becomes

//{{AFX_MSG_MAP(NewClass)

2.	Invoke ClassWizard. In the Class Name box, choose from the list the class you want to change.

ClassWizard displays a message box warning you that the old class could not be found. When you choose OK, the Repair Class Information dialog box appears.

3.	In the Class Name, Header File, and Implementation File boxes, supply the new information about the class. If necessary, use the appropriate Browse command to look for the correct name of the header or implementation file.

4.	Choose OK to update the ClassWizard file.


 Rebuilding the ClassWizard  File

If you have made numerous changes to your code or have added a large number of existing user−interface classes to your current project, you may find it convenient to rebuild the ClassWizard file from scratch rather than update it one class at a time. To do this, you delete your project's ClassWizard (.CLW) file and use a dialog box similar to the Visual Workbench's Edit Project dialog box to generate a new one. The newly generated .CLW file contains information about all the classes that have the special−format ClassWizard comments.

   To rebuild the ClassWizard file:

1.	Delete your project's current .CLW file.

2.	Open the project resource file in App Studio so that information about your program's resources can be added to the file as well.

3.	Invoke ClassWizard. A message box is displayed asking if you want to rebuild the ClassWizard database from your project files. Click Yes.

4.	The Select Source Files dialog box appears. Use the File Name box and the Add, Add All, and Delete commands to create a list of project files in the Files in Project box.

5.	When the list of project files is complete, click OK.

ClassWizard generates a new .CLW file.


Updating Existing Code for Use with ClassWizard

This section provides the basics for adding ClassWizard comments to existing code so that the code can be used with ClassWizard. Microsoft Foundation Class Library version 1.0 code is an example of code containing classes that need to be updated in this way. To update a class for use with ClassWizard, it must already have a message map defined.

For more detailed information on updating existing code, see Technical Note 19.

To use existing code with ClassWizard, place the special−format comments ClassWizard uses to locate message−map entries in both your header and implementation files.

In your header file, ClassWizard uses comments of the following form, placed before and after message−handler declarations:

//{{AFX_MSG(classname)

     //message−handler declarations here

//}}AFX_MSG

The classname is the name of the class to which the message handlers belong. For example:

//{{AFX_MSG(CPasswordDlg)

afx_msg void OnChangePassword();

//}}AFX_MSG

In your implementation file, ClassWizard uses comments of the following form, placed before and after the message−map entries:

//{{AFX_MSG_MAP(classname)

          // message map entries here

//}}AFX_MSG_MAP

For example:

BEGIN_MESSAGE_MAP(CPasswordDlg, CDialog)

//{{AFX_MSG_MAP(CPasswordDlg)

ON_EN_CHANGE(IDC_PASSWORD, OnChangePassword)

//}}AFX_MSG_MAP

END_MESSAGE_MAP()

You can also upgrade existing dialog classes for use with ClassWizard dialog data exchange and validation, although you may not need to do this if your existing dialog−box code already handles data exchange and validation to your satisfaction.

For an example of the AFX_DATA, AFX_DATA_INIT, and AFX_DATA_MAP comments used by ClassWizard to maintain information for data exchange and validation, see the PENDLG.CPP (and PENDLG.H) module of the SCRIBBLE example program discussed in the Class Library User's Guide.

Once you have placed the necessary ClassWizard comments in your source files, load the project's resource script file into App Studio, invoke ClassWizard, and build the ClassWizard database (.CLW) file. For more information, see Rebuilding the ClassWizard File.

To learn how resource script files change when you upgrade from version 1.0 of the Microsoft Foundation Class Library to version 2.0, see Updating an Existing Resource File.


clicks in client area
Please click the Help button for help on this property page.


multiple resources or no resource chosen
You can open a property page only when one resource has been chosen. This property page appears when either multiple resources have been chosen in the resource browser or when no resources appear there.


Resource Property Page

The following properties are available in the Properties window when a resource is selected in the resource browser window but the editing window for that resource is not open, or when the editing window is open but minimized:

ID	Discardable
Preload	Pure
Moveable
Bitmaps, icons, and cursors also have the following fields in the Resource property page:

Filename	Preview


ID (Resource View)
  ID

The resource's identifier. Usually the resource ID is a symbol supplied by App Studio and defined in the .H file that App Studio creates as part of your project. (For string tables, the ID is always STRINGTABLE and cannot be modified.)

Type: Symbol, Integer, or Quoted String.


 Preload

Determines if the resource is loaded when the application starts up (True) or is not loaded until it is called (False). Equivalent to the PRELOAD and LOADONCALL resource compiler statements.

Type: Bool.

Default: False.


 Moveable

Permits the resource to be moved to compact memory if necessary (True) or causes it to remain at a fixed memory location. Equivalent to the MOVEABLE and FIXED resource compiler statements.

Type: Bool.

Default: True.


 Discardable

Allows the resource to be purged from memory if no longer needed. When the resource is needed again, it is loaded from disk.

Type: Bool.

Default: True.


 Pure

Prevents the resource from being dynamically modified by the application at run time if set to True. If Pure is False, your application cannot have more than one instance running at a time. Has no effect for standard resource types in Microsoft Foundation Class Library applications. Made available for user resource types and for backward compatibility with real-mode applications.

Type: Bool.

Default: True.


Filename (Resource View)
 Filename

The name of the file containing the bitmap, icon, or cursor resource.


 Preview

A box showing what the bitmap, icon, or cursor looks like. Useful for browsing through graphics resources without opening them.


Dialog Properties: General

ID	Menu
Caption	X Pos
Font Name	Y Pos
Font Size	Font
Registered Class

 Dialog Properties: Styles


ID (Resource)
 ID

The resource or resource object's identifier. Usually the resource ID is a symbol supplied by App Studio and defined in the .H file that App Studio creates as part of your project.

Type: Symbol, Integer, or Quoted String.


Caption (Dialog Properties: General)
 Caption

The text that appears as part of the dialog box to label it.

Default: A name based on the type of resource (in this case, "Dialog") plus a number based on the resource identifier assigned by App Studio.


 Font Name

The typeface of the font that will be used in all the controls in the dialog box. The bold version of the typeface is always used. Change this value by choosing the Font command in the lower-left corner of the property page.

Default: MS Sans Serif.


 Font Size

The point size of the font that will be used in all the controls in the dialog box.

Default: 8 points. Change this value by choosing the Font command in the lower-left corner of the property page.


 Font

Choose the Font command to change the typeface or size of the dialog-box font.


 Menu

Contains the resource identifier of the menu used in the dialog box, if any.

Type: Resource identifier.

Default: None.


 X Pos

The x-coordinate, in dialog box units (DLUs), of the upper-left corner of the dialog box.

Type: Integer.


 Y Pos

The y-coordinate, in dialog box units (DLUs), of the upper-left corner of the dialog box.

Type: Integer.


 Registered Class

Identifier of a registered dialog class (a Windows operating system window class, not to be confused with a C++ class). Provided to support C programming. If you are using a resource file with Microsoft Foundation Class Library support, this option is disabled.

Type: Integer or String. String must be in double quotes.

Default: None.


Dialog Properties: Styles

Style	Clip Siblings
Border	Clip Children
Minimize Box	System Modal
Maximize Box	Absolute Align
Titlebar	NoIdleMsg
System Menu	LocalEdit
Horiz. Scroll	Visible
Vert. Scroll	Disabled

  Dialog Properties: General


Style (Dialog Properties: Styles)
 Style

One of the following:

Overlapped	Creates an overlapped window. An overlapped window is always a top-level window and should have a caption and a border.
Popup (Default)	Creates a pop-up window.
Child	Creates a child window.


Border (Dialog Properties: Styles)
 Border

One of the following:

None	No border. A title bar is not available.
Thin	A thin border.
Resizing	Creates a thick border that can be used to resize the dialog box.
Dialog Frame (Default)	A dialog-box border.


 Minimize Box

Creates a minimize box for the dialog box. Disabled if there is no title bar.

Type: Bool.

Default: False.


 Maximize Box

Creates a maximize box for the dialog box. Disabled if there is no title bar.

Type: Bool.

Default: False.


 Titlebar

Creates a title bar for the dialog box. Disabled if the dialog box has no border.

Type: Bool.

Default: True.


 System Menu

Creates a system menu for the dialog box. Disabled if there is no title bar.

Type: Bool.

Default: True.


Horiz. Scroll (Dialog Properties: Styles)
 Horiz. Scroll

Creates a horizontal scroll bar for the dialog box.

Type: Bool.

Default: False.


Vert. Scroll (Dialog Properties: Styles)
 Vert. Scroll

Creates a vertical scroll bar for a dialog box.

If you create horizontal or vertical scroll bars for a dialog box that uses the default border style (the Dialog Frame style), the scroll bars are drawn overlapping the borders of the dialog rather than within them and the contents of the dialog box are clipped improperly. This is standard Windows behavior. To avoid this behavior, use a different border style when creating a scrollable dialog box.

Type: Bool.

Default: False.


 Clip Siblings

Clips child windows relative to each other; that is, when a particular child window is repainted, this style clips all other top-level child windows out of the region of the child window to be updated. If Clip Siblings is False and child windows overlap, it is possible, when drawing in the client area of a child window, to draw in the client area of a neighboring child window. For use with child windows only.

Type: Bool.

Default: False.


 Clip Children

Excludes the area occupied by child windows when drawing within the parent window. Used when creating the parent window. Do not use this style if your dialog box contains a group box.

Type: Bool.

Default: False.


 System Modal

Creates a system-modal dialog box. A system-modal dialog box prohibits switching to another window or program while the dialog box is active.

Type: Bool.

Default: False.


 Absolute Align

Determines whether the dialog box is aligned relative to the screen or relative to its parent window. If True, the dialog box is displayed at coordinates relative to the upper-left corner of the screen.

Type: Bool.

Default: False.


 NoIdleMsg

Suppresses the WM_ENTERIDLE message ordinarily sent to the owner of a dialog box when no more messages are waiting in its message queue.

Type: Bool

Default: False


 LocalEdit

Specifies that edit-box controls in the dialog box will use memory in the application's data segment. Normally, all edit-box controls in dialog boxes use memory outside the application's data segment.

Type: Bool.

Default: False.


Visible (Dialog Properties: Styles)
 Visible

Specifies that the dialog box is visible when first displayed. Set this property to False for form views and dialog-bar template resources.

Type: Bool.

Default: True.


Pushbutton Properties: General

Pushbuttons have the following standard properties on the General property page.

ID	Disabled
Caption	Group
Visible	Tabstop
In addition to the standard properties listed above, pushbuttons have the following additional general properties:

Default Button	Owner Draw


ID (Check Box)
 ID

The resource's identifier. Usually the resource ID is a symbol supplied by App Studio and defined in the .H file that App Studio creates as part of your project.

Type: Symbol or Integer.


 Caption

The text that appears as part of the control to label it. To make one of the letters in the caption of a control the mnemonic key, precede it with an ampersand (&).

Default: A name based on the type of control (for example, "Check") plus a number based on the resource identifier assigned by AppStudio.


Visible (Resource Objects)
 Visible

Determines whether the control is visible when the application is first run.

Type: Boolean.

Default: True.


Disabled (dialog boxes)
 Disabled

Creates a dialog box that is initially disabled.

Type: Boolean.

Default: False.


 Group

Specifies the first control of a group of controls in which the user can move from one control to the next by using the arrow keys. All controls in the tab order after the first control with the Group property set to False belong to the same group. The next control in the tab order with Group set to True ends the first group of controls and starts the next group.

Type: Boolean.

Default:	True for Text controls.
	False for all other controls.


 Tabstop

Specifies that the user can move to this control with the TAB key.

Type: Boolean.

Default:	True for Check Box, Combo Box, Edit Box, List Box, and Pushbutton controls.
	False for Group Box, Picture, Radio Button, Scroll Bar, and Text controls.


 Default Button

If True, the control is the default button in the dialog box. The default button is selected (drawn with a heavy black border) when the dialog box first appears and is executed if the user presses ENTER without choosing another command in the dialog box. Windows allows only one default button in a dialog box.

Type: Boolean.

Default: False.


Owner Draw (Pushbutton Properties)
 Owner Draw

Creates an owner-draw button. Use an owner-draw button when you need to customize the appearance of a control by providing your own OnDrawItem message handler in the owner-window procedure (usually a dialog-box procedure or class derived from the Microsoft Foundation classes (CDialog or CFormView). You can also derive your own class from CButton and override CButton::DrawItem. See CWnd::OnDrawItem and CButton::OnDraw in the Class Library Reference for more information.

This property must be set to define a bitmap button in a dialog box using the CBitmapButton class.

Type: Boolean.

Default: False.


Radio Button Properties: General

ID	Group
Caption	Tabstop
Visible	Auto
Disabled	Left Text


Auto (Radio Button Properties)
 Auto

When the user selects a radio button with this property, the radio button is automatically selected, and any other radio buttons in the same group are cleared (deselected). You must set this property to True if you are using a group of radio buttons with Dialog Data Exchange.

Type: Bool.

Default: True.


Left Text (Radio Button Properties)
 Left Text

Places the radio button's caption text on the left rather than on the right.

Type: Bool.

Default: False.


Check Box Properties: General
Dialog: Check Box Properties

ID	Tabstop
Caption	Auto
Visible	Left Text
Disabled	Tri-State
Group


Disabled (controls)
 Disabled

Determines if the resource is displayed as disabled when the dialog box is created.

Type: Bool.

Default: False.


 Tri-State

Creates a three-state check box. A three-state check box can be grayed as well as checked or not checked. A grayed check box indicates that the state represented by the control is undetermined.

Type: Bool.

Default: False.


Auto (Check Box Properties)
 Auto

Creates a check box that, when selected, automatically toggles between checked and unchecked states. You must set this property to True if you are using a group of check boxes with Dialog Data Exchange.

Type: Bool.

Default: True.


Left Text (Check Box Properties)
 Left Text

Positions the check box's caption text to the left instead of to the right.

Type: Bool.

Default: False.


Edit Properties: General

ID	Group
Visible	Tabstop
Disabled

  Edit Properties: Styles


Edit Properties: Style
Edit Properties: Styles

Align Text	No Hide Sel
Multiline	OEM Convert
Horiz. Scroll	Want Return
Auto HScroll	Border
Vert. Scroll	Uppercase
Auto VScroll	Lowercase
Password	Read Only

  Edit Box Properties: General


 Want Return

Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit-box control in a dialog box. If this style is not specified, pressing the ENTER key has the same effect as pressing the dialog box's default pushbutton. This style has no effect on a single-line edit-box control.

Type: Bool.

Default: False.


 Read Only

Prevents the user from typing or editing text in the edit box.

Type: Bool.

Default: False.


 Align Text

Text aligns left, centered, or right. In a multiline edit box, text is always aligned left.

Default: Left.


Horiz. Scroll (Edit Properties: Styles)
 Horiz. Scroll

Provides a horizontal scroll bar for a multiline control.

Type: Bool.

Default: False.


 Auto HScroll

Automatically scrolls text to the right when the user types a character at the end of the line.

Type: Bool.

Default: True for edit controls; False for combo boxes.


Vert. Scroll (Edit and Combo Box Properties: Styles)
 Vert. Scroll

Provides a vertical scroll bar for a multiline edit-box control.

Type: Bool.

Default: False.


 Auto VScroll

In a multiline control, automatically scrolls text up one line when the user presses ENTER on the last line.

Type: Bool.

Default: False.


 Password

Displays all characters as an asterisk (*) as they are typed into the edit-box control. Not available in multiline controls.

Type: Bool.

Default: False.


 No Hide Sel

Changes the way text is displayed when an edit box loses and regains focus. Normally, existing text in an edit box is hidden when the control loses focus and is displayed as inverted text when the control regains focus. If NoHideSel is set to True, selected text in a edit box is displayed as selected at all times.

Type: Bool.

Default: False.


 OEM Convert

Converts text entered in the edit-box control from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the AnsiToOem function to convert a Windows string in the edit-box control to OEM characters. This style is most useful for edit-box controls that contain filenames.

Type: Bool.

Default: False.


 Multiline

Creates a multiline edit-box control.

When the multiline edit-box control is in a dialog box, the default response to pressing the ENTER key is to activate the default button.

If AutoHScroll is selected, the multiline edit-box control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press ENTER. If AutoHScroll is not selected, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses ENTER providing the Want Return property is set. The position of the wordwrap is determined by the window size. If the window size changes, the wordwrap position changes and the text is redisplayed.

Multiline edit-box controls can have scroll bars. An edit-box control with scroll bars processes its own scroll-bar messages. Edit-box controls without scroll bars scroll as described in the previous paragraphs. They also process any scroll messages sent by the parent window.

Type: Bool.

Default: False.


Border (Edit Properties: Styles)
 Border

Creates a border around the edit box.

Type: Bool.

Default: True.


 Uppercase

Converts all characters to uppercase as they are typed into the edit box.

Type: Bool.

Default: False.


 Lowercase

Converts all characters to lowercase as they are typed into the edit box.

Type: Bool.

 Default: False.


List Box Properties: General

ID	Group
Visible	Tabstop
Disabled

 List Box Properties: Styles


List Box Properties: Styles

Selection	Horiz. Scroll
Owner Draw	Vert. Scroll
Has Strings	No Redraw
Border	Use Tabstops
Sort	Want Key Input
Notify	Multicolumn
No Integral Height	Disable No Scroll

  List Box Properties: General


 Disable No Scroll

Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.

Type: Bool.

Default: False.


 Selection

Determines how items in a list box can be selected. Possible values are as follows:

Single (default)	Only one item in a list box can be selected at a time.
Multiple	More than one list-box item can be selected, but the SHIFT and CTRL keys have no effect. Clicking or double-clicking an unselected item selects it. Clicking or double-clicking a selected item deselects it.
Extended	The SHIFT and CTRL keys can be used together with the mouse to select and deselect list-box items, select groups of items, and select nonadjacent items.


Owner Draw (Combo Box and List Box Properties: Styles)
 Owner Draw

Controls the owner-draw characteristics of the list box. Can be one of the following values:

No (default)	Turns off the owner-draw style.  The list box contains strings.
Fixed	Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are the same height.  CWnd::OnMeasureItem is called when the list box is created, and CWnd::OnDrawItem is called when a visual aspect of the list box has changed.
Variable	Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height.  CWnd::OnMeasureItem is called for each item in the list when the list box is created and CWnd::OnDrawItem is called when a visual aspect of the list box has changed.


Has Strings

Specifies that an owner-draw list box contains items consisting of strings. The list box maintains the memory and pointers for the strings so the application can use the LB_GETTEXT message to retrieve the text for a particular item. By default, all list boxes except owner-draw list boxes have this style. An application can create an owner-draw list box either with or without this style.

This style is only available if the Owner Draw property is set to either Fixed or Variable. If Owner Draw is set to No, the list box contains strings by default.

Type: Bool.

Default: True.


Border (List Box Properties: Style)
 Border

Creates a list box with a border.

Type: Bool.

Default: True.


 Sort

Sorts the contents of the list box alphabetically.

Type: Bool.

Default: True.


 Notify

Notifies the parent window if a list item has been clicked or double-clicked.

Type: Bool.

Default: True.


Horiz. Scroll (List Box Properties: Styles)
 Horiz. Scroll

Creates a list box with a horizontal scroll bar.

Type: Bool.

Default: False.


Vert. Scroll (List Box Properties: Styles)
 Vert. Scroll

Creates a list box with a vertical scroll bar.

Type: Bool.

Default: True.


 No Redraw

Specifies that the list box's appearance is not updated when changes are made. This style can be changed at any time by sending a WM_SETREDRAW message or by calling CWnd::SetRedraw.

Type: Bool.

Default: False.


 Use Tabstops

Allows a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog box units.

Type: Bool.

Default: False.


 Want Key Input

Specifies that the owner of the list box receives WM_VKEYTOITEM or WM_CHARTOITEM messages whenever the user presses a key and the list box has the input focus. This allows an application to perform special processing on the keyboard input. If a list box uses the Has Strings style, the list box receives WM_VKEYTOITEM messages. If a list box does not use the Has Strings style, it receives WM_CHARTOITEM messages.

Type: Bool.

Default: False.


 No Integral Height

Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, Windows sizes a list box so that the list box does not display partial items.

Type: Bool.

Default: True for list boxes; False for combo boxes.


 Multicolumn

Specifies a multicolumn list box that is scrolled horizontally. The LB_SETCOLUMNWIDTH message sets the width of the columns.

Type: Bool.

Default: False.


Combo Box Properties: General

ID	Group
Visible	Tabstop
Disabled	Caption
Enter list choices

  Combo Box Properties: Styles


 Enter List Choices

Contains the choices you want to appear in the combo box when the dialog is created. Press CTRL+ENTER at the end of each item in the list to move to the next line. This property is only available in resource files with Microsoft Foundation Class Library support.


Combo Box Properties: Styles

Type	OEM Convert
Owner Draw	Auto HScroll
Has Strings	Vert. Scroll
Sort	Disable No Scroll
No Integral Height

  Combo Box Properties: General


Vert. Scroll (Combo Box Properties: Styles)
Vert. Scroll

Creates a combo box with a vertical scroll bar.

Type: Bool.

Default: True.


Type (Combo Box Properties: Styles)
Type

Specifies the type of combo box. Can have one of the following values :

Simple	Creates a simple combo box that combines an edit-box control with a list control. The list is displayed at all times, and the current selection in the list is displayed in the edit-box control
Dropdown (Default)	Creates a drop-down combo box. Same as a simple combo box, except the list is not displayed unless the user clicks a drop-down arrow at the right of the edit-box control portion of the combo box.
Drop List	Similar to the drop-down style, but the edit-box control is replaced by a static-text item that displays the current selection in the list.


Text Properties: General

ID	Disabled
Caption	Group
Visible	Tabstop
No Prefix	Simple
No Wrap	Text Align


 No Prefix

Prevents ampersands (&) in the control's text from being interpreted as the mnemonic character. Normally a string containing an ampersand is displayed with the ampersand removed and the next character in the string underlined. The No Prefix style is most often used when filenames or other strings that may contain an ampersand need to be displayed.

Type: Bool

Default: False


 No Wrap

Displays text left-aligned. Tabs are expanded but words are not wrapped. Text that extends past the end of a line is clipped.

Type: Bool.

Default: False.


 Simple

Disables No Wrap and Text Align. Text in static text controls with this property set does not wrap and is not clipped. In addition, setting this property means that overriding WM_CTLCOLOR in the parent window has no effect on the control.

Type: Bool.

Default: False.


Text Align

Controls how text is aligned in the static-text control. Possible values are Left, Center, and Right. Set to Left when No Wrap is selected.

Default: Left.


Picture Properties: General

ID	Tabstop
Visible	Type
Disabled	Color
Group	Icon


Type (Picture Properties)
Type

Sets the type of static graphic to display. One of the following:

Frame (Default)	Displays a frame. You set the color of the frame in the Color box. Use a frame to visually group controls.
Icon	Displays an icon in the dialog box. Use the Icon box to specify the identifier of the icon you want to display.
Rectangle	Displays a filled-in rectangle. You set the color of the rectangle in the Color box.


 Icon

Sets the resource identifier of the icon to be displayed.


 Color

Sets the color of a frame or rectangle to black, white, or gray. This property is not available when the picture type is an icon.

Default: Black.


Group Box Properties: General

ID	Disabled
Caption	Group
Visible	Tabstop


Scrollbar Properties: General

ID	Group
Visible	Tabstop
Disabled	Align


Align

One of the following values:

None (Default)	No special alignment is performed. The size of the scroll bar is the size specified in App Studio.
Top/Left	Aligns the upper-left corner of the scroll bar with the upper-left corner of the containing window specified in App Studio.
Bottom/Right	Aligns the lower-right corner of the scroll bar with the lower-right corner of the containing window specified in App Studio.


User Control Properties: General

ID	Group
Caption	Tabstop
Visible	Class
Disabled	Style


 Class

The name of the control's Windows class. The class must be registered before the dialog box containing the control is created.


Style (User Control Properties)
 Style

A 32-bit hexadecimal value specifying the control's style, primarily used to edit the lower 16 bits that make up a user control's sub-style.


Accel Table: Accel Properties: General

ID	Type
Key	Next Key Typed
Modifiers


 Key

The accelerator key. Can be one of the following (see Typing In Accelerator Values for more information):

Integer	Range 0 to 255. Interpreted as ASCII or virtual-key value, depending on the Type property. Single digits are interpreted as a key value. To enter an ASCII value from 0 to 9, precede the number with two zeros (for example, 006).
Character	Single character optionally preceded by a caret (^) to signify a control character.
Virtual key identifier	Any one of the virtual-key identifiers in the drop-down list.


Modifiers

Indicate whether the accelerator is a combination formed with Ctrl, Alt, or Shift. When the key is an ASCII key, Ctrl and Shift are not available.

Type: Bool.

Defaults: Ctrl is True, Alt and Shift are False.


Type (Accel Properties)
 Type

Specifies whether the Key property is an ASCII value or a virtual key (VirtKey) value.


Next Key Typed

When you choose this command, the next key combination typed changes the Key and Modifiers values appropriately. The key is interpreted as a virtual key if possible.


String Properties: General

ID	Caption


Caption (String Properties)
Caption

A string of up to 255 bytes (single characters, escape sequences, or ASCII values). For more information about entering escape sequences and ASCII values as part of the string, see Editing a String's Properties.

Type: Text.


Icon Properties: General

ID	Filename
The following properties are displayed only and cannot be modified on the property page:

Width	Colors
Height


Width (Icons and Cursors)
Width

Image width in pixels. This property is determined by the currently selected target-device definition.


Height (Icons and Cursors)
Height

Image height in pixels. This property is determined by the currently selected target-device definition.


Colors (Icon Properties)
Colors

Monochrome (2) or 16. This property is determined by the currently selected target-device definition.


Cursor Properties: General

ID	Filename
The following properties are displayed only and cannot be modified on the property page:

Width	Hotspot
Height


Hotspot

Location of the cursor's active area. In pixels, relative to the upper left corner (0,0). Set with the Set Hotspot command on the Image menu.


Bitmap Properties: General

ID	Height
Filename	Colors
Width	Save Compressed


Width (Bitmap Properties)
Width

Image width in pixels.

Type: Integer.

Default: 48.


Height (Bitmap Properties)
 Height

Image height in pixels.

Type: Integer.

Default: 48.


Colors (Bitmap Properties)
Colors

Monochrome (2) or 16. The default number of colors in a bitmap is determined by the current display device.


Save Compressed

Saves the image in compressed format to save space; useful for large bitmaps. Only color bitmaps can be compressed.

Type: Bool.

Default: False.


Menu Properties: General

ID


Menu Item Properties: General

ID	Grayed
Caption	Inactive
Separator	Help
Checked	Break
Popup	Prompt


Caption (Menu Items Properties)
Caption

The text that appears as part of the menu item to label it. To make one of the letters in the caption of a menu item the mnemonic key, precede it with an ampersand (&).


Popup

If True the menu item is a pop-up menu (a submenu).

Type: Bool.

Default: True for top-level menu items in a menu bar; otherwise False.


Separator

If True, the menu item is a separator.

Type: Bool.

Default: False.


Checked

If True, the menu item is initially checked.

Type: Bool.

Default: False.


Grayed

If True, the menu item is initially grayed and inactive.

Type: Bool.

Default: False.


Inactive

If the Grayed property is True, then the Inactive property is always True. Otherwise Inactive determines whether the menu item is initially inactive.

Type: Bool.

Default: False.


Break

Can be one of these values:

None (Default)	No break.
Column	For static menu-bar items, places the item on a new line. For pop-up menus, places the item in a new column with no dividing line between the columns. Setting this property affects the appearance of the menu only at run time, not in the menu editor.
Bar	Same as Column except, for pop-up menus, separates the new column from the old column with a vertical line. Setting this property affects the appearance of the menu only at run time, not in the menu editor.


Help

Right-justifies the menu item in the menu bar at run time.

Type: Bool.

Default: False.


Prompt

Contains text to appear in the status bar when this menu item is highlighted. The text entered here is placed in the string table with the same identifier as the menu item. Available only in resource files with Microsoft Foundation Class Library support.


Title Bar

The bar across the top of a window that contains the window's name.

You can move the active window by dragging the title bar with the mouse.

You can also move a window by choosing Move from the Control menu of the window.

A dialog box can also be moved by dragging its title bar.


Maximize Button

Click the Maximize button with the mouse to enlarge a window to its maximum size.

A maximized window fills as much of the App Studio window as possible and has no borders.

You can maximize the App Studio window only if it does not fill the screen, or if it has been minimized to an icon.

Clicking the Maximize button has the same effect as choosing the Maximize command from the Control menu.

To restore a maximized window to its former size, click the Restore button or choose Restore from the Control menu.


Minimize Button

Click the Minimize button with the mouse to shrink the App Studio window to an icon.

As an icon, App Studio remains in memory but does not take up room on your desktop.

When you minimize the App Studio window, any open documents are minimized with it.

Clicking the Minimize button has the same effect as choosing the Minimize command from the Control menu.

To restore the App Studio window and any windows that were open when you minimized it, you can double-click the icon, or click the icon and choose Restore from the Control menu.


Restore Button

Click the Restore button with the mouse to return the active window to the size and position it had before you chose the Maximize command.


Window Sizing Border

The border around a window. You can drag a border with the mouse to change the window's shape and size.

Drag the top, bottom, or side border to size in one direction only.

Drag a corner of the border to size in two directions at once.

You can also size a window by using the Size command on the Control menu.


Status Bar

Displays information about the current activity or mode.

When a command is selected, the left side of the status bar briefly describes the command.

The left side of the status bar also indicates operations in progress.

The right side of the status bar shows whether keys such as CAPS LOCK or NUM LOCK are turned on.


menu bar (App Studio)
Menu Bar

The menu bar displays the App Studio menus. The following are always available: File menu, Edit menu, Resource menu, Window menu and Help menu. The Layout menu is available when the Dialog editor is active, and the Image menu is available when the Image editor is available.


File Menu

File	Shortcut key	Use to
New...	CTRL+N	Create a new resource script, resource file, bitmap, icon, or cursor. Opens the New dialog box.
Open...	CTRL+O	Open a resource script, resource, .EXE, .DLL, .DRV, bitmap, icon, or cursor file. Opens the Open dialog box.
Close		Close the active resource script, resource file, or bitmap, icon, or cursor file.
Save	CTRL+S	Save the active resource script, resource file, or bitmap, icon, or cursor file.
Save As...		Save and rename the active resource script, resource file, or bitmap, icon, or cursor file. Opens the Save As dialog box.
Save All		Save all the active resource scripts, resource files, or bitmap, icon, or cursor files.
Set Includes...		Set names of included header and resource files. Opens Set Includes dialog box.
Exit		Exit App Studio.


Edit Menu

Edit	Shortcut key	Use to
Undo	CTRL+Z	Undo an action.
Redo	CTRL+A	Redo the last undo.
Cut	CTRL+X	Delete to the Clipboard.
Copy	CTRL+C	Copy to the Clipboard.
Paste	CTRL+V	Paste from the Clipboard.
Delete/Clear	DEL	Delete selection or clear the graphic selection.
Symbols...	CTRL+I	View and change symbol names and values. Opens the Symbol Browser.
Find String...	ALT+F3	Search for text. Opens the Find String dialog box.
Find Next String	F3	Search for next occurrence of text.


Resource Menu

Resource	Shortcut key	Use to
New...	CTRL+R	Create a new resource. Opens the New Resource dialog box.
Open		Open an existing resource.
Open Binary Data	CTRL+B	Open a resource for binary editing.
Properties...	ALT+ ENTER	Change a resource's properties. Opens the appropriate property page for the resource.
Import...		Import a bitmap, cursor, or icon into your project. Opens the Import Resource dialog box.
Export		Export a bitmap, cursor, or icon and save it in a separate file. Opens the Export Resource dialog box.
ClassWizard...	CTRL+W	Connect user-interface objects to code.
Test	CTRL+T	Test a dialog box.
View as Popup	CTRL+U	View a menu resource as a pop-up menu.
New Device Image...	INS	Create new icon or cursor images. Opens the New Icon Image dialog box or the New Cursor dialog box.
Open Device Image...		View and edit an icon or cursor image for a device. Opens the Open Icon Image dialog box or the Open Cursor dialog box.
Delete Device Image		Delete an icon or cursor image for a device.
New String	INS	Add a string to a string table.
New Accelerator	INS	Add an accelerator to an accelerator table.


Layout Menu

Layout	Shortcut key	Use to
Align Controls		Align controls along one edge or center them on an axis.
Space Evenly		Equalize spacing between three or more aligned controls.
Center in Dialog		Center controls in a dialog box.
Arrange Buttons		Align buttons at right edge or bottom of dialog box.
Make Same Size		Equalize dimensions of selected controls.
Size to Content	F7	Size a control to fit its contents.
Grid Settings...		Set dimensions of layout grid. Opens the Grid Setting dialog box.
Set Tab Order	CTRL+D	Set order of TAB key movement among controls.


Image Menu

Image	Shortcut key	Use to
Zoom In/Out	M	Toggle between actual-size and magnified views.
Pickup Color	COMMA	Pick up color from a bitmap, icon, or cursor.
Set Hotspot		Set a cursor's hot spot.
Invert Colors		Invert colors in the selection.
Flip Vertical	Y	Flip the selection along its vertical axis.
Flip Horizontal	X	Flip the selection along its horizontal axis.
Edit Foreground Color...		Edit the current foreground color. Opens the Color dialog box.
Get Palette Colors...		Load colors from a file. Opens the Get Palette Colors dialog box.
Save Palette Colors...		Save colors to a file. Opens the Save Palette Colors dialog box.
Draw Opaque	O	Make background color opaque.
Grid Settings...		Show and hide pixel and tile grids; change grid dimensions. Opens the Grid Settings dialog box.


Help Menu

Help	Shortcut key	Use to
Contents	F1	Open the help system's Contents screen.
Search...		Search for a keyword in Help. Opens the search dialog box.
Product Support		Get information on product support.
About App Studio...		Get information about your copy of App Studio. Opens the About App Studio dialog box.


Window Menu

Window	Shortcut key	Use to
Cascade		Arrange windows in overlapping pattern.
Tile Horizontal		Arrange windows one above the other.
Tile Vertical		Arrange windows side-by-side.
Arrange Icons		Arrange icons along bottom of App Studio window.
Toolbar		Show or hide the toolbar.
Status Bar		Show or hide the status bar.
Hide/Show Palette	F2	Hide or show the graphics or control palette.
Show Properties	SHIFT+F2	Show or hide the Properties window.


Control Menu

Control	Shortcut key	Use to
Restore		Restore any App Studio window to its former size and location.
Move		Reposition any App Studio window or an open dialog box.
Size		Change the size of any App Studio window.
Minimize		Shrink an App Studio window to an icon.
Maximize		Enlarge an App Studio window to fill the available space.
Close	ALT+F4 CTRL+F4 (child windows)	Quit App Studio or close an active child window or an open dialog box.
Switch To...	CTRL+ESC	List all currently open applications and activates the one you select. Appears only on the main App Studio window.
Next		Switch to another child window. Appears only on the App Studio resource editor menus.


icon editor control bar (App Studio)
Icon Editing Control Bar

This toolbar appears at the top of an image editor window that contains an icon.


cursor toolbar (graphics editor)
Cursor Toolbar


Find String Dialog Box

Use the Find String dialog box to locate a string or a string's resource identifier in the string table. See Finding a String in the String Table.

Options

Find What	Match Case


Find What
Type the string you want to find.


Match Case
Select to find a string that exactly matches the case of what you typed.


Layout Grid Settings dialog box
Layout Grid Settings Box

Use the Grid Settings dialog box to:

Turn Snap to Grid on or off for all dialog box editor windows

Change the size of the alignment grid cells

Options

Snap to Grid	Width
Height
Tips and Troubleshooting

The Snap to Grid option in the Grid Settings dialog box controls the alignment grid for all open editor windows. You also turn Snap to Grid on or off for an individual dialog box editor window by using the Snap to Grid button [image] on the dialog editor toolbar.


Snap to Grid
Use this option to turn the alignment grid on or off for all dialog editor windows.


Width
Enter the width in DLUs for the alignment grid. Minimum width is 4.


Height
Enter the height in DLUs for the alignment grid. Minimum height is 4.


Set Includes Dialog Box

Use the Set Includes dialog box to

Change the name of the symbols header file.

Include files containing shared (read-only) or calculated symbols.

Include files containing resources that are added to your project at compile time.

See Changing the Name of the Symbols Header File, Using Shared (Read-Only) or Caluculated Symbols, or Including Resources from Other Files.

Options

Symbol Header File	Read-Only Symbol Directives
Compile-Time Directives
Tips and Troubleshooting

What you type in the Read-Only Symbol Directives box or the Compile-Time directives box is included in the resource file exactly as you type it. Make sure what you type does not contain any spelling or syntax errors.


Symbol Header File
Type the name you want App Studio to use for your current project's symbols file.


Read-Only Symbol Directives
Use this box to include .H files containing shared (read-only) or calculated symbols.


Compile-Time Directives
Use this box to include resource files that are added to your project at compile time.


About App Studio Dialog Box

The App Studio About Box diplays the App Studio version number, a copyright statement, and the name and organization of the person licensed to use the software.

Also displayed are the amount of available memory, whether or not a coprocessor is present, and the amount of disk space on the current drive.


Next Key Typed Dialog Box

Use the Next Key Typed dialog box to cancel the Accelerator Table property page's Next Key Typed command.

If you do not choose Cancel, the next key combination you type will be used to update the current accelerator table definition. Changes are made to the Key box and the options under Modifier and Type as appropriate.

Accelerator values entered using the Next Key Typed command are entered as virtual keys if possible.

See Accelerator Table Editor Topics.


New Resource Dialog Box

Use the New Resource dialog box to choose the type of resource you want to create.

Select the resource you want in the Resource Type box and choose OK.


New Symbol or Change Symbol Dialog Box

Use the New Symbol dialog box to define the name and, if necessary, a value for a new symbolic resource identifier. This same dialog box appears when you ask to change the name or value of an unassigned symbol.

See Symbol Editor Topics.

Options

Name	Value
Tips and Troubleshooting

To change the name or value of a symbol that is already assigned to a resource, use the ID box on the resource's general property page. Choose a symbol name from the list, or type the symbol name followed by an equals sign and a new symbol value.


Change Symbol Name
The name of the symbol you are defining or changing. See Symbol Name Restrictions.


Change Symbol Value
The value of the symbol. When defining a new symbol, you normally accept the value automatically supplied by App Studio. See Symbol Value Restrictions.


Symbol Browser Dialog Box

Use the Symbol Browser dialog box to

Examine the symbols in your current resource file: their names,  their values, and whether or not they are in use.

Add or change symbols.

Move to the appropriate editor for the resource that uses the symbol.

See Symbol Editor Topics.

Options

Name	Value
In Use	Show Read Only Symbols
Used by


Symbol Name
The name of the symbol.


Symbol Value
The symbol's numeric value.


Symbol In Use
A check mark in this column indicates that the symbol is being used by one or more resources. The resource or resources are listed in the Used by box.


Show Read-Only Symbols
Normally the Symbol Browser displays only the  modifiable resources in your resource script file. Select this option to display read-only resources as well. Modifiable resources display as bold text; read-only resources display as normal text.


Symbol Used by
Shows the resource or resources using the symbol selected in the symbols list. To move to the editor for a given resource, select the resource in the Used by box and choose View Use.


Image dialog boxes
Icon or Cursor Image

Use the New Icon Image or New Cursor Image dialog box to add a new device image to the list of devices available in the image editor.

Use the Open Icon Image or Open Cursor Image dialog box to change the device definition currently being used by the image editor.

Device images are defined in the Registry.

See Creating, Selecting, and Deleting Images.


Image Grid Settings Dialog Box

Use the image editor's Grid Settings dialog box to

Hide or display the image editor pixel grid

Turn on the tile grid and adjust the dimensions of each tile if necessary

See Displaying and Hiding Pixel Grids.

Options

Pixel Grid	Tile Grid
Width	Height
Tips and Troubleshooting

In order to display the pixel grid, the image editor pane must have a magnification factor of 4 or greater. See Changing the Magnification Factor.

When the tile grid is displayed, the behavior of the image editor changes in ways that make it easy to edit toolbar button bitmaps. See Editing Toolbar Bitmaps.

The tile grid cannot be displayed unless the pixel grid is turned on.


Pixel Grid
Select this option to display grid lines along pixel boundaries in all open image editor windows.


Tile Grid
Select this option to display a tile grid in the image editor. A tile grid, normally 16 pixels wide by 15 pixels tall, provides a visual reference for the easy editing of toolbar bitmaps.


Tile Grid Height
The width in pixels of the tile grid.


Tile Grid Width
The height in pixels of the tile grid.


File Open dialog box
Open Dialog Box

Use the Open dialog box to open a resource script file (.RC),  bitmap (.BMP), cursor (.CUR), or icon (.ICO) file for stand-alone editing.

Options

File Name	Drives
Directories	List Files of Type
Tips and Troubleshooting

You can double-click a filename in the list box to open the file.

You can select a file type from the List Files of Type box to display a list of all files with a predetermined type from the current drive and directory.

If you type a pattern using a wildcard (* or ?) in the File Name box and press ENTER, the list box displays files matching that pattern. This file type subsequently appears as the default when you open this dialog box again.


File Name
Enter the name of a file to open. If you type a pattern using a wildcard (* or ?) and press ENTER, the list box displays files matching that pattern.


Directories
Double-click a directory entry to display files from that directory in the Files box.


Drives
Click the arrow to display a list of all attached drives. Click a drive from that list to display directories and filenames from the selected drive.


Files of Type
Click the arrow to display a list of file types. The filename extension determines the file type. Click a file type to display a list of all files of that type from the current drive and directory in the File Name box.


Save As Dialog Box

Use the Save As dialog box to save the current file to a different filename, a different file format, or both. See Working with Resources and Files.

Options

File Name	Drives
Directories	Save Files as Type
Tips and Troubleshooting

Typing a filename with a file extension automatically saves the file in the format associated with the file extension.

The list of types in the Save File as Type box varies depending on the type of the active file.

If you type a pattern using a wildcard (* or ?) in the File Name box and press ENTER, the list box displays files matching that pattern.


File Name
Enter the name of the file to save. If you type a filename without an extension, it is saved with the default file extension, and as the default file type, indicated in the Save File as Type box.


Files of Type
Click the arrow to display a list of file types. The filename extension determines the file type. Click a file type to display a list of all files of that type from the current drive and directory in the File Name box.


Import Resource Dialog Box

Use the Import Resource dialog box to add a bitmap, icon, or cursor to the current resource file.

Options

File Name	Drives
Directories	List Files of Type
Tips and Troubleshooting

You can double-click a filename in the list box to import the resource.

You can select a file type from the List Files of Type box to display a list of all files with a predetermined type from the current drive and directory.

If you type a pattern using a wildcard (* or ?) in the File Name box and press ENTER, the list box displays files matching that pattern.


Import Resource File Name
Enter the name of a bitmap, icon, or cursor file to import. If you type a pattern using a wildcard (* or ?) and press ENTER, the list box displays files matching that pattern.


Export Resource Dialog Box

Use the Export Resource dialog box to save the currently selected bitmap, icon, or cursor as a separate file.

Options

File Name	Drives
Directories	List Files of Type
Tips and Troubleshooting

You can select a file type from the List Files of Type box to display a list of all files with a predetermined type from the current drive and directory.

If you type a pattern using a wildcard (* or ?) in the File Name box and press ENTER, the list box displays files matching that pattern.


Export Resource Filename
Enter the name of a bitmap, icon, or cursor file to export. If you type a filename without an extension, it is saved with the default file extension, and as the file type, indicated in the Save File as Type box.


Get Palette Colors Dialog Box

Use the Get Palette Colors dialog box to load a previously saved custom color palette into the App Studio image editor. See Creating Color Palettes.

Options

File Name	Drives
Directories	List Files of Type
Tips and Troubleshooting

Since the graphics editor has no way to restore the default color palette, save the default color palette under a name such as STANDARD.PAL or DEFAULT.PAL so that you can restore the defaults without having to quit and restart App Studio.


Get Palette Filenames
Enter the name of the color palette you want to load.


Save Palette Colors Dialog Box

Use the palette colors dialog box to save the current custom color palette as a .PAL file. See Saving and Loading Palettes.

Options

File Name	Drives
Directories	List Files of Type
Tips and Troubleshooting

Since the graphics editor has no way to restore the default color palette, save the default color palette under a name such as STANDARD.PAL or DEFAULT.PAL so that you can restore the defaults without having to quit and restart App Studio.


Save Palette Filename
Enter the name of the color palette (.PAL) file you want to use to store the current custom color palette.


New File Dialog Box

Use the New File dialog box to create a new App Studio file.

Options

File Type	Use Microsoft Foundation Classes
Tips and Troubleshooting

When you choose the Use Microsoft Foundation Classes option, the following features specific to the framework are available in App Studio:

ClassWizard

Menu prompt strings

List Contents for combo-box controls


File Type
The type of new file to create: resource script (.RC), compiled resource file (.RES), bitmap (.BMP), icon (.ICO), or cursor (.CUR).


File New Use MFC
Select this option to include Microsoft Foundation Class Library support in new resource script files.


Font Dialog Box

Use the Font dialog box to change the typeface and point size of the font in the dialog box you are editing.

Options

Font	Size
Sample
Tips and Troubleshooting

If you want to use a font that is not shown in the list of  fonts (for example, "Helv" for 3.0 compatibility), edit the RC file directly and change the FONT statement in the DIALOG section.


Font
Choose the name of the font you want from the list of installed fonts.


Font Size
Choose the point size for the dialog box font.


Font Sample
The Sample box displays a sample of the font and size you have chosen.


Color Dialog Box

Use the Color dialog box to change the current image editor foreground or background color. The color you choose replaces the current color on the image editor graphics palette.

You can also use the Color dialog box to create a custom color and add it to the Custom Colors palette. Choose Define Custom colors, and create a color by adjusting its hue, saturation, and luminosity or by specifying its red, green, and blue values.

See Creating Color Palettes.

Options

Basic Colors	Custom Colors
When you choose Define Custom Colors, the following additional options are available:

Color Refiner Box	Luminosity Bar
Color/Solid Box	Hue, Sat, Lum
Red, Green, Blue
Tips and Troubleshooting

Custom color definitions are saved in the Registry and are automatically loaded the next time you start App Studio.


Basic Colors
The basic colors available for use in the image editor. The color you choose replaces the current color on the graphics palette.


Custom Colors
Custom colors available for use in the image editor. The color you choose replaces the current color on the graphics palette.


Color Refiner Box
The color refiner box shows all the nonsolid colors available on your system. Drag the color refiner cursor to the area of the box that shows the color you want.


Luminosity Bar
.

Drag the arrow up or down to adjust the luminosity of the color.


Color/Solid box
This box shows the changes you make to the hue, saturation, and luminosity of a color. As you make changes, the new nonsolid color is displayed on the left side of the box. The closest solid color is displayed on the right side of the box.


Hue, Sat, Lum
These boxes show the number values for the hue, saturation, and luminosity of the selected color.


Red Green Blue
These options show the red, green, and blue values of the selected color.


Test Dialog Box

When you are testing a dialog box in the App Studio dialog editor, you can:

Type in text, select from combo-box lists, turn options on and off, and choose commands.

Test the tab order.

Test the grouping of controls such as radio buttons or check boxes.

Test the dialog box's keyboard interface: controls that have mnemonic keys defined for them.

Connections to dialog-box code made using ClassWizard are not simulated during dialog-box test mode.

Icons in a dialog box are displayed as the App Studio icon symbol during test mode.

When you test a dialog box, it is usually displayed at a location relative to the main App Studio program window. If the dialog box's Absolute Align property is selected, the dialog box is displayed at a position relative to the upper-left corner of the screen.


Change In-Use Symbol Dialog Box

Use the Change Symbol dialog box to change the name or value of an in-use symbol.

Note: to change a symbol that is in use in more than one place, exit App Studio and use the Visual Workbench editor to edit the symbol header file directly.

Select the symbol you want to change and choose View Use. App Studio places you in the ID box of the resource's property page.

You can also bypass the Change Symbol dialog box and change a symbol by moving directly to the resource's property page.

To change the name of a symbol, type the new name or select a symbol name from the list.

In most cases you can let App Studio take care of assigning the symbol value for you. However, if you need to change the value of an in-use symbol, use the ID box on the resource's property page to enter a new value. Type the symbol name followed by an equals sign and the new symbol value. For example,

IDC_RADIO1=2551


Help in Brief

  Using Context-Sensitive Help

  Commands on the Help Menu

  Help on Dialog Boxes

  Help on Property Pages


Using Context-Sensitive Help

  To obtain context-sensitive help:

1.	Click the context-sensitive help button

- Or -

Press SHIFT+F1.

The cursor changes to a question mark with an arrow.

2.	Click on the area of the screen for which you'd like help.

Help opens to the appropriate topic.


Commands on the Help Menu

Command	Description
How to Use Help	This opens a second Help window which explains how to use Help.
Always on Top	With this toggle active, App Studio Help will stay on top of all windows even when you're working in a different window.
Copyright	This opens a window containing the copyright notice for App Studio Help.
About Help	This command opens the About box for the product. It contains the version number of the product, which is useful when you are seeking technical support. It also contains information about your system.


Help on Dialog Boxes

To get help on an open dialog, click the Help button or press F1. Help describes the purpose of the dialog box and provides specific information for each of the controls - list boxes, check boxes, edit boxes, option buttons, and so on - in the dialog.

In some cases, help for the dialog box also contains troubleshooting information and tips on using the dialog box.


Help on Property Pages

To get help on an open property page, click the Help button or press F1. Help describes each property on the page, giving defaults and variable types where appropriate.


Using App Studio for Winodws NT
Using App Studio for Windows NT

Because Visual Basic does not support 32-bit programming, App Studio for Windows NT does not support VBX controls.

App Studio for Windows NT cannot load or save executable (.EXE) files, Dynamic-Link Libraries, or compiled resource script (.RES) files that were created with Windows NT.

App Studio for Windows NT does not support resources or resource objects specific to Windows NT, such as the PUSHBOX control. To use Windows NT-specific resources from within App Studio, include them in your resource file as read-only (compile-time) resources. For information on how to use the Set Includes dialog box to add compile-time resources to your application, see Including Resources From Other Files.

For specifics on programming with the Microsoft Foundation Class Library for Windows NT, see Microsoft Foundation Class Library Update in the Class Library Reference.


Using Search Plus

Search Plus provides a way to search the full text of help files. You can search for a single word, a combination of words in a topic, one word near another word, an exact phrase, and so on.

  To search for a word or phrase:

1.	If the help file is not already open, open it using WINHLP32.

2.	Click Search Plus on the button bar.

3.	Enter the word or words that you want to find in the Search dialog box.

If you want to enter groups of words, or exclude words, and so on, click the Hints button. This displays the Search Hints dialog box. It describes the use of keywords to combine words, the use of quoting and grouping operators, and the use of a wildcard for expanding a root word.

You can also set the range used for the keyword NEAR. It determines how many other words can separate two words for which you are searching.

4.	In the Look At group box, select either the Topic Titles Only or the All Text option button.

5.	In the Look In group box, select the help files in which you want to search for the desired topic.

6.	Click the Search button.

The titles of topics found are displayed in the Topics Found list.

7.	Double-click the desired topic in the Topics Found list. Each entry in the topic displayed is highlighted.

Topics in the current help file have no label before the topic title. Topics in other help files in the group are preceded by a label. These labels change as you switch from one help file to another.

You can also use the Go To, Next and Previous buttons to display topics.

Tips and Troubleshooting

Using Search Keywords

The keywords AND, OR, and NOT operate only on a topic level. The following Search For string finds any topic that contains both words:

menu AND command

The order of words in the Search For string does not matter. The following Search For strings produce identical results:

menu AND command

and

command AND menu

The search mechanism ignores letter case. The same results appear if you search for cobject or COBJECT.

You cannot search for the Search keywords, such as NOT, for instance.

Exclusion from Searches

You can search for alphanumeric characters only. Characters such as ~ [tilde], # [number sign], \ [backslash] and ( [left parenthesis] are excluded from the search.

Some words are excluded from the full-text search capability in order to build a smaller search index file. The excluded words are not usually helpful for finding information in this kind of material, such as "because," for instance.

This exclusion has a side-effect with the NEAR keyword, because excluded words are essentially invisible to the search mechanism, even though they are visible to you on the topic page. For instance, if you set NEAR to 1 and search for:

menus NEAR commands

the search would find "commands because the menus" in the sentence "It may not display all the listed commands because the menus are dynamic," since both "because" and "the" are excluded from the search index.

Narrowing Your Search

If you find a very large number of topics with your search, you can narrow your search in four ways:

Exclude help files in the Look In group from the search list by clearing the check box for the help file.

Use the keywords (AND, OR and NOT) and the grouping operators listed in the Search Hints dialog box to create likely combinations of words.

Use the "" quoting operators to search for an exact phrase.

Use the NEAR keyword with combinations of words to find only those that are close together in a topic.

Recovering from Errors

If you get an error message that refers to an old or missing index file, one of two things may have happened:

The .IND index file may have accidentally been deleted or moved to a directory other than that containing the help files. In this case, reinstall the help files using Setup.

The VIEWER.INI file may have been deleted or corrupted. In this case, simply close the help file, open it again and try again.

If you get an error message that refers to a title setup problem, when you click the OK button, the Help file will close. In this case, open the help file again and continue.