Node.js Windows 10/11:如何设置窗口的位置?

发布于 2025-01-13 12:19:59 字数 227 浏览 9 评论 0原文

是否可以在Windows 10/11中的node.js中设置/获取其他窗口的位置?

当 Windows 进入睡眠状态/显示器关闭时,我的一个窗口不断移动到我的第一个显示器,这非常烦人。

只是想制作一个快速脚本,可以通过名称获取/设置窗口的位置。

示例: 假设我想将窗口“Discord”移动到 x: 60, y: 55,我将如何在 node.js 中完成此操作?

Is it possible to set/get the position of other windows in node.js in Windows 10/11?

One of my windows keeps moving to my first monitor when Windows goes to sleep / the monitors turn off and it's extremely annoying.

Just want to make a quick script that can get/set a window's position by name.

Example:
Say I want to move the window "Discord" to x: 60, y: 55, how would I accomplish this in node.js?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南烟 2025-01-20 12:19:59

我使用 node-window-manager 它非常适合这些任务。您还可以在几个不同的包中使用节点中的 AutoHotKey,这对于“if window then”非常有用。还有“真正的”窗口管理器,可以将窗口保留在特定区域、屏幕、虚拟显示器等中。

I use node-window-manager it works pretty well for these tasks. You an also use AutoHotKey from node in a few different packages, which would be useful for "if window then". There are also "real" window managers that keep windows in specific regions, screens, virtual displays, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文