我怎么知道什么时候关闭或打开笔记本电脑的盖子 [英] how can i know when the lid of laptop is closed or opened

查看:136
本文介绍了我怎么知道什么时候关闭或打开笔记本电脑的盖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解决此问题的方法:: confused:
我想让代码检测笔记本电脑的机盖关闭或打开的时间.

i need a solution to this problem::confused:
i want a code detect when the lid of laptop closed or opened

推荐答案

您可以截获指示计算机进入睡眠模式的系统消息. >
编辑===================

除非笔记本电脑的驱动程序提供了另外的系统消息,表明主机盖已关闭,否则您将被拧紧.除此之外,并非所有的笔记本电脑都会实现这样的消息,并且您不能指望所有拥有同一台笔记本电脑的用户.你只能做那么多.

当然,您可能会编写一些可以帮助您的驱动程序软件,但随后,您将获得有史以来所有笔记本电脑都无法兼顾的兼容性.祝你好运.
You could intercept the system message that indicates that the computer is going into Sleep mode.

EDIT ====================

Unless the laptop has drivers that provide an additional system message indicating that the lid has closed, you''re screwed. Beyond that, not all laptops would implement such a message, and you can''t count on all of your users having the same laptop. You can only do so much.

Of course, you could probably write some driver software that helps you out, but then you get into the rather murky waters of compatibility ith ALL of the laptops ever made. Good luck with that.


如果用户将操作从睡眠更改为空,我想换一种方式
这会下降,我认为WM_DEVICECHANGE会很有用,
但是如何确定卸下的设备是显示器还是其他东西
i want a another way, if user change the action from sleep to nothing
this will fall, i think WM_DEVICECHANGE would be useful ,
but how to determine that that the device removed is monitor or something else


这篇关于我怎么知道什么时候关闭或打开笔记本电脑的盖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆