diff --git a/pre_commit/color.py b/pre_commit/color.py
index 5fa7042..eb906b7 100644
--- a/pre_commit/color.py
+++ b/pre_commit/color.py
@@ -11,7 +11,7 @@ if sys.platform == 'win32':  # pragma: no cover (windows)
         from ctypes.wintypes import DWORD
         from ctypes.wintypes import HANDLE
 
-        STD_OUTPUT_HANDLE = -11
+        STD_ERROR_HANDLE = -12
         ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
 
         def bool_errcheck(result, func, args):
@@ -40,9 +40,9 @@ if sys.platform == 'win32':  # pragma: no cover (windows)
         #
         # More info on the escape sequences supported:
         # https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx
-        stdout = GetStdHandle(STD_OUTPUT_HANDLE)
-        flags = GetConsoleMode(stdout)
-        SetConsoleMode(stdout, flags | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
+        stderr = GetStdHandle(STD_ERROR_HANDLE)
+        flags = GetConsoleMode(stderr)
+        SetConsoleMode(stderr, flags | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
 
     try:
         _enable()
@@ -90,7 +90,7 @@ def use_color(setting: str) -> bool:
     return (
         setting == 'always' or (
             setting == 'auto' and
-            sys.stdout.isatty() and
+            sys.stderr.isatty() and
             terminal_supports_color and
             os.getenv('TERM') != 'dumb'
         )

No colors when hooks are run by a git commit
Hi,
I use pre-commit at home on linux which works perfect. But at work I have a windows pc. Here I have problems with the colorfull output. 

When the hooks are run by `tox` calling `pre-commit run` there are colors as usual. When the hooks are run by a `git commit` the colors are missing.

Concrete I mean the green for 'Passed', red for 'Failed ' and yellow/brown for 'Skipped' in the overview.

There is no difference if I run it via git-bash, cmd or powershell. Also there is no difference if I use the pycharm buildin terminal or others.
diff --git a/tests/color_test.py b/tests/color_test.py
index 98b39c1..5cd226a 100644
--- a/tests/color_test.py
+++ b/tests/color_test.py
@@ -29,26 +29,26 @@ def test_use_color_always():
 
 
 def test_use_color_no_tty():
-    with mock.patch.object(sys.stdout, 'isatty', return_value=False):
+    with mock.patch.object(sys.stderr, 'isatty', return_value=False):
         assert use_color('auto') is False
 
 
 def test_use_color_tty_with_color_support():
-    with mock.patch.object(sys.stdout, 'isatty', return_value=True):
+    with mock.patch.object(sys.stderr, 'isatty', return_value=True):
         with mock.patch('pre_commit.color.terminal_supports_color', True):
             with envcontext.envcontext((('TERM', envcontext.UNSET),)):
                 assert use_color('auto') is True
 
 
 def test_use_color_tty_without_color_support():
-    with mock.patch.object(sys.stdout, 'isatty', return_value=True):
+    with mock.patch.object(sys.stderr, 'isatty', return_value=True):
         with mock.patch('pre_commit.color.terminal_supports_color', False):
             with envcontext.envcontext((('TERM', envcontext.UNSET),)):
                 assert use_color('auto') is False
 
 
 def test_use_color_dumb_term():
-    with mock.patch.object(sys.stdout, 'isatty', return_value=True):
+    with mock.patch.object(sys.stderr, 'isatty', return_value=True):
         with mock.patch('pre_commit.color.terminal_supports_color', True):
             with envcontext.envcontext((('TERM', 'dumb'),)):
                 assert use_color('auto') is False

pip install -e .[dev]
parse_log_pytest
requirements.txt
3.7
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
cfgv==3.3.1
covdefaults==2.3.0
coverage==7.2.7
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.12.2
identify==2.5.24
importlib-metadata==6.7.0
iniconfig==2.0.0
nodeenv==1.9.1
packaging==24.0
platformdirs==4.0.0
pluggy==1.2.0
-e git+https://github.com/pre-commit/pre-commit.git@34e9d117861ba758b3fd2d0b33eb70de9f05238d#egg=pre_commit
pytest==7.4.4
pytest-env==1.0.1
PyYAML==6.0.1
toml==0.10.2
tomli==2.0.1
typing_extensions==4.7.1
virtualenv==20.26.6
zipp==3.15.0

name: pre-commit
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cfgv==3.3.1
      - covdefaults==2.3.0
      - coverage==7.2.7
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - identify==2.5.24
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - nodeenv==1.9.1
      - packaging==24.0
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pytest==7.4.4
      - pytest-env==1.0.1
      - pyyaml==6.0.1
      - toml==0.10.2
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - virtualenv==20.26.6
      - zipp==3.15.0
prefix: /opt/conda/envs/pre-commit

tests/color_test.py::test_use_color_tty_with_color_support
tests/color_test.py::test_format_color[foo-\x1b[42m-True-\x1b[42mfoo\x1b[m] tests/color_test.py::test_format_color[foo-\x1b[42m-False-foo] tests/color_test.py::test_use_color_never tests/color_test.py::test_use_color_always tests/color_test.py::test_use_color_no_tty tests/color_test.py::test_use_color_tty_without_color_support tests/color_test.py::test_use_color_dumb_term tests/color_test.py::test_use_color_raises_if_given_shenanigans
pre_commit/color.py
pre_commit/color.py