怎样用DELPHI制作用 IE 打开的帮助文件!!!(200分)

  • 主题发起人 滕人龙
  • 开始时间

滕人龙

Unregistered / Unconfirmed
GUEST, unregistred user!
我想DELPHI制作用 IE 打开的帮助文件
网页我会作,但怎么样用来 IE 打开(在DELPHI下) 请诸位指教!多谢!
我给200分!
 
不太明白你的意思,要做MSDN风格的帮助可以用Visual Studio 中的Html Workshop
 
这个如何?

procedure TfrmMain.miHelpClick(Sender: TObject);
var
p:pchar;
begin
if FileExists(ExtractFilePath(Application.Exename)+'HELP.chm') then
begin
p:=pchar(ExtractFilePath(Application.Exename)+'HELP.chm');
ShellExecute(0, nil, p, nil, nil, SW_NORMAL);
end
else
begin
p:=pchar(ExtractFilePath(Application.Exename)+'Help/hereinfoIndex.HTM');
ShellExecute(0, nil, p, nil, nil, SW_NORMAL);
end;
end;
 
程云,这种做法不流行啦,不能直接goto 到一个topic
用api函数吧
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 useddo
es 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');
 
用下面这个api打开html或者chm(msdn的类型),只要在Link上指明路径(网络路径,
或则本机文件路径);
ShellExecute(handle,"open",Link.c_str(),0,0,SW_SHOW);
用这个api将会采用默认浏览器打开一个指定的网页,也可以是一个chm帮助文件。
 
吐血啊,这种方法我在两年前就用了,可惜太落后,用户不感冒,做好使用chm或者。hlp。
千万不能怕烦,相信如果你使用html文件的话会和我一样走弯路,最后还是要改造
 
我有例子,来信索取。
 
<p><font color="#FF0000" size="4">ShellExecute(handle,"open",Link.c_str(),0,0,SW_SHOW);
直接就可以打开chm,呵呵。的确,用html帮助几乎没人用了,chm格式的真不错!!!</font></p>
 
我有chm的构件, 要的话, 我给你发一份
 
我也要!谢谢!chm如何制作?
 
多人接受答案了。
 
顶部