地址:

http://www.pinvoke.net/default.aspx/coredll.SetDevicePower

实例:

SetDevicePower (coredll)
 


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 off
SetDevicePower("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

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).

.net下所有DLL(API)查询,转换C#代码的更多相关文章

  1. 深入Delphi下的DLL编程

    深入Delphi下的DLL编程 作者:岑心 引 言 相信有些计算机知识的朋友都应该听说过“DLL”.尤其是那些使用过windows操作系统的人,都应该有过多次重装系统的“悲惨”经历——无论再怎样小心, ...

  2. MFC下的DLL编程学习

    1.DLL库与LIB库对比: 静态链接库Lib(Static Link Library),是在编译的链接阶段将库函数嵌入到应用程序的内部.如果系统中运行的多个应用程序都包含所用到的公共库函数,则必然造 ...

  3. InfluxDB学习之InfluxDB的HTTP API查询操作

    在 InfluxDB学习 的上一篇文章:InfluxDB学习之InfluxDB的HTTP API写入操作 中,我们介绍了使用InfluxDB的HTTP API进行数据写入操作的过程,本文我们再来介绍下 ...

  4. 汇编Ring 3下实现 HOOK API

    [文章标题]汇编ring3下实现HOOK API [文章作者]nohacks(非安全,hacker0058) [作者主页]hacker0058.ys168.com [文章出处]看雪论坛(bbs.ped ...

  5. oracle查询转换_inlist转换

    oracle的optimizer会对一些sql语句进行查询转换,比如: 合并视图 子查询非嵌套化 inlist转换 下面讲讲遇到的in list转化优化的案例: create table test( ...

  6. 使用聚合数据API查询快递数据-短信验证码-企业核名

    有位朋友让我给他新开的网站帮忙做几个小功能,如下: 输入快递公司.快递单号,查询出这个快件的所有动态(从哪里出发,到了哪里) 在注册.登录等场景下的手机验证码(要求有一定的防刷策略) 通过输入公司名的 ...

  7. windows下编写dll

    dll的优点 简单的说,dll有以下几个优点: 1) 节省内存.同一个软件模块,若是以源代码的形式重用,则会被编译到不同的可执行程序中,同时运行这些exe时这些模块的二进制码会被重复加载到内存中.如果 ...

  8. windows下多字节和宽字节转换

    先简单说下什么是多字节和宽字节. 多字节是指使用多个字节(1-3)表示一个字符.比如gbk使用英文占一个字节,中文占2个,这个就是多字节了.utf-8是使用1-3个字节表示字符.还有big5等等. 宽 ...

  9. 免费手机号码归属地API查询接口和PHP使用实例分享

    免费手机号码归属地API查询接口和PHP使用实例分享 最近在做全国性的行业分类信息网站,需要用到手机号归属地显示功能,于是就穿梭于各大权威站点之间偷来了API的接口地址. 分享出来,大家可以用到就拿去 ...

  10. Linux下将UTF8编码批量转换成GB2312编码的方法

    Linux下将UTF8编码批量转换成GB2312编码的方法 在sqlplus中导入UTF8编码的sql脚本就会出现乱码错误,这时就需要将UTF8编码转换成GB2312编码,下面为大家介绍下在Linux ...

随机推荐

  1. HeyWeGo第五周项目总结

    HeyWeGo第五周项目总结 项目内容 使用java程序开发一款扫雷游戏 游戏项目规划: 确定游戏中方块格子的个数 确定游戏中地雷的个数(初始10个),完成布雷 计算每个方块周围的雷数,在方块周围本身 ...

  2. VC/MFC 编程技巧大总结

    1 toolbar默认位图左上角那个点的颜色是透明色,不喜欢的话可以自己改. 2 VC++中 WM_QUERYENDSESSION WM_ENDSESSION 为系统关机消息. 3 Java学习书推荐 ...

  3. SQL 中 not in 查询不到数据问题

    在开发的过程中,遇到过not in 始终查询不到数据问题 select * from T_CustomerInfo where CustomerID not in (select CustomerID ...

  4. shell 判断文件是否是可执行文件

    测试变量指定的文件是否存在且是可执行文件.如果存在且是可执行文件,则执行该文件,否则通过chmod命令赋予该文件可执行权限. //test.sh #!/bin/bash echo "ente ...

  5. Oracle10g客户端链接服务端配置

    Oracle10g客户端工具plsql链接服务端配置 Oracle10g客户端工具比如plsql,在网络中链接服务端问题比较多中国菜刀,经常出现很多莫名其妙的问题.实际上不是plsql的配置,问题还是 ...

  6. R语言绘制正太分布图,并进行正太分布检验

    正态分布 判断一样本所代表的背景总体与理论正态分布是否没有显著差异的检验.   方法一概率密度曲线比较法 看样本与正太分布概率密度曲线的拟合程度,R代码如下: #画样本概率密度图s-rnorm(100 ...

  7. Vue.js系列之项目搭建(1)

    项目搭建具体步骤如下: 1.安装node 到官网下载安装,我这里是win7系统. (中)https://nodejs.org/zh-cn/ (英)https://nodejs.org/en/ 2.安装 ...

  8. iOS UI-线程(NSThread)及其安全隐患与通信

    一.基本使用 1.多线程的优缺点 多线程的优点 能适当提高程序的执行效率 能适当提高资源利用率(CPU.内存利用率) 多线程的缺点 开启线程需要占用一定的内存空间(默认情况下,主线程占用1M,子线程占 ...

  9. Fedora BCM43142 无线网卡驱动安装

    OS:Fedora 25 KDE 系统内核:4.10.16-200.fc25.x86_64 #1 网卡:BCM43142 1.识别自己的网卡型号:命令:lspci | grep -i broadcom ...

  10. 『转』谷歌发布Windows版Chrome App Launcher

    据国外媒体报道,谷歌发布了Windows版Chrome App Launcher,Windows用户现在因此能够使用谷歌的许多网络应用,如Chrome浏览器.Gmail.Google Drive和Ch ...