From owner-ntemacs-users@june  Fri Sep 13 13:00:31 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "13" "September" "1996" "15:09:10" "-0400" "Richard Pieri" "ratinox@unilab.dfci.harvard.edu" nil "31" "Re: NTEmacs & Internet Explorer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA05906 for <voelker@june.cs.washington.edu>; Fri, 13 Sep 1996 13:00:31 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA25548 for <voelker@joker.cs.washington.edu>; Fri, 13 Sep 1996 13:00:23 -0700
Received: from unilab.dfci.harvard.edu (unilab.dfci.harvard.edu [155.52.46.57]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id MAA00862 for <ntemacs-users@cs.washington.edu>; Fri, 13 Sep 1996 12:11:19 -0700
Received: (from ratinox@localhost) by unilab.dfci.harvard.edu (8.7.5/8.7.3) id PAA18909; Fri, 13 Sep 1996 15:11:12 -0400 (EDT)
References: <x7n2yuo4dg.fsf@unilab.dfci.harvard.edu> 	<199609131522.LAA28540@abwh.cincom.com> 	<9609131857.AA01364@amber.ssd.hcsc.com>
Message-ID: <x7sp8mmdux.fsf@unilab.dfci.harvard.edu>
In-Reply-To: tom@amber.ssd.hcsc.com's message of Fri, 13 Sep 96 14:57:18 -0400
Lines: 31
X-Mailer: Gnus v5.2.40/Emacs 19.34
From: Richard Pieri <ratinox@unilab.dfci.harvard.edu>
To: ntemacs-users@cs.washington.edu
Subject: Re: NTEmacs & Internet Explorer
Date: 13 Sep 1996 15:09:10 -0400

-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "TH" == Tom Horsley <tom@amber.ssd.hcsc.com> writes:

TH> I played with START myself, and on NT4.0b2 anyway, I never got START to
TH> always work correctly with all URLs I tried, but the shelex program did
TH> work. Perhaps this is something that varies from win95 to NT, etc.

Here's the deal.  I can get START and SHELEX to work when the URL
includes a file with extension, such as 
<URL:http://www.ccs.neu.edu/home/ratinox/index.html>
The browser is invoked with the command line arguments and Does The
Right Thing.  But if a directory is specified, such as
<URL:http://www.ccs.neu.edu/home/ratinox/>
neither will work because there is nothing in the registry for such a
URL for Windows to "grab".

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv

iQCVAwUBMjmxV56VRH7BJMxHAQGSpgP+NUMwQcDx9w/uR9mLlDnSjylapWopQePv
e/bu4GFY6XIhVFNkfUW1o6kNH6CkPYijAdDmjfeIlkiv+gaJlUMAXp+Oa5WJqcmL
lYzjtoSmV/OZPUwqAVPA4XYcomM+TTt71R8oF7M0S46p9i6LZ/+WdRJVGn+/6GSY
IE7K3Nx8OxA=
=+C+J
-----END PGP SIGNATURE-----
-- 
Richard Pieri/Information Services \ When in doubt, cop an attitude. -A cat's
<ratinox@unilab.dfci.harvard.edu>   \ guide to life
http://www.dfci.harvard.edu/         \ 

From owner-ntemacs-users@june  Fri Sep 13 14:55:14 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" "13" "September" "1996" "16:58:34" "-0400" "Tom Horsley" "tom@amber.ssd.hcsc.com" nil "28" "Re: NTEmacs & Internet Explorer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA18477 for <voelker@june.cs.washington.edu>; Fri, 13 Sep 1996 14:55:14 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id OAA15598 for <voelker@joker.cs.washington.edu>; Fri, 13 Sep 1996 14:55:05 -0700
Received: from hawk.hcsc.com (ns.ccur.com [207.49.146.1]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA12213 for <ntemacs-users@cs.washington.edu>; Fri, 13 Sep 1996 13:58:38 -0700
Received: from amber-36.ssd.hcsc.com by hawk.hcsc.com (5.61/harris-5.1) 	id AA23930; Fri, 13 Sep 96 16:58:36 -0400
Received: by amber.ssd.hcsc.com (5.61/CX/UX-5.0) 	id AA02297; Fri, 13 Sep 96 16:58:34 -0400
Message-Id: <9609132058.AA02297@amber.ssd.hcsc.com>
In-Reply-To: <x7sp8mmdux.fsf@unilab.dfci.harvard.edu>
References: <x7n2yuo4dg.fsf@unilab.dfci.harvard.edu> 	<199609131522.LAA28540@abwh.cincom.com> 	<9609131857.AA01364@amber.ssd.hcsc.com> 	<x7sp8mmdux.fsf@unilab.dfci.harvard.edu>
Reply-To: Tom.Horsley@hawk.hcsc.com
Mime-Version: 1.0
From: tom@amber.ssd.hcsc.com (Tom Horsley)
To: Richard Pieri <ratinox@unilab.dfci.harvard.edu>
Cc: ntemacs-users@cs.washington.edu
Subject: Re: NTEmacs & Internet Explorer
Date: Fri, 13 Sep 96 16:58:34 -0400

>Here's the deal.  I can get START and SHELEX to work when the URL
>includes a file with extension, such as 
><URL:http://www.ccs.neu.edu/home/ratinox/index.html>
>The browser is invoked with the command line arguments and Does The
>Right Thing.  But if a directory is specified, such as
><URL:http://www.ccs.neu.edu/home/ratinox/>
>neither will work because there is nothing in the registry for such a
>URL for Windows to "grab".

That's wierd. Thats exactly the sort of thing that shelex works on for me
when start fails (according to some arcane documentation I dug up on an MSDN
cdrom once, there is a url.dll file that has something to do with how the
shell extensions decide how to recognize a url - perhaps there are different
versions of this dll on different systems and that's why we all see
different things - I seem to recall that new versions of netscape and msie
came with new versions of this dll).

>Does anyone know if Netscape supports some kind of DDE interface so that we 
>could write something to talk to it?

That's exactly what the ShellExecute() API function (which the shelex
program calls) is supposed to take care of automagically.

--
Tom.Horsley@mail.ccur.com  or  Tom.Horsley@worldnet.att.net
Work: Concurrent Computers, 2101 W. Cypress Creek Rd. Ft. Lauderdale FL  33309
The 2 most important political web sites: http://www.vote-smart.org (Project
Vote Smart), and http://ourworld.compuserve.com/homepages/TomHorsley (Me!)

From owner-ntemacs-users@june  Mon Sep 16 09:15:44 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "16" "September" "1996" "11:12:10" "-0400" "Richard Pieri" "ratinox@unilab.dfci.harvard.edu" nil "43" "Re: NTEmacs & Internet Explorer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id JAA05449 for <voelker@june.cs.washington.edu>; Mon, 16 Sep 1996 09:15:43 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA19290 for <voelker@joker.cs.washington.edu>; Mon, 16 Sep 1996 09:15:42 -0700
Received: from unilab.dfci.harvard.edu (unilab.dfci.harvard.edu [155.52.46.57]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id IAA28590 for <ntemacs-users@cs.washington.edu>; Mon, 16 Sep 1996 08:12:24 -0700
Received: (from ratinox@localhost) by unilab.dfci.harvard.edu (8.7.5/8.7.3) id LAA04073; Mon, 16 Sep 1996 11:12:22 -0400 (EDT)
References: <x7n2yuo4dg.fsf@unilab.dfci.harvard.edu> 	<199609131522.LAA28540@abwh.cincom.com> 	<9609131857.AA01364@amber.ssd.hcsc.com> 	<x7sp8mmdux.fsf@unilab.dfci.harvard.edu> 	<9609132058.AA02297@amber.ssd.hcsc.com> 	<x7sp8j8s4b.fsf@unilab.dfci.harvard.edu> 	<199609161323.JAA06976@volte.i-kinetics.com>
Message-ID: <x7sp8i4hpx.fsf@unilab.dfci.harvard.edu>
In-Reply-To: Peter Breton's message of Mon, 16 Sep 1996 09:23:07 -0400
Lines: 43
X-Mailer: Gnus v5.2.40/Emacs 19.34
From: Richard Pieri <ratinox@unilab.dfci.harvard.edu>
To: ntemacs-users@cs.washington.edu
Subject: Re: NTEmacs & Internet Explorer
Date: 16 Sep 1996 11:12:10 -0400

-----BEGIN PGP SIGNED MESSAGE-----

Just for the record, I am doing this under Windows95, but I think that
similar applies to some versions of NT.

>>>>> "PB" == Peter Breton <pbreton@volte.i-kinetics.com> writes:

PB> Yes. But the "ddeexec" key is the one that sends commands to a
PB> running process. (Specifically for Netscape, it uses the WWW_OpenURL
PB> command).

And there is a ddeexec key:

    HKEY_CLASSES_ROOT/http/shell/open/ddeexec/Application	"Netscape"
    HKEY_CLASSES_ROOT/http/shell/open/ddeexec/Topic		"WWW_OpenURL"

I have tried several versions of URL.DLL (Plus!, NS2.x, NS3.x), and
regardless of which I use, 'START http://www/' returns an error (cannot
find file 'http://www/') and 'SHELEX http://www/' does nothing.  Also,
Navigator 1.22 does not like the newer versions of URL.DLL.

In parallel news, while the temporary .URL file (Internet Shortcut)
trick works consistantly with the various URL types, I have been
consistantly unable to make the browser run asynchronously if it is
launched by Emacs.  There are no problems if it is already running.
Maybe SHELEX needs to be rewritten to fork() itself and have one fork
launch Netscape while the other terminates, which hypothetically should
satisfy the DOS 'API' for termination of the inferior process.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv

iQCVAwUBMj1uS56VRH7BJMxHAQFtnwP/eyQ1O0b4QwWMOh4HstkTgzyliUylGr6y
b64S5iKuadJQhcE0QPOOLygRcNiBReN9T9ClC5vJy56+vzRhxIBYLbzwlwhy9a5Y
rA4+yCDa4xq8ocZr52/eq1z5AFBjC5y/hN8loiAmuB0RAF7PvXfvmTsEAG8HbyUu
WRyO72FV0UQ=
=McmI
-----END PGP SIGNATURE-----
-- 
Richard Pieri/Information Services \ Variety is the spice of life: one day
<ratinox@unilab.dfci.harvard.edu>   \ ignore people, the next day annoy
http://www.dfci.harvard.edu/         \ them. -A cat's guide to life

From owner-ntemacs-users@june  Mon Sep 16 12:41:58 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "16" "September" "1996" "14:33:13" "-0400" "Caleb Deupree" "cdeupree@abwh.cincom.com" nil "26" "Re: NTEmacs & Internet Explorer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id MAA07262 for <voelker@june.cs.washington.edu>; Mon, 16 Sep 1996 12:41:57 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id MAA19101 for <voelker@joker.cs.washington.edu>; Mon, 16 Sep 1996 12:41:55 -0700
Received: from cincom.com (wormhole.cincom.com [199.18.3.4]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id LAA27731 for <ntemacs-users@cs.washington.edu>; Mon, 16 Sep 1996 11:40:29 -0700
Received: from abwh.cincom.com by cincom.com (1.39.111.2/3.1.090690-Cincom Systems Inc.) 	id AA018459330; Mon, 16 Sep 1996 14:42:10 -0400
Received: by abwh.cincom.com (SMI-8.6/SMI-SVR4) 	id OAA00714; Mon, 16 Sep 1996 14:33:13 -0400
Message-Id: <199609161833.OAA00714@abwh.cincom.com>
In-Reply-To: <vines.Lev7+D3MDmB@banyanmail.bailey.com> 	(Robertson.Davenport@bailey.com)
Reply-To: cdeupree@cincom.com
From: Caleb Deupree <cdeupree@abwh.cincom.com>
To: Robertson.Davenport@bailey.com
Cc: pbreton@i-kinetics.com, ntemacs-users@cs.washington.edu
Subject: Re: NTEmacs & Internet Explorer
Date: Mon, 16 Sep 1996 14:33:13 -0400

>>>>> "Robertson" == Robertson G Davenport <Robertson.Davenport@bailey.com> writes:

    Robertson> How does a ddeexec key get invoked?  The
    Robertson> START/Shelex(ShellExecute) methods seem to use the file
    Robertson> associations which use the "open" command.

According to the MSKB article Q122787, 'ShellExecute() checks the
Registration Database for an entry that associates that file extension
with a particular application.  ...  If the registry specifies to use
DDE commands, ShellExecute() attempts to establish a DDE conversation
with that application using the application topic.  If an application
responds to the DDE connections, ShellExecute() sends a DDE Execute
command, as specified in the registry.  It is up to the application to
define the specifics on this conversion....  However, if attempts to
establish the conversation fail, ShellExecute() launches the
application specified in the registry and tries to establish the DDE
connection again.'

The url.dll in 40b2, in winnt40/system32, is also version 4.70.0.1117.

-- 
Caleb T. Deupree
Cincom Systems, Inc.    ;; opinions are mine and mine alone
cdeupree@cincom.com
http://www.cincom.com/
http://atg.cincom.com/users/cdeupree

From owner-ntemacs-users@june  Mon Sep 16 14:37:38 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "16" "September" "1996" "13:46:38" "-0700" "David C. Burgess" "dcb@aicorp.com" nil "51" "Re: NTEmacs & Internet Explorer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA27775 for <voelker@june.cs.washington.edu>; Mon, 16 Sep 1996 14:37:38 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id OAA19129 for <voelker@joker.cs.washington.edu>; Mon, 16 Sep 1996 14:37:36 -0700
Received: from aicorp.com (smog.aicorp.com [206.24.123.10]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA18407 for <ntemacs-users@cs.washington.edu>; Mon, 16 Sep 1996 13:47:04 -0700
Received: from cult.aicorp.com by aicorp.com (5.65/1.35) 	id AA23876; Mon, 16 Sep 96 13:46:38 -0700
Message-Id: <9609162046.AA23876@aicorp.com>
X-Mailer: Pronto E-Mail [version 2.01]
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: dcb@aicorp.com (David C Burgess)
To: ntemacs-users@cs.washington.edu
Subject: Re: NTEmacs & Internet Explorer
Date: Mon, 16 Sep 96 13:46:38 -0700

I don't know if this is relevant but ....

I work on Win95 and set up the following DDE link yesterday for Netscape.
(Explorer/View/Options/File Types)

URL: HyperText Transfer Protocol
Open action:
Application used to perform action: ".. path name ...\Netscape.exe " - h
DDE Message: %1
Application: Netscape
Topic: WWW_OpenURL

So it would seem:
1) netscape -h starts a copy unless one is already running .. (except this 
doesn't seem to be true from the command line)
2) The DDE topic string netscape needs is WWW_OpenURL
3) The parameter passed is the URL

Now none of this has anything to do with emacs, (or IE come to that!) but 
thought I'd share in the hope it may be some use.

Eudora mail can talk to it, and now my screensaver too 
http://www.halcyon.com/pixel/psych.htm (for getting the latest updates)

> I can't seem to get this to work.  (Win95, Netscape 3.0b6, emacs 19.33)
> 
> To those that have: are you using Peter's code to construct a temporary 
.URL
>  
> file which can then be 'started' to start the associated browser?
> 
> I'm not using that code, but just browse-url.el and the best I get is it 
> launching netscape but netscape never appearing (actually staying hidden 
- 
> only saw it with pview) and had to 'kill them' before exiting emacs.
> 
> But even if that was working, it'd start up new copies of the browser.
> Does anyone know if Netscape supports some kind of DDE interface so that 
we
>  
> could write something to talk to it?
> 
> Rob
> 
> 

Dave                        "When the program is being tested
e-mail: dcb@aicorp.com       it is too late to make design changes"

Dave                        "When the program is being tested
e-mail: dcb@aicorp.com       it is too late to make design changes"

From owner-ntemacs-users@june  Fri Nov  1 05:28:36 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" " 1" "November" "1996" "07:54:39" "EST" "Kent E. Holsinger" "kent@darwin.eeb.uconn.edu" nil "54" "Re: browse-url" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id FAA00521 for <voelker@june.cs.washington.edu>; Fri, 1 Nov 1996 05:28:36 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id FAA25697 for <voelker@joker.cs.washington.edu>; Fri, 1 Nov 1996 05:28:35 -0800
Received: from UConnVM.UConn.Edu (uconnvm.uconn.edu [137.99.26.3]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id EAA29030 for <ntemacs-users@cs.washington.edu>; Fri, 1 Nov 1996 04:54:50 -0800
Received: from darwin.eeb.uconn.edu by UConnVM.UConn.Edu (IBM VM SMTP V2R2)    with TCP; Fri, 01 Nov 96 07:54:33 EST
Received: from WALLACE (wallace.eeb.uconn.edu) by darwin.eeb.uconn.edu (4.1/SMI-SVR4) 	id AA01831; Fri, 1 Nov 96 07:54:39 EST
Message-Id: <9611011254.AA01831@darwin.eeb.uconn.edu>
In-Reply-To: <9610311953.AA13472@pulsar.htc.honeywell.com> 	(hadden@htc.honeywell.com)
Reply-To: kent@darwin.eeb.uconn.edu
From: "Kent E. Holsinger" <kent@darwin.eeb.uconn.edu>
To: hadden@htc.honeywell.com
Cc: ntemacs-users@cs.washington.edu
Subject: Re: browse-url
Date: Fri, 1 Nov 96 07:54:39 EST

>>>>> "George" == George D Hadden <hadden@htc.honeywell.com> writes:

    George> oops, i should have added that if i setq
    George> browse-url-browser-function to browse-url-netscape
    George> (instead of shell-execute-url), it will load netscape, but
    George> it seems to immediately stop without loading any url's.
    George> THIS was when reg.ini was requested.

    George> thanks again,

The following works fine for me (or rather it did *after* I recompiled
shelex.exe from the sources).

-- Kent

;; browser configuration
(autoload 'browse-url-at-point "browse-url"
  "Ask a WWW browser to load the URL at or before point." t)
(autoload 'browse-url-at-mouse "browse-url"
  "Ask a WWW browser to load a URL clicked with the mouse." t)
(autoload 'browse-url-of-buffer "browse-url"
  "Ask a WWW browser to display BUFFER." t)
(autoload 'browse-url-of-file "browse-url"
  "Ask a WWW browser to display FILE." t)
(autoload 'browse-url-of-dired-file "browse-url"
  "In Dired, ask a WWW browser to display the file named on this line." t)
;; Bind the browse-url commands to keys with the `C-c C-z' prefix
;; (as used by html-helper-mode):
(global-set-key "\C-c\C-z." 'browse-url-at-point)
(global-set-key "\C-c\C-zb" 'browse-url-of-buffer)
(global-set-key "\C-c\C-zu" 'browse-url)
(global-set-key "\C-c\C-zv" 'browse-url-of-file)
(add-hook 'dired-mode-hook
	  (function (lambda ()
		      (local-set-key "\C-c\C-zf" 'browse-url-of-dired-file))))
; Hook it to Rmail
(add-hook 'rmail-mode-hook
    (function (lambda ()
       (define-key rmail-mode-map [mouse 2] 'browse-url-at-mouse)
       (define-key rmail-mode-map "\r" 'browse-url-at-point))))
; Hook it to Gnus
(add-hook 'gnus-article-mode-hook
    (function (lambda ()
       (define-key gnus-article-mode-map [mouse 2] 'browse-url-at-mouse)
       (define-key gnus-article-mode-map "\r" 'browse-url-at-point))))
(defvar shell-execute-helper "shelex.exe")
(defun shell-execute-url (url &optional new-window)
"Invoke the shell-execute-helper program to call ShellExecute and launch
or re-direct a web browser on the specified url."
       (interactive "sURL: ")
       (call-process shell-execute-helper nil nil nil url))

(setq browse-url-browser-function 'shell-execute-url)
(setq gnus-button-url 'shell-execute-url)               ; GNUS

From owner-ntemacs-users@june  Fri Nov  1 06:04:39 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" " 1" "November" "1996" "13:25:44" "GMT" "Andrew Innes" "andrewi@harlequin.co.uk" nil "297" "Re: browse-url" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id GAA01606 for <voelker@june.cs.washington.edu>; Fri, 1 Nov 1996 06:04:38 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id GAA25200 for <voelker@joker.cs.washington.edu>; Fri, 1 Nov 1996 06:04:38 -0800
Received: from holly.cam.harlequin.co.uk (holly.cam.harlequin.co.uk [193.128.4.58]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id FAA00396 for <ntemacs-users@cs.washington.edu>; Fri, 1 Nov 1996 05:26:09 -0800
Received: from propos.long.harlequin.co.uk by holly.cam.harlequin.co.uk; Fri, 1 Nov 1996 13:25:47 GMT
Received: from elan.long.harlequin.co.uk (elan [193.128.93.78]) by propos.long.harlequin.co.uk (8.6.12/8.6.12) with SMTP id NAA22988; Fri, 1 Nov 1996 13:25:44 GMT
Message-Id: <199611011325.NAA22988@propos.long.harlequin.co.uk>
In-Reply-To: <199610312214.OAA15660@june.cs.washington.edu> (message from 	David Jeffers on Thu, 31 Oct 1996 14:14:44 -0800)
From: Andrew Innes <andrewi@harlequin.co.uk>
To: jeffers@redrose.net
Cc: hadden@htc.honeywell.com, ntemacs-users@cs.washington.edu
Subject: Re: browse-url
Date: Fri, 1 Nov 1996 13:25:44 GMT

On Thu, 31 Oct 1996 14:14:44 -0800, David Jeffers <jeffers@redrose.net> said:
>>>>>>"George" == George D Hadden <hadden@htc.honeywell.com> writes:
>
George>has anyone gotten the browse-url described in the new
George>(10/10) ntemacs web page to work with w95?  it bombed out
George>asking for
George>"/ProgramFiles/Netscape/Navigator/Program/reg.ini" i
George>provided a blank one, but the system still doesn't work.
George>if i try to execute shelex.exe at the command line, it
George>tells me that it can't run in dos, which make me think
George>that it's bombing out the same way when emacs calls it
George>with call-process.

The shelex.exe/shell-execute-url method does work (I am using it
successfully with IE3), but there is a bug in the Netscape installation
program which means that Netscape doesn't register itself correctly as
the system handler for URLs.

Someone on comp.os.ms-windows.programmer.win32 recently posted about
precisely this problem using ShellExecute to control Netscape.  The
problem is that Netscape creates the correct registry key, but in the
wrong location - HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE.

I've appended the post below - do an AltaVista search of Usenet for
"shellexec +url +final +solution" to get more details on the follow-up
to this post.

AndrewI


-----------------------------------------------------------------
ShellExecuting a URL: Final Solution (?) & Bug Fix


------------------------------------------------------------------------



>From           jagrant@emr1.NRCan.gc.ca (John Grant)
Organization   Natural Resources Canada, Ottawa
Date           Mon, 21 Oct 1996 05:42:58 GMT
Newsgroups     comp.os.ms-windows.programmer.win32,comp.os.ms-windows.programmer.winhelp
Message-ID     <DzM2JM.8o9@emr1.NRCan.gc.ca>




------------------------------------------------------------------------



Synopsis:
--------
ShellExecuting a URL on Windows '95 will work for either Win16 or Win32 apps,
if your browser installed URL.DLL with the correct registry keys. Netscape
does it wrong, so you have to fix it first.

HCW breaks the ShellExecute() macro, so use the ExecFile() macro instead.

Introduction
------------
I'm finally getting around to posting this information. It concerns the
use of ShellExecute() to 'run' a URL on Windows '95 (not 3.x).  There are
5 parts:
  0. requirement
  1. false solutions
  2. the real solution
  3. Netscape installation bug
  4. WinHelp & ShellExecute + HCW bug

0. Requirement
   -----------
   A long time ago, the question of ShellExecuting a URL came up. Several
   solutions were posted. Raymond Chen (unofficial Microsoft guru here)
   said something like:

   "just use ShellExecute(hwnd,0,"http://your.web.page/here",0,0,SW_NORMAL)"

   There were also several other answers. So I tried ShellExecute() on a
   Windows '95 system and I could *not* get it to work. So I asked again.

1. False Solutions
   ---------------
   Several solutions were posted here and I received some by e-mail.
   But Ray Chen had stated quite clearly that ShellExecute() would work.
   Here are Ray's comments (marked RC) on some of the answers that appeared
   here:

   (a) "Create a .url file that looks like:
	[internetShortcut]
	URL=http://your.web.page/here"

        RC: Don't do this. The format of an internal shortcut file may change
	    in the future. If you need to access the contents of .URL files,
	    use the IUniformResourceLocator interface. But if all you want
	    to do is exec a URL, just pass the URL to ShellExecute().

   (b)	"Use ShellExecuteEx instead"
	RC: ShellExecuteEx() also works, but isn't required

   (c)	"it only only works if you have Plus! or Internet Explorer"
		&
   	"It will only launch Microsoft Internet Explorer, not Netscape"
	RC: Microsoft Internet Explorer installs URL.DLL, but is hardly
	    the only program that does so.
	    Internet Explorer 1.0 came with Plus!

   (d)	"You need wininet.dll"
	RC: red herring

   (e)	"It only works if you execute a shortcut"
	RC: it works with a shortcut, but it also works with a plain URL

   (f)	"You have to look up HKEY_CLASSES_ROOT\http\shell\open\command to
	get "c:\program files\plus!\Micros~`\iexplorer.exe -nohome %1"
  	and then fiddle with that"
	RC: This is one of the registry steps that is supposed to have
	    been done by the browser. This is one of the places where
	    the default browser is registered, and it's one of the places
	    where URL.DLL looks (you also register the browser in the
	    DDEExec section of the http\shell\open key if your browser
	    supports DDE). Normal applications shouldn't care.

   (g)	"You have to look up .html or .htm or http in the registry and
	WinExec it yourself"
	RC: sheer desperation

2. The Real Solution
   -----------------
   Here's what Ray said in earlier comments here:

    "ShellExecute recognizes the http://, ftp://, telnet://, news://, etc.
     prefixes and runs the program that is recorded in the registry as "the
     program that handles this type of URL".  (Actually, ShellExecute asks
     URL.DLL to do this work, so if you don't have URL.DLL on your system,
     then ShellExecute'ing a URL won't work.  But all the popular web
     browsers install URL.DLL, so there shouldn't be a problem there)"

   and here he provides much more detail:

   "The file that teaches ShellExecute how to handle URLs is URL.DLL.
    URL.DLL is a redistributable DLL that IE and Netscape both install.

    URL.DLL weasels into the ShellExecute function by adding itself
    to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
    Explorer\ShellExecuteHooks.

    None of this information is supposed to concern you.

    The basic answer is: Any browser that is designed for Windows 95
    (or Windows NT 4.0) will install URL.DLL and do the magic registry goo.
    At which point, ShellExecute of a URL will launch the browser.

    If this isn't working, then it means that some step in the installation
    procedure isn't working."
		---

  Ok, so I had installed Netscape and sure enough URL.DLL was there. But it
  *still* would *NOT* work for me. Why not? Well, because Netscape put the
  magic key in the wrong place! Read on.

3. Netscape Installation Bug
   -------------------------
   Fire up Regedit and do a search for ShellExecuteHooks. If you have
   installed Netscape you will find it in:
	HKEY_CURRENT_USER
	HKEY_USERS

   But Ray clearly states that the key must be located in HKEY_LOCAL_MACHINE.

   If you have installed Plus!, Internet Explorer or possibly Microsoft
   Office?), you will probably also find it in HKEY_LOCAL_MACHINE.

   If this works for you:
	c:\> start http://www.microsoft.com

   then you probably have the key in HKEY_LOCAL_MACHINE where Ray says it
   is supposed to be.  If not, then you need to fix it by putting the
   same key you find in HKEY_CURRENT_USER in the correct location, i.e.
   HKEY_LOCAL_MACHINE.

   I don't know what this looks like on a single-user Netscape setup, but
   for our network-licenced version, the file containing the error is in
	...netscape\_istmp0.dir\reg.url

   There are 4 HKEY_CURRENT_USER keys in there. I don't know about all of
   them, but ShellExecuteHooks should be in HKEY_LOCAL_MACHINE.

   I have tried out several W95 systems around here. Some of them were ok
   (had installed Microsoft Office which probably fixed it), but most were
   broken because of this key.  When I fixed it, everything worked ok,
   including:
	- a Win16 program calling ShellExecute(.."http://...")
	- a Win32 program calling ShellExecute(.."http://...")
	c:\> start http://...

   where *NONE* of these worked before.

4. WinHelp, ShellExecute & HCW Bug
   -------------------------------
   First of all, none of this URL.DLL magic works on Windows 3.x. There
   are ways around that which involve a custom DLL function, but they
   do not concern me here (apparently there is a recent article in DDJ
   on doing this magic in Windows 3.x). I'm only concerned about Windows
   '95 & URL.DLL

   (a)	for a Win16 .HLP file on Windows '95
	add this to your .hpj:
		[config]
		RegisterRoutine("shell","ShellExecute","USSSSi")

	and in your .HLP file, just call the ShellExecute API function
	like so:
		!ShellExecute(hwndApp,"open","http://...","","",1)

	For some reason, "" doesn't work - use "open". The docs for
  	the ShellExecute() API function say that NULL will give you the
	default verb which is "open", but they don't say that "" will also
	give you "open". NULL is not the same as "": it all depends on
	how ShellExecute() is written. Anyway the explicit "open" works.

	*IF* you have the ShellExecuteHooks key in the correct
	HKEY_LOCAL_MACHINE, you should be able to click on that link and
	run the browser. It works for me.

   (b)	for a Win32 .HLP file on Windows '95
	Remove any RegisterRoutine for ShellExecute from your .HPJ. You
	don't need it because there is a built-in ShellExecute() macro.

	This is where I had a lot of problems. I tried all combinations
	that I could imagine for ShellExecute() args and I couldn't even
	get it to ShellExecute() a 'hello.wri' file(!), let alone get it
	to work with a URL. Everytime I clicked on it, I got a runtime
	error: "missing ')' 1031".

	BaDge helped me out on this one. He pointed out the following bug
	(#19) from the WH 4 buglist:

	"Internal ShellExecute commands that use the 4th, 5th or 6th
	parameters (operation, path or topic ID) do not work. Only
	the first three parameters can be used. Reported by Microsoft"

	Well, not quite. I couldn't even get it to work using a single
	argument...

	My problems weren't related to incorrect operation of ShellExecute.
	The problems are caused by HCW screwing up when it compiles the
	code. It adds bogus `' arguments at the end of the macro call.
	For example, if I used:
		!ShellExecute("hello.wri")
	the .HLP file ended up containing:
		SE(`hello.wri'`'5)	(HCW translates it to SE)

	No compilation errors, but when you click on it, you get something
	like "missing ')' (1031)". I wasted several days on that before BaDge
	looked in the .HLP file and found it. HCW had inserted '`' and
	effectively trashed the .HLP file. I'm not sure if that's what bug
	#19 is referring to or not.

	If you're really a mechanic, you can fix the .HLP by using a hex
	editor on it, *if* you're really careful and know what you're doing.
	Not recommended.

	My solution? I discarded ShellExecute() & ended up using ExecFile()
	instead. Presumably it calls the ShellExecute API function which
	is what the ShellExecute() macro would do anyway.

	Once again: it won't work unless ShellExecuteHooks is in
	HKEY_LOCAL_MACHINE

	I shold note here that this is version 4.00.0950 of HCW that came
	with the Watcom compiler. What is the current version? Is there
	a way to obtain a newer version? From Watcom or Microsoft?
	
Summary:
-------
1. check your registry and make sure ShellExecuteHooks() is in
   HKEY_LOCAL_MACHINE. If not, copy it and insert it there.

2. c:\> start http://... should work ok

3. your Win16 or Win32 .exe apps can now ShellExecute() a URL directly

4. your Win16 .HLP files can also ShellExecute a URL directly (use
   RegisterRoutine in your .hpj)

5. your Win32 .HLP files can also 'shellexecute' a URL, but HCW is broken
   and generates bogus code for the ShellExecute() macro, so use the
   ExecFile() macro instead.

Thanks to Ray Chen and BaDge for their help.

Of course, I could be entirely wrong. If so, please set me straight.
-- 
John A. Grant       * I speak only for myself *            jagrant@nrcan.gc.ca
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here.

From owner-ntemacs-users@june  Fri Nov  1 13:00:26 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" " 1" "November" "1996" "14:03:00" "CST" "George D. Hadden" "hadden@htc.honeywell.com" nil "23" "Re: browse-url" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id NAA05756 for <voelker@june.cs.washington.edu>; Fri, 1 Nov 1996 13:00:25 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA26395 for <voelker@joker.cs.washington.edu>; Fri, 1 Nov 1996 13:00:23 -0800
Received: from moon.htc.honeywell.com (moon.htc.honeywell.com [129.235.16.32]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id MAA28291 for <ntemacs-users@cs.washington.edu>; Fri, 1 Nov 1996 12:03:05 -0800
Received: from nirvana.htc.honeywell.com by moon.htc.honeywell.com (4.1/smail2.6.3/SRCv0.25); 	Fri, 1 Nov 96 14:03:02 CST id AA15229  for ntemacs-users@cs.washington.edu  at cs.washington.edu
Posted-Date: Fri, 1 Nov 96 14:03:00 CST
Received: by nirvana.htc.honeywell.com (4.1/SMI-3.2) 	id AA17064; Fri, 1 Nov 96 14:03:00 CST
Message-Id: <9611012003.AA17064@nirvana.htc.honeywell.com>
In-Reply-To: <9611011254.AA01831@darwin.eeb.uconn.edu> (kent@darwin.eeb.uconn.edu)
From: hadden@htc.honeywell.com (George D. Hadden)
To: kent@darwin.eeb.uconn.edu
Cc: ntemacs-users@cs.washington.edu
Subject: Re: browse-url
Date: Fri, 1 Nov 96 14:03:00 CST

>>>>> "KEH" == Kent E Holsinger <kent@darwin.eeb.uconn.edu> writes:

>>>>> "George" == George D Hadden <hadden@htc.honeywell.com> writes:
George> oops, i should have added that if i setq
George> browse-url-browser-function to browse-url-netscape
George> (instead of shell-execute-url), it will load netscape, but
George> it seems to immediately stop without loading any url's.
George> THIS was when reg.ini was requested.

George> thanks again,

KEH> The following works fine for me (or rather it did *after* I recompiled
KEH> shelex.exe from the sources).

KEH> -- Kent

<stuff deleted>

recompiling for w95 did the trick.  it seems to work like a charm now.  

thanks,

-geo

