[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

ShellExecute

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
voxel
Asked:
voxel
1 Solution
 
RBertoraCommented:
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
 
voxelAuthor Commented:
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
 
duke_nCommented:
listenin'
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rwilson032697Commented:
Lurking...
0
 
RBertoraCommented:
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
 
voxelAuthor Commented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now