Board index » cppbuilder » Help Using ShellExecute to Open a Web Page in a new Window.

Help Using ShellExecute to Open a Web Page in a new Window.


2003-08-13 04:31:51 AM
cppbuilder88
Hello List.
Hope you can help me here.
I want to Open a Web Link using ShellExecute.
I am using the following code:
AnsiString TheWebSiteLink = "www.borland.com/main.html";
ShellExecute(NULL, "open", TheWebSiteLink.c_str(), 0, 0, SW_SHOWNORMAL);
It works just fine.
It opens the default program registered for HTML documents.
What I can not do is force it to always open in a new window ( a new
instance of the Web Browser in this case ).
Do you know how to do it ?
Please let me know nad thanks a lot in advance.
======================
Roberto Gómez Torres
Tiempo Digital
Mexico City, Mexico
www.tiempo-digital.com
XXXX@XXXXX.COM
======================
 
 

Re:Help Using ShellExecute to Open a Web Page in a new Window.

This should probably be asked in nativeapi group but anyway.
Quote
AnsiString TheWebSiteLink = "www.borland.com/main.html";
ShellExecute(NULL, "open", TheWebSiteLink.c_str(), 0, 0, SW_SHOWNORMAL);
ShellExecute(0,0,"iexplore.exe", TheWebSiteLink.c_str(), 0 ,0
,SW_SHOWNORMAL);
this will open in a new window.
and to open with default browser instead of iexplore everytime, you can
find it through the registry or with FindExecutable.
There are other ways also
 

Re:Help Using ShellExecute to Open a Web Page in a new Window.

"Roberto Gomez Torres" < XXXX@XXXXX.COM >wrote in message
Quote
How can I do that ?
Have a look at the TDdeClientConv component and the following article:
INFO: DDE Support in Internet Explorer Versions
support.microsoft.com/default.aspx
Gambit
 

{smallsort}

Re:Help Using ShellExecute to Open a Web Page in a new Window.

I wrote down a 0 argument to many I see
should be like this.
ShellExecute(0,0,"iexplore.exe", TheWebSiteLink.c_str(), 0, SW_SHOWNORMAL);
discovered this behaviour when making a shellcommand for an application
I wrote.
But DDEsolution is probably the best way to do it.
Quote
ShellExecute(0,0,"iexplore.exe", TheWebSiteLink.c_str(), 0 ,0
,SW_SHOWNORMAL);