本帖最后由 syonmsn 于 2012-05-14 17:38:05 编辑

解决方案 »

  1.   

    SetConsoleTextAttribute
    The SetConsoleTextAttribute function sets the foreground (text) and background color attributes of characters written to the screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function. This function affects only text written after the function call. BOOL SetConsoleTextAttribute(
      HANDLE hConsoleOutput,  // handle to screen buffer
      WORD wAttributes        // text and background colors
    );