Solved

ShellExecute

Posted on 2000-03-21
6
277 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
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.

 
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

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

17 Experts available now in Live!

Get 1:1 Help Now