Solved

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

Posted on 2013-05-28
3
2,018 Views
Last Modified: 2013-05-30
Hi,

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?
0
Comment
Question by:Delphiwizard
3 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39201288
0
 

Expert Comment

by:GavCom
ID: 39206961
taken from http://snippets.pro/snippet/22-open-url-in-a-default-browser/

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

Open in new window

0
 

Author Closing Comment

by:Delphiwizard
ID: 39206989
Thank you very much.
Setting the default browser explicitly worked for me.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now