使用GammaRamp在Windows应用程序中更改屏幕亮度/颜色 [英] Changing screen brightness/color with Windows application using GammaRamp

查看:182
本文介绍了使用GammaRamp在Windows应用程序中更改屏幕亮度/颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Windows桌面操作系统编写一个应用程序,它通过GammaRamp更改屏幕亮度和颜色(使用< g class =" gr_ gr_17 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep"data-gr- id =" 17"
id =" 17"> SetDeviceGammaRamp < / g>函数)。我假设GammaRamp设置有两个级别 - 用户级别和管理员/系统级别。



当我启动需要管理员权限的文件(程序)时/>
和UAC提示窗口显示,GammaRamp用户级设置已被覆盖默认值255,255,255(出于安全原因)并且不再有效。




有没有办法从我的应用程序中检测此UAC提示窗口或更改GammaRamp(用户级设置不再使用)以便更正UAC提示后的GammaRamp?



我试图在WndProc中捕获有关GammaRamp更改或UAC提示的消息,但似乎没有发送。

解决方案

嗨Iskren Iva nov,


谢谢你在这里发帖。


据我所知,每个需要管理员访问令牌的应用都必须提示同意。子进程从父进程继承用户的访问令牌。但是,父进程和子进程必须具有相同的完整性级别。
Windows 10通过标记其完整性级别来保护进程。完整性级别是信任度量。


当用户登录到计算机时,系统会为该用户创建访问令牌。访问令牌包含有关授予用户的访问级别的信息,包括特定的安全标识符(SID)和Windows权限。


我认为该进程无法访问GammaRamp的资源SIDs。


最好的问候,


Hart




I am coding an application for Windows Desktop OS which changes screen brightness and colors via GammaRamp (using <g class="gr_ gr_17 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="17" id="17">SetDeviceGammaRamp</g> function). I assume that there are two levels of the GammaRamp setting - user level and admin/system level.

When I start a file (program) which requires admin privileges
and UAC prompt windows shows up, the GammaRamp user-level setting has been overridden with the default 255,255,255 (for security reasons) and is not valid anymore.

Is there a way to detect this UAC prompt window or the change of the GammaRamp (that the user-level setting is not in use anymore) from my application in order to correct GammaRamp after the UAC prompt?

I have tried to capture a message in WndProc about GammaRamp change or UAC prompt but it seems nothing is sending.

解决方案

Hi Iskren Ivanov,

Thank you for posting here.

As far as I know that each app that requires the administrator access token must prompt for consent. Child processes inherit the user's access token from the parent process. Both the parent and child processes, however, must have the same integrity level. Windows 10 protects processes by marking their integrity levels. Integrity levels are measurements of trust.

When a user logs on to a computer, the system creates an access token for that user. The access token contains information about the level of access that the user is granted, including specific security identifiers (SIDs) and Windows privileges.

I think that the process cannot access the resource of GammaRamp without SIDs.

Best Regards,

Hart


这篇关于使用GammaRamp在Windows应用程序中更改屏幕亮度/颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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