lowestresolution
lowestresolution

Reputation: 11

Shellexecute (Open Browser to load HTML Code stored in variable)

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?

Upvotes: 1

Views: 373

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 598194

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.

Upvotes: 4

Related Questions