无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 4068|回复: 4
打印 上一主题 下一主题

有会用aardio代码的看看这个怎么写

[复制链接]
跳转到指定楼层
1#
发表于 2022-12-23 14:35:08 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
https://learn.microsoft.com/zh-c ... tprocessinformation

PROCESS_POWER_THROTTLING_STATE PowerThrottling;
RtlZeroMemory(&PowerThrottling, sizeof(PowerThrottling));
PowerThrottling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;

//
// EcoQoS
// Turn EXECUTION_SPEED throttling on.
// ControlMask selects the mechanism and StateMask declares which mechanism should be on or off.
//

PowerThrottling.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
PowerThrottling.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;

SetProcessInformation(GetCurrentProcess(),
                      ProcessPowerThrottling,
                      &PowerThrottling,
                      sizeof(PowerThrottling));
2#
 楼主| 发表于 2022-12-23 14:35:42 | 只看该作者
本帖最后由 黑中见白 于 2022-12-23 14:37 编辑

::KERNEL32.SetProcessInformation(句柄,?这个应该可以直接按进程句柄,设置EcoQoS模式
EcoQoS模式是win11特有的

回复

使用道具 举报

3#
 楼主| 发表于 2022-12-24 01:49:53 | 只看该作者
666...
回复

使用道具 举报

4#
发表于 2023-1-1 17:46:21 | 只看该作者
其实很简单,这样写就可以了:
  1. import process;

  2. var throttlingState = {
  3.     INT version = 1;
  4.     INT controlMask = 1;
  5.     INT stateMask = 1;
  6. }

  7. ::Kernel32.SetProcessInformation(
  8.     process(),4,throttlingState,raw.sizeof(throttlingState)
  9. );

复制代码
不过要同时设置一下进程优先级,任务管理器才会显示绿叶标志。

新版 aardio 里已经有这个范例,可以查看、切换效率模式。
范例位置:进程 / 效率模式
回复

使用道具 举报

5#
发表于 2023-12-4 06:31:39 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-7-29 06:13

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表