Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error 1.1 400 Bad request idhttp delphi 18 54
Print Graphic and Text to Epson TM-T88v 12 176
QRReport  TQrmemo vertical stretching 1 42
Delphi 2 48
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

22 Experts available now in Live!

Get 1:1 Help Now