ShellExecute to open website (doesn't work in Windows 8)


Following code worked fine until windows 8 (EDI Delphi XE2).
ShellExecute(Application.Handle,'Open', PChar(IWebsite.Text) ,Nil,Nil,SW_SHOW);

Open in new window

Somehow it doesn't find the webbrowser even though all other apps in windows do. So nothing happens.

In "Standard programs" in Windows, the default webbrowser is set to:
"Use current webbrowser".

Is there a way to solve / force this?
Stef MerlijnDeveloperAsked:
Who is Participating?
taken from

uses Winapi.ShellAPI;
procedure OpenURL(url:string);
  ShellExecute(Handle, 'open', pChar(url), nil, nil, SW_NORMAL);

Open in new window

Stef MerlijnDeveloperAuthor Commented:
Thank you very much.
Setting the default browser explicitly worked for me.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.