许多(如果不是全部)“经典”WinAPI 函数(包括 kernel32.dll
中的 SetThreadExecutionState
)在 UWP 中并未得到正式支持。尽管事实上它们实际上可以在这些应用程序中工作。
问题是是否有等价的?当然主要对SetThreadExecutionState
感兴趣。
最佳答案
我假设您希望设备在 UWP 应用运行时保持事件状态。
实现这一点的简单方法是使用
displayRequest = new Windows.System.Display.DisplayRequest();
displayRequest.RequestActive();
// Do not forget to release afterwards
displayRequest.RequestRelease();
关于c# - UWP 的 kernel32.dll 中的 SetThreadExecutionState 模拟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54381578/