git://git.iain.cx/iain
/
nssm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow skipping kill_process_tree().
[nssm.git]
/
console.cpp
diff --git
a/console.cpp
b/console.cpp
index
771b69c
..
66c99ea
100644
(file)
--- a/
console.cpp
+++ b/
console.cpp
@@
-48,10
+48,15
@@
void alloc_console(nssm_service_t *service) {
AllocConsole();
AllocConsole();
+ /* Disable accidental closure. */
+ HWND window = GetConsoleWindow();
+ HMENU menu = GetSystemMenu(window, false);
+ EnableMenuItem(menu, SC_CLOSE, MF_GRAYED);
+
/* Set a title like "[NSSM] Jenkins" */
TCHAR displayname[SERVICE_NAME_LENGTH];
unsigned long len = _countof(displayname);
/* Set a title like "[NSSM] Jenkins" */
TCHAR displayname[SERVICE_NAME_LENGTH];
unsigned long len = _countof(displayname);
- SC_HANDLE services = open_service_manager();
+ SC_HANDLE services = open_service_manager(
SC_MANAGER_CONNECT
);
if (services) {
if (! GetServiceDisplayName(services, service->name, displayname, &len)) ZeroMemory(displayname, sizeof(displayname));
CloseServiceHandle(services);
if (services) {
if (! GetServiceDisplayName(services, service->name, displayname, &len)) ZeroMemory(displayname, sizeof(displayname));
CloseServiceHandle(services);