Fog Creek Software
Discussion Board




Open Internet Browser in the same window

i use to open URL (Local or Inet) from my programs using ShellExecute API (this open the default browser in the pc-win machine).

i would like this ShellExecute uses allways the same window (even in different sessions, even if you don't have the returned code fro previous shellexecute).

i think in some accasions i was able to do this, but now the API opens a new window, even if the window title (title tag) is the same.

please do you know how force to reuse certain window?

i.e. you've open a window to JOS, another window to Amazon. the first time my program must create a new window, the next open's must reuse this last window.

TIA, Guillermo (with very hot afternoon in Madrid)

Guillermo
Tuesday, July 15, 2003

This is a bit harder and requires some COM programming. You have to hunt around in the Running Object Table (ROT) to find instances of the Internet Explorer application, and pick one, and then send it a Navigate message. In Visual Basic you can find things from the ROT using GetObject()

Joel Spolsky
Tuesday, July 15, 2003

Is it not tied to the option in IE Tools > Options > Advanced > "Reuse windows for launching shortcuts"?

Duncan Smart
Tuesday, July 15, 2003

It seems to depend on exactly how you call ShellExecute.  Try using the "open" verb, and pass in the URL as the lpFile parameter.

Michael Eisenberg
Tuesday, July 15, 2003

Ah, I see--my method doesn't allow you to specify exactly which window to open in.  Oh, well.

Michael Eisenberg
Tuesday, July 15, 2003

AFAIAA this is not a tech support forum.


Wednesday, July 16, 2003

Duncan,

"IE Tools > Options > Advanced > "Reuse windows for launching shortcuts"?"

its option uses the last open window, not a certain window (i.e. not a window having a concrete title o handle).
its is mainly for Outlook, and only works with IE, but pc can have other browser.

anyway, great to remember me this option for outlook.

Guillermo
Wednesday, July 16, 2003

anonymous:

"AFAIAA this is not a tech support forum."

Soooooooooooorry

if you read the topic title then you don't need to read into nor reply.

next time when philosophy dudes comes to me i'll put here my questions (;-)

maybe not tech forum, but mainly (very good) tech guys, i think some concrete tech question is not for reject.

at least i wrote with my real name.

Guillermo
Wednesday, July 16, 2003

"if you read the topic title then you don't need to read into nor reply."

And?


Wednesday, July 16, 2003

What about the target tag in HTML?

Stephen Jones
Wednesday, July 16, 2003

Stephen,

i don't know any html tah <target>, only target paramter in <a link...

anyway i can't write html, only show an html page using ShellExecute (as a preview function).

Guillermo
Wednesday, July 16, 2003

uups!

"i don't know any html tah <target>,"

tah <- tag

(and pretty, tah sounds to indian (from India) word....;-)

Guillermo
Wednesday, July 16, 2003

OK Guillermo; pedantry wins again!

Have a nice time on the Costa de la Castellana.

Stephen Jones
Friday, July 18, 2003

Pardon, Stephen, was only a little joke in my very bad english.

anyway, i don't know the tag you mention. also i must show an html existing file without change it.
maybe this can only be achieved using DDE/OLE/COM as Joel post.

sorry for any inconvenience.

Guillermo
Friday, July 18, 2003

I was only joking; maybe a little envious that you're in Madrid; I lived there for nine years.

You're right; target isn't a tag it's an attribute, but of course if you haven't got the page to open then there will be a problem.

Stephen Jones
Saturday, July 19, 2003

*  Recent Topics

*  Fog Creek Home