2008. június 28., szombat

How to display an HTML document


Problem/Question/Abstract:

I need to display the contents of a HTML document from a Delphi4 program. Can I somehow execute a 'doubleclick' of the HTML file (automatically activating the default browser)?

Answer:

Yes, that's what ShellExecute or ShellExecuteEx allow you to do:

function showHtml(sDocName: string): boolean;
begin
  result := (32 < shellExecute(0, 'open', pChar(sDocName), nil, nil, sw_minimize));
end;

Nincsenek megjegyzések:

Megjegyzés küldése