Files
Obsidian-Main/21.09. Windows/設定CPU Power mode.md

8 lines
932 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
用 [`PowerWriteACValueIndex()`](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powerwriteacvalueindex) 或是 `PowerWriteDCValueIndex()` 來設定,然後用 `PowerSetActiveScheme()` 使其生效。
關於 scheme 的 GUID: https://learn.microsoft.com/en-us/windows/win32/power/power-setting-guids
C#的使用[C#使用WinAPI 修改电源设置临时禁止笔记本合上盖子时睡眠使用PowerGetActiveScheme等函数以及C#对WINAPI的调用 - findumars - 博客园](https://www.cnblogs.com/findumars/p/6298724.html)
使用 API 的例子:[qt - Disable CPU package idle states in Windows from C++ code - Stack Overflow](https://stackoverflow.com/questions/69346153/disable-cpu-package-idle-states-in-windows-from-c-code)
[API for Minimum(Maximum) Processor State , C++ - Stack Overflow](https://stackoverflow.com/questions/22523708/api-for-minimummaximum-processor-state-c)