Solved

ShellExecute

Posted on 2000-03-21
6
276 Views
Last Modified: 2010-04-04
When i use ShellExecute function to open a html document, it is opened in an existing instance of the browser (when the browser is opened).

How can I open the document creating another instance of the browser ?

Thanks

Gustavo
0
Comment
Question by:voxel
6 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 2640532
Use createPorcess:

var
  StartUpInfos: TStartUpInfo;
begin
  ZeroMemory(@StartUpInfos, sizeOf(TStartUpInfo));
  StartUpInfos.cb := SizeOf(StartUpInfos);
  CreateProcess(nil, PChar(CommandLine), nil, nil, false, 0, nil, nil, StartUpInfos, Result);
end;

Rob;-)
0
 

Author Comment

by:voxel
ID: 2640978
Do I have to include the path to the browser executable in CommandLine ?

I would like to open the document in the default browser.
0
 
LVL 1

Expert Comment

by:duke_n
ID: 2641012
listenin'
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Expert Comment

by:rwilson032697
ID: 2643223
Lurking...
0
 
LVL 7

Accepted Solution

by:
RBertora earned 50 total points
ID: 2643905
Hi ,
yes you can pass the url as a parameter:

procedure TForm1.Button1Click(Sender: TObject);
var
  StartUpInfos: TStartUpInfo;
  Result : TProcessInformation;
begin
  ZeroMemory(@StartUpInfos, sizeOf(TStartUpInfo));
  StartUpInfos.cb := SizeOf(StartUpInfos);
  CreateProcess(nil, PChar('C:\Program Files\Plus!\Microsoft Internet\Iexplore.exe http://www.yahoo.com'), nil, nil, false, 0, nil, nil, StartUpInfos, Result);
end;


Rob;-)

P.S. sorry about the first post, I left out the declaration for Result.
0
 

Author Comment

by:voxel
ID: 2644467
It works when I know that Internet Explore is the default browser.

But I can use your answer to solve my problem.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

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

16 Experts available now in Live!

Get 1:1 Help Now