如何是用htm文件(100分)

  • 主题发起人 crpp7001
  • 开始时间
C

crpp7001

Unregistered / Unconfirmed
GUEST, unregistred user!
在button的click事件中调用 htm文件,(也是点击button后,弹出htm文件)
 
ShellExecute(handle,nil,pchar('你的URL'),nil,nil,sw_shownormal);
 
ShellExecute(handle,nil,pchar('test.htm'),nil,nil,sw_shownormal);
 
uses shellapi;
ShellExecute(handle,'','d:/extract.html','','',sw_shownormal);
 
我要连接的是本地的一个帮助文件,如果程打包是路径改变时,请问又如何连接
不能固定路径如:'d:/extract.html'
 
可从Application.ExeName中提取应用程序的路径,再加上相对路径
 
可执行文件所在的路径:extractfilepath(application.exename)
如:c:/program files/你的文件夹/
其余。。。
 
file://c:/program files/
 
同意楼上各位大侠的做法!
uses shellapi;
ShellExecute(handle,'','d:/extract.html','','',sw_shownormal);
 
uses ShellApi;
ShellExecute(handle,'','c:/readme.htm','','',sw_shownormal);
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(handle,'','d:/g.html','','',sw_shownormal);
end;
运行没错,只是不能显示g.html的内容
给个例子
 
多人接受答案了。
 
顶部