From 36e0571b20d6ffd3da4be07e4b7d572051b710f1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 25 Aug 2013 09:51:07 +0000 Subject: 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." --- lib/common/BoxConfig-MSVC.h | 2 +- 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 } -- cgit v1.2.3