.net下所有DLL(API)查询,转换C#代码
2017-06-23 16:32
423 查看
地址:
http://www.pinvoke.net/default.aspx/coredll.SetDevicePower
实例:
![](https://images2015.cnblogs.com/blog/333516/201706/333516-20170623163243257-361813884.png)
SetDevicePower (coredll)
![](http://www.pinvoke.net/images/netcf.png)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for SetDevicePower in other DLLs exists, click on Find References to the right.
Summary
Often used to control the backlight
private static extern int SetDevicePower(
string pvDevice,
int dwDeviceFlags,
DevicePowerState DeviceState);
Private Shared Function SetDevicePower(ByVal pvDevice As String, ByVal dwDeviceFlags As Integer, ByVal DeviceState As DevicePowerState) As Integer
End Function
{
Unspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1, // Low Power On: fully functional at low power/performance
D2, // Standby: partially powered with automatic wake
D3, // Sleep: partially powered with device initiated wake
D4, // Off: unpowered
}
private const int POWER_NAME = 0x00000001;
SetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D4);
This holds the backlight on until the device turns off
SetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D0);
Documentation
SetDevicePower on MSDN
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
http://www.pinvoke.net/default.aspx/coredll.SetDevicePower
实例:
![](https://images2015.cnblogs.com/blog/333516/201706/333516-20170623163243257-361813884.png)
SetDevicePower (coredll)
![](http://www.pinvoke.net/images/netcf.png)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for SetDevicePower in other DLLs exists, click on Find References to the right.
Summary
Often used to control the backlight
C# Signature:
[DllImport("coredll.dll", SetLastError=true)]private static extern int SetDevicePower(
string pvDevice,
int dwDeviceFlags,
DevicePowerState DeviceState);
VB Signature:
<DllImport("coredll")> _Private Shared Function SetDevicePower(ByVal pvDevice As String, ByVal dwDeviceFlags As Integer, ByVal DeviceState As DevicePowerState) As Integer
End Function
User-Defined Types:
public enum DevicePowerState : int{
Unspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1, // Low Power On: fully functional at low power/performance
D2, // Standby: partially powered with automatic wake
D3, // Sleep: partially powered with device initiated wake
D4, // Off: unpowered
}
private const int POWER_NAME = 0x00000001;
Notes:
None.Tips & Tricks:
Please add some!Sample Code:
This turns the backlight offSetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D4);
This holds the backlight on until the device turns off
SetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D0);
Alternative Managed API:
Do you know one? Please contribute it!Documentation
SetDevicePower on MSDN
Please edit this page!
Do you have...helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
![](http://pinvoke.net/images/logo.png)
相关文章推荐
- SQLServer\framework启动报异常:Module的类型初始值设定项引发异常 [转]QQ空间、新浪微博、腾讯微博等一键分享API链接代码 window下 mongodb快速安装 数据表查询所有子/父节点 C#学习笔记1
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- c#调用C++的DLL的所有数据类型转换
- 【转】C#调用C++的DLL搜集整理的所有数据类型转换方式
- C#调用C++的DLL 所有数据类型转换方式
- C#调用C++的DLL搜集整理的所有数据类型转换方式 (转)
- c# il (中间代码)exe,dll(编译成的程序) 之间的转换
- 用VS2008生成C++代码的dll及在C#中的调用及常见的类型转换
- C#调用C++的DLL 所有数据类型转换方式
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- 转:C#调用C++的DLL搜集整理的所有数据类型转换方式
- C#引用C++ Dll 所有类型转换方法
- 在vb和asp中调用c#生成的.net的dll,详细步骤、截图和代码
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- 用VS2008生成C++代码的dll及在C#中的调用及常见的类型转换
- C#调用C++的DLL搜集整理的所有数据类型转换方式
- C#引用C++ Dll 所有类型转换的方式
- 从.NET平台调用Win32 API(C#调用的dll动态链接库)