diff options
author | Chris Wilson <chris+github@qwirx.com> | 2013-08-25 09:51:07 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2013-08-25 09:51:07 +0000 |
commit | 36e0571b20d6ffd3da4be07e4b7d572051b710f1 (patch) | |
tree | 1045beaa83d3f6aef539bdda4fa6bc504d61abd1 | |
parent | 94148bc10337790613b971a842608e90681df270 (diff) |
Set process title on Windows.
Thanks to Arnaud for submitting the patch:
"I propose a little patch to enable the SetProcessTitle function on windows system."
-rw-r--r-- | lib/common/BoxConfig-MSVC.h | 2 | ||||
-rw-r--r-- | lib/server/Daemon.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/common/BoxConfig-MSVC.h b/lib/common/BoxConfig-MSVC.h index e8f90e60..eeb25d2e 100644 --- a/lib/common/BoxConfig-MSVC.h +++ b/lib/common/BoxConfig-MSVC.h @@ -185,7 +185,7 @@ /* Define to 1 if you have the `setproctitle' function. */ /* #undef HAVE_SETPROCTITLE */ - +#define HAVE_SETPROCTITLE 1 /* Define to 1 if you have the `setxattr' function. */ /* #undef HAVE_SETXATTR */ diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index b1ada61d..7419f973 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -1025,9 +1025,14 @@ void Daemon::SetProcessTitle(const char *format, ...) char title[256]; ::vsnprintf(title, sizeof(title), format, args); +#ifdef WIN32 + StringCchCatA(title, sizeof(title)," - " PACKAGE_NAME); + SetConsoleTitleA(title); +#else // !WIN32 // Set process title ::setproctitle("%s", title); - +#endif + #endif // HAVE_SETPROCTITLE } |