Issue #643 - Rewrite CLI vs GUI strategy (this matches DefleMask)
This commit is contained in:
parent
9c4016b86c
commit
f9cbf17a07
2 changed files with 10 additions and 6 deletions
12
src/main.cpp
12
src/main.cpp
|
|
@ -342,12 +342,14 @@ void reportError(String what) {
|
|||
// TODO: CoInitializeEx on Windows?
|
||||
// TODO: add crash log
|
||||
int main(int argc, char** argv) {
|
||||
// Windows console thing - thanks MarioKart7z!
|
||||
// Windows console thing - thanks dj.tuBIG/MaliceX
|
||||
#ifdef _WIN32
|
||||
DWORD winPID;
|
||||
HWND winConsole=GetConsoleWindow();
|
||||
GetWindowThreadProcessId(winConsole,&winPID);
|
||||
if (GetCurrentProcessId()==winPID) FreeConsole();
|
||||
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
freopen("CONIN$", "r", stdin);
|
||||
}
|
||||
#endif
|
||||
|
||||
initLog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue