andru
asked on
Open Web browser with local html document
Hi Ppl
Just a quick one, how do I trigger the default web browser with a preprepared html document from within an application?
TIA
Just a quick one, how do I trigger the default web browser with a preprepared html document from within an application?
TIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Err, how do I call shellexecute? It aint exactly a Delphi method.
TIA
TIA
add
uses ShellAPI
uses ShellAPI
ASKER
K, here is the code I'm using
procedure Tmap_form.trefach_menu_ite mClick(
Sender: TObject);
var
s:string;
p:pansichar;
begin
s:=application_path+'trefa ch\trefach .htm'+#0;
p:=@s;
shellexecute(handle,'open' ,p,nil,nil ,SW_SHOW);
end;
where am I going wrong?
TIA
procedure Tmap_form.trefach_menu_ite
Sender: TObject);
var
s:string;
p:pansichar;
begin
s:=application_path+'trefa
p:=@s;
shellexecute(handle,'open'
end;
where am I going wrong?
TIA
why not make s a PChar
s : PChar;
s:=application_path+'trefa ch\trefach .htm';
shellexecute(handle,'open' ,s,nil,nil ,SW_SHOW);
and make sure that s contains
application_path\trefach\t refach.htm
and not
application_pathtrefach\tr efach.htm
Works for me
s : PChar;
s:=application_path+'trefa
shellexecute(handle,'open'
and make sure that s contains
application_path\trefach\t
and not
application_pathtrefach\tr
Works for me
procedure Tmap_form.trefach_menu_ite mClick(
Sender: TObject);
var
s:string;
begin
s:=application_path+'trefa ch\trefach .htm';
shellexecute(handle,'open' ,PChar(s), nil,nil,SW _SHOWNORMA L);
end;
Sender: TObject);
var
s:string;
begin
s:=application_path+'trefa
shellexecute(handle,'open'
end;
ASKER
Err, application_path already has a backslash at the end.
TIA
TIA
shellexecute(handle,'open'