Syntax
[WINDOWS]
window-name="caption", (x-coord, y-coord, width, height), window-state,
(scrolling-RGB), (nonscrolling-RGB), ontop-state
.
.
.
The [WINDOWS] section defines the size, location, and colors for the primary Help window and any secondary window types used in a Help file. You can define as many as five secondary window types.
Parameters
window-name
Specifies the name of the window that uses the defined attributes. For the primary Help window, this parameter is main. For a secondary window, this parameter may be any unique name (other than main) with as many as eight characters. Any jumps that display a topic in a secondary window give this window name as part of the jump.
caption
Specifies the text that appears in the title bar of the window. The caption can have as many as 50 characters. If no caption is specified, Windows Help is displayed. Generally, to set the caption of the main window, you use the TITLE option in the [OPTIONS] section of the Help project file. If the caption specified here differs from the TITLE option, the [WINDOWS] caption determines the title displayed in the title bar.
x-coord
Specifies the x-coordinate, in Help units, of the window’s upper-left corner. The horizontal position is defined in terms of Windows Help’s 0–1023 coordinate system. (Help always assumes the screen is 1024 units wide, regardless of resolution. For information about how to determine actual coordinates for different video resolutions, see the “Comments” section.) The x-coordinate is relative to the upper-left corner of the screen, which is 0,0.
y-coord
Specifies the y-coordinate, in Help units, of the window’s upper-left corner. The vertical position is defined in terms of Help’s 0–1023 coordinate system. (Help always assumes the screen is 1024 units wide, regardless of resolution. For information about how to determine actual coordinates for different video resolutions, see the “Comments” section.) The y-coordinate is relative to the upper-left corner of the screen, which is 0,0.
width
Specifies the window’s default width in Help’s 0–1023 coordinate system.
height
Specifies the window’s default height in Help’s 0–1023 coordinate system.
window-state
Specifies how the window is sized when Windows Help first opens it. This parameter can be one of the following values.
Value | Meaning |
0 | Size the window according to the values specified in the x-coord, y-coord, width, and height parameters. The default is 0 or normal size. |
1 | Maximize the window, and ignore the x-coord, y-coord, width, height, and ontop-state parameters given in the type definition. |
scrolling-RGB
Specifies the background color for the window’s scrolling region. Colors are given as standard RGB values—where RRR, GGG, and BBB are three-digit numbers in the range 0 to 255 representing the red, green, and blue components of the color. If this parameter is not given, Help uses the default Windows system color specified by the end-user in Control Panel.
nonscrolling-RGB
Specifies the background color for the window’s nonscrolling region (if any). Colors are given as standard RGB values—where RRR, GGG, and BBB are three-digit numbers in the range 0 to 255 representing the red, green, and blue components of the color. If this parameter is not given, Help uses the default Windows system color specified by the end-user in Control Panel.
ontop-state
Specifies whether a secondary window type stays on top of other windows. The main Help window cannot be authored as a topmost window. This parameter can be one of the following values.
Value | Meaning |
0 | Display the window normally, not on top of other windows. The default is 0 or normal behavior. |
1 | Display the window on top of other windows. If this value is given, the user cannot change the window behavior using the Always On Top command in Help. |
Comments
Window attributes defined in the [WINDOWS] section follow these rules:
nA single comma may be substituted for an entry or a group of entries enclosed by parentheses. Preceding commas are required if you want to use the default settings. Trailing commas are optional. (See the “main” example below.)
nWindows attributes are set for the Help windows whenever a file containing predefined attributes is opened.
nIf a user performs an operation, such as an interfile jump, that opens a file with predefined window attributes, the Help windows will adjust to the new settings,— change size or location, for example.
nWhen an application requests Help using the WinHelp function, Help uses the values defined in the [WINDOWS] section to determine window attributes. If the Help file does not include settings in the Help project file, Help uses the default settings.
nWhen Help is closed, the window settings are updated in the [Windows Help] section of the WIN.INI file.
The Help coordinate system ranges from 0 through 1023 in both directions, so the vertical position plus the height must be less than or equal to 1023. Similarly, the horizontal position plus the width must be less than or equal to 1023. This 1024-by-1024 coordinate system is mapped to the horizontal and vertical resolutions of the video card. To convert from pixels to Windows Help coordinates, you invert the ratio between Help’s resolution and the video resolution. Assuming the video card resolution is horiz by vert pixels, and the horizontal and vertical locations (or dimensions) you want are in pixels, the x-coordinate (or width), in Help coordinates, is as follows:
x-coord = pixel location * (1024/horiz)
width = number of pixels * (1024/horiz)
The y-coordinate (or height), in Help coordinates, is:
y-coord = pixel location* (1024/vert)
height = number of pixels * (1024/horiz)
For example, if you want the window’s upper-left corner to appear at horizontal pixel 320 and at vertical pixel 120, and the Help file is being displayed on a standard VGA monitor with 640 by 480 resolution, the x-coord is (320 * (1024/640)) = 512, and y-coord is (120 * (1024/480)) = 256.
Example
The following example defines two windows, the main Help window and a secondary window named “picture.” The main window definition sets the background color to magenta (128, 0, 128) and leaves the other values empty (for which Help will supply its default values). The secondary window definition sets the caption to Samples, positions it in the upper-left part of the screen (123, 123), and sets the window’s width and height to about one-quarter of the screen’s width and height (256). The window will not be maximized (0). The window’s background colors are set to cyan (0, 255, 255) for the scrolling region and light gray (192, 192, 192) for the nonscrolling region. The secondary window will appear on top of other windows when it is open (1).
[WINDOWS]
main=, , , (128, 0, 128)
picture="Samples", (123, 123, 256, 256), 0, (0, 255, 255), (192, 192, 192), 1
See Also
[OPTIONS] Section, TITLE Option