diff options
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
-rw-r--r-- | plugins/MirLua/src/main.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index b7062abd7f..a747a6ea9e 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -64,13 +64,13 @@ extern "C" int __declspec(dllexport) Load(void) if (db_get_b(NULL, MODULE, "ShowConsole", 0))
{
- if (AllocConsole())
- {
- freopen("CONOUT$", "wt", stdout);
- hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
- SetConsoleTitle(_T("MirLua Console"));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
- }
+ if (!AttachConsole(ATTACH_PARENT_PROCESS))
+ if (AllocConsole())
+ {
+ freopen("CONOUT$", "w", stdout);
+ hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
+ SetConsoleTitle(_T("MirLua Console"));
+ }
}
g_hCommonFolderPath = FoldersRegisterCustomPathT("MirLua", Translate("Common scripts folder"), COMMON_SCRIPTS_PATHT);
|