* Opening local URL in browser
@ 2000-05-02 7:13 Olaf Bachmann
2000-05-02 12:55 ` Tor Lillqvist
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Bachmann @ 2000-05-02 7:13 UTC (permalink / raw)
To: xemacs-nt; +Cc: cygwin
From my cygwin application, I'd like to open a local html file in the
default system browser. Looking through the Xemacs sources, I found
the 'ShellExecute' call (in file objects-msw.c). Called from within
Xemacs, it does exactly what I had expected. Duplicating the system
call with exactly the same arguments in my little test program with:
#include <windows.h>
int main()
{
ShellExecute(NULL, "open", NULL, "index.html", "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
}
does not bring up the HTML browser, but the FileBrowser with the C: directory
as its contents. The same happens if I play around with the directory
and location of the index.html file and/or the SW_* parameter
Do I still have to call some initialization before ShellExecute works
as expected? What else could I do to open a local URL in a browser?
Thanks for any help,
Olaf
____________________________________________________________________________
Olaf Bachmann | Phone: + 49-631/205 2738 (work)
Centre for Computer Algebra| + 49-6306/7396 (home)
Fachbereich Mathematik | Email: obachman@mathematik.uni-kl.de
Universitaet Kaiserslautern| URL: http://www.mathematik.uni-kl.de/~obachman
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Opening local URL in browser
2000-05-02 7:13 Opening local URL in browser Olaf Bachmann
@ 2000-05-02 12:55 ` Tor Lillqvist
2000-05-03 4:48 ` Olaf Bachmann
0 siblings, 1 reply; 3+ messages in thread
From: Tor Lillqvist @ 2000-05-02 12:55 UTC (permalink / raw)
To: Olaf Bachmann; +Cc: xemacs-nt, cygwin
Olaf Bachmann writes:
> ShellExecute(NULL, "open", NULL, "index.html", "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
I think that should be either:
ShellExecute(NULL, "open", "file:///X|/path/to/index.html", NULL, "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
where X is the drive letter, and /path/to/ is the directory where
index.html is, with backslashes replaced by slashes, or:
ShellExecute(NULL, "open", "X:\\path\\to\\index.html", NULL, "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
with a full normal Windows pathname.
HTH,
--tml
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Opening local URL in browser
2000-05-02 12:55 ` Tor Lillqvist
@ 2000-05-03 4:48 ` Olaf Bachmann
0 siblings, 0 replies; 3+ messages in thread
From: Olaf Bachmann @ 2000-05-03 4:48 UTC (permalink / raw)
To: Tor Lillqvist; +Cc: Olaf Bachmann, xemacs-nt, cygwin
Tor Lillqvist writes:
> Olaf Bachmann writes:
> > ShellExecute(NULL, "open", NULL, "index.html", "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
>
> I think that should be either:
>
> ShellExecute(NULL, "open", "file:///X|/path/to/index.html", NULL, "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
>
> where X is the drive letter, and /path/to/ is the directory where
> index.html is, with backslashes replaced by slashes, or:
>
> ShellExecute(NULL, "open", "X:\\path\\to\\index.html", NULL, "d:\\home\\obachman\\tmp\\", SW_SHOWDEFAULT);
>
> with a full normal Windows pathname.
Yes and no. I mixed up the parameters to ShellExecute. The following
now works for me:
ShellExecute(NULL, "open", "C:\\index.html", NULL, NULL, SW_SHOWDEFAULT);
Thanks to all who replied.
Olaf
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-05-03 4:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02 7:13 Opening local URL in browser Olaf Bachmann
2000-05-02 12:55 ` Tor Lillqvist
2000-05-03 4:48 ` Olaf Bachmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).