Solved

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

Posted on 2013-05-28
3
2,053 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 26

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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