Solved

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

Posted on 2013-05-28
3
2,088 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

730 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