node.js - 在 Node WebKit 中检测屏幕锁定

标签 node.js windows node-webkit

我正在使用 Node WebKit 开发适用于 Windows 的应用程序,并希望在用户锁定屏幕时执行一些任务,例如停止某些计时器。在 Node WebKit 中是否有可能。我查看了屏幕几何形状,但它似乎只提供主要针对多屏幕应用程序的屏幕数量检测。

谢谢

最佳答案

Use the API函数 OpenInputDesktop来自库 user32.dll。可以通过 node-ffi 调用电话模块:

var FFI = require('node-ffi');

// user32.dll
var user32 = new FFI.Library('user32', {
   'OpenInputDesktop': [
      'IntPtr', [ 'int32', 'bool', 'int32' ]
   ]
});

关于node.js - 在 Node WebKit 中检测屏幕锁定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34446237/

相关文章:

wpf - WebBrowser 控件不打开链接

node.js - 在 Node webkit 上使用 phantom

Node-Webkit:如何最小化窗口?

node.js - NodeJS : Insert record in dynamodb if not exist

node.js - "in a frame because it set ' X-Frame-Options ' to ' sameorigin '."在 Node APP中

node.js - Nodejs中如何共享变量?

java - 在 Windows XP 上获取 Apppath

windows - gmake 使用 sh.exe 会导致构建错误

node.js - Node webkit 的替代品? (重要的文件大小)

javascript - Node.js 视频上传获取Codec