1
votes

I'm trying to open a Webbrowser with shellexecute like this, but it doesn't work.

ShellExecute(application.Handle, 'open', pchar(html), nil, nil, SW_ShowNormal);

Html Code is directly stored in the html variable.

Is there a way to call the shell command with the html code directly?

1
No, you cannot do that.Andreas Rejbrand

1 Answers

4
votes

No, this is not how ShellExecute() works. It can open a URL to an HTML page that is stored on the HDD or an HTTP/S server, but it cannot open an HTML page that is stored in memory. So, you will have to either:

  • save your HTML to a file first, and then load the file.

  • use an embedded web browser directly in your app, and then use its native API to load the HTML from memory.