X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=win%2Finspircd_win32wrapper.cpp;h=f2562020dc7469f69819f4e32aeb8e7e4439c532;hb=0a329440bd1d0fa642ce2f3e14bc88125377b5bd;hp=1a7be09fe710ba7eedb262fdfc6ec2e953616fef;hpb=a47e2df0ce833e06fa3e4034e64ec084a2bbb2d3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index 1a7be09fe..f2562020d 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -1,13 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2014 Attila Molnar + * Copyright (C) 2013, 2019, 2021 Sadie Powell + * Copyright (C) 2013 ChrisTX + * Copyright (C) 2012 Robby * Copyright (C) 2011 Adam - * Copyright (C) 2007, 2009 Dennis Friis - * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2007-2009 Craig Edwards - * Copyright (C) 2008 John Brooks - * Copyright (C) 2007 Burlex + * Copyright (C) 2007-2008 Craig Edwards * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2007 Dennis Friis * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -55,3 +56,16 @@ DWORD CWin32Exception::GetErrorCode() { return dwErrorCode; } + +WindowsStream::WindowsStream(DWORD handle) + : BackgroundColor(0) + , ForegroundColor(FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN) +{ + this->Handle = GetStdHandle(handle); + CONSOLE_SCREEN_BUFFER_INFO bufinf; + if (GetConsoleScreenBufferInfo(this->Handle, &bufinf)) + { + this->BackgroundColor = bufinf.wAttributes & 0x00F0; + this->ForegroundColor = bufinf.wAttributes & 0x00FF; + } +}