转
HTMLHelp API Reference
The HtmlHelp API currently resides in the file HTMLHELP.DLL, however this is very likely to be moved to a different DLL before HTML Help ships. If you are not using GetProcAddress to get a pointer to the HtmlHelp function, then you must plan on changing the library you link to.
The functionality provided by the HtmlHelp API resides in the file HHCTRL.OCX. Because this functionality requires loading various other DLLs such as ole32.dll, the API itself resides in a DLL that requires no additional DLLs to be loaded. Only when the API is actually called will ole32 and other DLLs be loaded.
The HtmlHelp API is modeled after the WinHelp API function to make it easy to convert existing programs to use HTML Help instead of WinHelp to display their help. By the time HTML Help ships, there will also be an IHHWindow interface that can be used in place of the HtmlHelp API. This can be used by programs that already load OLE32.DLL or by programs like Visual Basic.
In its simplest form, the HtmlHelp API creates a child window which in turn hosts SHDOCVW and displays the HTML file you specify. The window is a child of whatever parent window you specify, and will automatically stay on top of that parent window, and close when the parent window is closed. You can also take complete control of the window-creation process by defining the window styles, coordinates, caption, and display state. This means you can embed SHDOCVW even in a non-OLE activated program.
SYNTAX
HWND HtmlHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData);
hwndCaller
Specifies the handle of the window calling the HtmlHelp API. If the HtmlHelp API call results in messages being sent from the HTML Help window, they will be sent to this window handle.
pszFile
Specifies an HTML file, a URL, a compiled HTML file, or a window definition (preceeded with a ‘>’ character). If the command being used does not require a file or URL, this value may be NULL.
uCommand
Specifies the action to perform. See the Comments section for details.
dwData
Specifies any data that may be required based on the value of the uCommand parameter.
Comments
太长了,自己查msdn帮助吧
在delphi中的函数定义
Function HtmlHelpA(hwnd:integer;lpHelpFile:string;wCommand:integer;dwData:string) :integer;stdcall;External 'hhctrl.ocx';
wCommand要自己查msdn中需要的参数,然后换成0、1这些
使用参数
Command Description pszFile dwData
HH_DISPLAY_TOPIC Displays an HTML file. If a window type is not specified, a default window type is used. If the window type or default window type is already being displayed, the HTML file will replace what is currently being displayed. File, URL, or compiled HTML file. If the greater then character (>
is used, it must be followed by the name of the window type to display the topic in. May be zero or a pointer to a File, URL, or compiled HTML file. This parameter may be a pointer to a filename within a compiled HTML file if the pszFile parameter points to that compiled HTML file.
HtmlHelpA(Handle,'c:/htmlhelp2/rshelp.chm',0,'欢迎.htm');