summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9b9784c)
raw | patch | inline | side by side (parent: 9b9784c)
author | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Thu, 18 Mar 2010 21:45:19 +0000 (21:45 +0000) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Fri, 1 Oct 2010 22:08:45 +0000 (23:08 +0100) |
The mingw function to launch the system html browser is silent if the
target file does not exist leaving the user confused. Make it display
something.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
target file does not exist leaving the user confused. Make it display
something.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index ee8f3be5b22df88cdde3667cbbdcff5453e71a08..431e32265d63028a998c8cdd88af12ec1871e63a 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
const char *, const char *, const char *, INT);
T ShellExecute;
HMODULE shell32;
+ int r;
shell32 = LoadLibrary("shell32.dll");
if (!shell32)
die("cannot run browser");
printf("Launching default browser to display HTML ...\n");
- ShellExecute(NULL, "open", htmlpath, NULL, "\\", 0);
-
+ r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL);
FreeLibrary(shell32);
+ /* see the MSDN documentation referring to the result codes here */
+ if (r <= 32) {
+ die("failed to launch browser for %.*s", MAX_PATH, unixpath);
+ }
}
int link(const char *oldpath, const char *newpath)