$ Macros
# macros
K Help Macros;Macros
@ Help Macros

The following macros are accepted by WinHelp:

{\b About( )}
>Displays the About dialog box 
{\b AddAccelerator(}{\i key, shift state, "macro"} {\b )}
>Assigns a macro to an accelerator key 
{\b Annotate( )}
>Displays Annotation dialog box 
{\b AppendItem(}{\i _"menu-id"_[ menuid ], "item-id", "item-name", "macro"} {\b )}
>Appends a menu item 
{\b Back( )}
>Displays previous topic in the history list 
{\b BookmarkDefine( )}
>Displays the Define dialog box 
{\b BookmarkMore( )}
>Displays the More dialog box 
{\b BrowseButtons( )}
>Adds browse buttons 
{\b ChangeButtonBinding(}{\i "button-id", "button-macro"} {\b )}
>Assigns a macro to a button
{\b ChangeItemBinding(}{\i "item-id", "item-macro"} {\b )}
>Assigns a macro to a menu item
{\b CheckItem(}{\i "item-id"} {\b )}
>Checks a menu item
{\b CloseWindow(}{\i "window-name"} {\b )}
>Closes a window
{\b Contents( )}
>Displays the Contents topic 
{\b CopyDialog( )}
>Displays the Copy dialog box 
{\b CopyTopic( )}
>Copies current topic to the clipboard 
{\b CreateButton(}{\i "button-id", "name", "macro"} {\b )}
>Adds a new button to the button bar 
{\b DeleteItem(}{\i "item-id"} {\b )}
>Removes a menu item 
{\b DeleteMark(}{\i "marker-text"} {\b )}
>Deletes a text marker 
{\b DestroyButton(}{\i "button-id"} {\b )}
>Removes a button from the button bar 
{\b DisableButton(}{\i "button-id"} {\b )}
>Disables a button
{\b DisableItem(}{\i "item-id"} {\b )}
>Disables a menu item
{\b EnableButton(}{\i "button-id"} {\b )}
>Enables a button 
{\b EnableItem(}{\i "item-id"} {\b )}
>Enables a menu item 
{\b ExecProgram(}{\i "command-line", display-state} {\b )}
>Executes a program, display states are:
	0	Normal
	1	Minimized
	2	Maximized
{\b Exit( )}
>Exits WinHelp 
{\b FileOpen( )}
>Displays the Open dialog box 
{\b FocusWindow(}{\i "window-name"} {\b )}
>Changes the focus window 
{\b GoToMark(}{\i "marker-text"} {\b )}
>Jumps to a marker 
{\b HelpOn( )}
>Displays the Help on Using topic 
{\b HelpOnTop( )}
>Toggles on-top state of help 
{\b History( )}
>Displays the history list 
{\b IfThen(}IsMark({\i "marker-text"}){\i , "macro"} {\b )}
>Executes macro if marker exists
{\b IfThenElse(}IsMark({\i "marker-text"}){\i , "macro1", "macro2"} {\b )}
>Executes one of two macros if marker exists 
{\b InsertItem(}{\i _"menu-id"_[ menuid ], "item-id", "item-name", "macro", position} {\b )}
>Inserts a menu item
{\b InsertMenu(}{\i _"menu-id"_[ menuid ], "menu-name", menu-position} {\b )}
>Inserts a new menu
{\b IsMark(}{\i _"menu-id"_[ menuid ], "menu-name", menu-position} {\b )}
>Tests if a marker is set 
{\b JumpContents(}{\i "filename"} {\b )}
>Jumps to the Contents topic 
{\b JumpContext(}{\i "filename", context-number} {\b )}
>Jumps to the specified context 
{\b JumpHelpOn( )}
>Jumps to Using Help file 
{\b JumpId(}{\i "filename", "context-string"} {\b )}
>Jumps to the specified topic 
{\b JumpKeyword(}{\i "filename, "keyword"} {\b )}
>Jumps to the topic containing the keyword 
{\b Next( )}
>Displays the next topic in the browse sequence 
{\b Not(}IsMark({\i "marker-text"}) {\b )}
>Reverses the IsMark macro 
{\b PopupContext(}{\i "filename", context-number} {\b )}
>Displays a topic in a popup window 
{\b PopupId(}{\i "filename", "context-string"} {\b )}
>Displays topic in a popup window 
{\b PositionWindow(}{\i x, y, width, height, state, "name"} {\b )}
>Sets the size and position of a window, state 0 -> normal, 1 -> maximized
{\b Prev( )}
>Displays previous topic in browse sequence 
{\b Print( )}
>Prints the current topic 
{\b PrinterSetup( )}
>Displays the Printer Setup dialog box 
{\b RegisterRoutine(}{\i "DLL-name", "function-name", _"format-spec"_[ formatspec ]} {\b )}
>Registers a DLL function 
{\b RemoveAccelerator(}{\i key, shift-state} {\b )}
>Assigns a macro to an accelerator key 
{\b SaveMark(}{\i "marker-text"} {\b )}
>Saves a marker 
{\b Search( )}
>Displays the Search dialog box 
{\b SetContents(}{\i "filename", context-number} {\b )}
>Sets the Contents topic 
{\b SetHelpOnFile(}{\i "filename"} {\b )}
>Sets the Using Help help file 
{\b UncheckItem(}{\i "item-id"} {\b )}
>Unchecks a menu item 

See also:
    =Link to Borland C++ macro help=[ !JumpKeyword("tcwhelp.hlp", "Help Macros")].
---
$ Predefined menu id's
# menuid
K Predefined menu id's

{\b Predefined menu id's}

The predefined menu id's in a standard WinHelp menu, which can be used as the "menu-id"-parameter, are: 

	{\b _Name_ 			_Menu_ }

	MNU\_FILE		File 
	MNU\_EDIT		Edit 
	MNU\_BOOKMARK	Bookmark menu 
	MNU\_HELPON		Help 
---
# formatspec
$ Format specifiers

Format specifiers for the RegisterRoutine-macro are:

	u	unsigned short (WORD) 
	U	unsigned long  (DWORD) 
	i	short int 
	I	int 
	s	near char * (PSTR) 
	S	far char * (LPSTR) 
	v	void 

The format specifier string indicates the formats of parameters passed to the function.
---