如何在 Win32 应用程序中检测 Windows 10 亮/暗模式? [英] How to detect Windows 10 light/dark mode in Win32 application?

查看:35
本文介绍了如何在 Win32 应用程序中检测 Windows 10 亮/暗模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一点上下文:

在灯光模式下:

Windows 10.1803 在设置小程序中引入了暗/亮切换 如此处所示.

问题:如何确定 Win32 应用程序中该应用程序模式"的当前类型?

解决方案

好吧,看起来这个选项没有直接暴露给常规的 Win32 应用程序,但是它可以通过 AppsUseLightTheme 设置/检索HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize 注册表路径中的键.

A bit of context: Sciter (pure win32 application) is already capable to render UWP alike UIs:

in dark mode:

in light mode:

Windows 10.1803 introduces Dark/Light switch in Settings applet as seen here for example.

Question: how do I determine current type of that "app mode" in Win32 application?

解决方案

Well, it looks like this option is not exposed to regular Win32 applications directly, however it can be set / retrieved through the AppsUseLightTheme key at the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize registry path.

这篇关于如何在 Win32 应用程序中检测 Windows 10 亮/暗模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆