在Windows中以编程方式控制电源管理 [英] Programmatically control Power Management in Windows

查看:105
本文介绍了在Windows中以编程方式控制电源管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows/i3/i5/i7处理器下遇到问题,那里PC端口(在本例中为笔记本电脑)的端口带宽似乎出现问题.说USB端口的带宽由于某种原因而受到限制,我希望能够以编程方式强制CPU进入高性能模式.我有一个封闭的源应用程序,该应用程序控制节电模式AC和电池的节电模式.如果我通过此关闭源应用程序关闭了交流电和直流电(电池)的省电模式,现在可以缓解USB端口的带宽问题.但是,我不确定如何以编程方式控制这些节能模式.我有一个应用程序可以从USB端口获取高速数据,并且需要能够以编程方式打开/关闭这些省电模式.感谢您的帮助.

I am running into a problem under Windows/i3/i5/i7 processors where there appears to be a problem with bandwidth to the ports of the PC(in this case a laptop). The bandwidth to say the USB port is constricted for some reason and I would like to be able to programmatically force the CPU into high performance mode. I have a closed source app that controls the power save mode AC and the power save mode for the battery. If I shut off the power save mode for both AC and DC(battery) via this closed source app I can now relieve the bandwidth problem to the USB port. However, I am not sure how I can programmatically control these power save modes. I have an app acquiring high speed data from the USB port and I need to be able to programmatically turn on/off these power saving modes. Any help is appreciated.

推荐答案

这是指向Microsoft网站的链接,该网站涵盖了电源管理API,

电源管理

RegisterPowerSettingNotification()函数看起来像您想要挂接的位置.从那里,您的应用程序将收到有关系统要更改电源设置的通知.

例如,PBT_APMQUERYSUSPEND事件使您可以允许或阻止系统进入挂起状态.
This is a link to the Microsoft site that covers the Power Management API,

Power Management

The RegisterPowerSettingNotification() function looks like where you''ll want to hook in. From there your app will receive notifications that the system wants to change the power setting.

For instance the PBT_APMQUERYSUSPEND Event allows you to allow or prevent the system from going into a suspended state.


这篇关于在Windows中以编程方式控制电源管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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