fixed console title
This commit is contained in:
1 parent
2e52bb9c1e
commit
3da421560b
2 files changed
+22
-2
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user