summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/main.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-21 20:38:33 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-21 20:38:33 +0000
commit932f5569c467683d3b95c45772da903d3117dc11 (patch)
tree73162154b5cbfc1b2826f58015dba8720732e9b5 /plugins/MirLua/src/main.cpp
parent28e58637ba0b6194a2c95adf35f7581d5481a441 (diff)
MirLua: some changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14311 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
-rw-r--r--plugins/MirLua/src/main.cpp14
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);