#include 
#include 
using namespace std;

int main()
{
 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
            FOREGROUND_RED);
 cout<<"Hello"<
#include 


enum Color
{
    red,green,white
};

std::ostream& operator<<(std::ostream &out,Color color);
class SetColor
{
public:
    SetColor(){}
    ~SetColor(){}
  //  friend std::ostream& operator <<(std::ostream &out,Color color);  
 
        BOOL SetConsoleTextColor(WORD wAttributes);
        std::ostream& GreenColor(std::ostream &out);
        std::ostream& RedColor(std::ostream &out);
        std::ostream& WhiteColor(std::ostream &out);
    protected:
    private:
};
#endif // REMOTEMETHOD_H



SetColor.cpp
#ifdef UNICODE
#define _T(x) L##x
#else
#define _T(x) x
#endif // UNICODE

#include "SetColor.h"

SetColor::SetColor()
{
    //ctor
}

SetColor::~SetColor()
{
    //dtor
}

inline BOOL SetColor::SetConsoleTextColor(WORD wAttributes)
{
    if(!SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),wAttributes))
    {
        SetLastError(GetLastError());
        return FALSE;
    }
    return TRUE;
}

inline std::ostream& SetColor::GreenColor(std::ostream &out)
{
    SetConsoleTextColor(FOREGROUND_INTENSITY|FOREGROUND_GREEN);
    return out;
}

inline std::ostream& SetColor::RedColor(std::ostream &out)
{
    SetConsoleTextColor(FOREGROUND_INTENSITY|FOREGROUND_RED);
    return out;
}

inline std::ostream& SetColor::WhiteColor(std::ostream &out)
{
    SetConsoleTextColor(FOREGROUND_INTENSITY|FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
    return out;
}


std::ostream& operator<< (std::ostream &out,Color color)
{
    SetColor setcolor;
    switch(color)
    {
    case red:
        return setcolor.RedColor(out);
    case green:
        return setcolor.GreenColor(out);
    case white:
        return setcolor.WhiteColor(out);
    }
    return out;
}