网站首页  词典首页

请输入您要查询的函数:

 

术语 getdevicepowerstate
释义 GetDevicePowerState
语法:
C++
BOOL WINAPI GetDevicePowerState(
__in HANDLE hDevice,
__out BOOL *pfOn
);
GetDevicePowerState功能
检索指定设备的当前电源状态。此函数不能用于查询显示设备电源状态。
参数
hDevice [in]
的句柄设备上的对象,如文件或插座,或句柄设备本身。
pfOn [out]
一个指针变量,它接收电源状态。该值是TRUE,如果该设备在工作状态。否则,它是假。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。
备注
应用程序可以使用GetDevicePowerState,以确定设备是否在工作状态或低功耗状态。如果该设备是在低功耗状态,访问该设备可能会导致它要么排队或没有任何我进入工作状态/ O请求,或过渡的设备。确切的行为取决于设备的执行情况。
为了确保在笔记本电脑上最长的电池寿命,使用GetDevicePowerState降低功耗。例如,如果一个磁盘目前断电,访问磁盘将导致其转动,在增加电力消耗,降低了电池寿命。
应用程序应该推迟或限制进入的设备尽可能在系统使用电池电源运行。要确定系统是否运行在电池电源,其余的电池寿命,使用GetSystemPowerStatus功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
系统电源状态
电源管理功能
GetSystemPowerStatus
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==GetDevicePowerState Function
Retrieves the current power state of the specified device. This function cannot be used to query the power state of a display device.
Syntax
C++
BOOL WINAPI GetDevicePowerState(
__in HANDLE hDevice,
__out BOOL *pfOn
);
Parameters
hDevice [in]
A handle to an object on the device, such as a file or socket, or a handle to the device itself.
pfOn [out]
A pointer to the variable that receives the power state . This value is TRUE if the device is in the working state. Otherwise, it is FALSE.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
An application can use GetDevicePowerState to determine whether a device is in the working state or a low-power state. If the device is in a low-power state, accessing the device may cause it to either queue or fail any I/O requests, or transition the device into the working state. The exact behavior depends on the implementation of the device.
To ensure maximum battery life on a laptop computer, use GetDevicePowerState to reduce power consumption. For example, if a disk is currently powered down, accessing the disk will cause it to spin up, resulting in increased power consumption and reduced battery life.
Applications should defer or limit access to devices wherever possible while the system is running on battery power. To determine whether the system is running on battery power, and the remaining battery life, use the GetSystemPowerStatus function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
System Power Status
Power Management Functions
GetSystemPowerStatus
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372690(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:23:15