fixed console title

This commit is contained in:
Jeff Hill
1998-03-24 00:32:23 +00:00
parent 2e52bb9c1e
commit 3da421560b
2 changed files with 22 additions and 2 deletions

View File

@@ -58,7 +58,17 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
/* for gui applications, setup console for error messages */
if (AllocConsole())
{
SetConsoleTitle(BASE_VERSION_STRING);
char title[256];
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
if (titleLength) {
titleLength = strlen (title);
strncat (title, " " BASE_VERSION_STRING, sizeof(title));
}
else {
strncpy(title, BASE_VERSION_STRING, sizeof(title));
}
title[sizeof(title)-1]= '\0';
SetConsoleTitle(title);
freopen( "CONOUT$", "a", stderr );
fprintf(stderr, "Process attached to Com.dll version %s\n", EPICS_VERSION_STRING);
}

View File

@@ -58,7 +58,17 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
/* for gui applications, setup console for error messages */
if (AllocConsole())
{
SetConsoleTitle(BASE_VERSION_STRING);
char title[256];
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
if (titleLength) {
titleLength = strlen (title);
strncat (title, " " BASE_VERSION_STRING, sizeof(title));
}
else {
strncpy(title, BASE_VERSION_STRING, sizeof(title));
}
title[sizeof(title)-1]= '\0';
SetConsoleTitle(title);
freopen( "CONOUT$", "a", stderr );
fprintf(stderr, "Process attached to Com.dll version %s\n", EPICS_VERSION_STRING);
}