diff --git a/Misc/NEWS.d/next/Windows/2026-08-09-15-40-00.gh-issue-85470.Lm4Xt9.rst b/Misc/NEWS.d/next/Windows/2026-08-09-15-40-00.gh-issue-85470.Lm4Xt9.rst new file mode 100644 index 00000000000000..1d623c890e960b --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-08-09-15-40-00.gh-issue-85470.Lm4Xt9.rst @@ -0,0 +1,4 @@ +Importing :mod:`ctypes` on Windows no longer loads ``user32.dll``, which +made the system treat the process as a GUI process and stop sending logoff +and shutdown console control events to it. ``ole32.dll``, which pulled +``user32.dll`` in, is now delay loaded. diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj index 63d5fa49cd4e17..e56d812d78dcd8 100644 --- a/PCbuild/_ctypes.vcxproj +++ b/PCbuild/_ctypes.vcxproj @@ -98,6 +98,7 @@ /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) + ole32.dll