You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MangoHud/src/win/main.cpp

32 lines
696 B
C++

#include "windows.h"
#include <cstdio>
void ConsoleSetup()
{
// With this trick we'll be able to print content to the console, and if we have luck we could get information printed by the game.
AllocConsole();
SetConsoleTitle("MangoHud");
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
freopen("CONIN$", "r", stdin);
}
int MainThread(){
ConsoleSetup();
return 0;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
{
DisableThreadLibraryCalls(hInstance);
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MainThread, NULL, 0, NULL);
break;
}
return TRUE;
}