Home » Windows API

IsPwrShutdownAllowed

說明:
IsPwrShutdownAllowed 函式可電腦是否支援作業系統直接關機的功能


引用函式庫:
PowrProf


適用系統:
Windows 2000 Professional以上


函式原型:

Declare Function IsPwrShutdownAllowed Lib "PowrProf.dll" Alias "IsPwrShutdownAllowed" ( _
    ) As Long



參數型態及說明:


回傳值:
Long 若電腦支援作業系統直接關機(電源供應器要支援 S5 規格),則則回傳 True;反之則回傳 False

.NET Framework API:


VB範例:

檢視原始碼 Visual Basic
1
2
3
4
5
6
7
8
'VB的宣告
Private Declare Function IsPwrShutdownAllowed Lib "PowrProf" ( _
	) As Long
 
Dim rtvl As Long
 
'取得電腦是否支援作業系統直接關機的功能
rtvl = IsPwrShutdownAllowed()

RB範例:

檢視原始碼 REALBasic
1
2
3
4
5
6
7
8
'RB的宣告
Declare Function IsPwrShutdownAllowed Lib "PowrProf" ( _
	) As Boolean
 
Dim rtvl As Boolean
 
'取得電腦是否支援作業系統直接關機的功能
rtvl = IsPwrShutdownAllowed()

VB.NET範例:

1
2
3
4
5
6
7
8
9
10
'VB.NET的宣告
<DllImport("PowrProf.dll")> _
Shared Function IsPwrShutdownAllowed( _
	) As Boolean
End Function
 
Dim rtvl As Boolean
 
'取得電腦是否支援作業系統直接關機的功能
rtvl = IsPwrShutdownAllowed()

C#範例:

1
2
3
4
5
6
7
8
9
//C#的宣告
[DllImport("PowrProf")]
public static extern bool IsPwrShutdownAllowed(
	);
 
bool rtvl;
 
//取得電腦是否支援作業系統直接關機的功能
rtvl = IsPwrShutdownAllowed();

發表迴響