使用Python的Win32模块(Win32Gui,Win32api,Win32UI,...)使用锁定窗口大小

发布于 2025-02-06 12:31:17 字数 325 浏览 4 评论 0原文

我有一个正在运行的外部应用程序,并且我获得了应用程序窗口的hwnd(为了简单起见,请说它是hwnd = win32gui.getforegernwindow()

>

​ 调整窗口的大小,从而锁定窗口的大小并使窗口大小静态?

因此,用户无法 位置

窗口


  • 是您要锁定大小的应用程序:no。 它是外部第三方应用程序。

I have an external application that is running and I obtained the application window's HWND (for sake of simplicity let's say it's hwnd = win32gui.GetForegroundWindow().

I am aware that I can resize and move the said window using win32gui.MoveWindow(...).

My question is: am I able to set the window somehow so that the user cannot resize the window, thus locking the window size, and making the window size static?

Bonus question: am I also able to "lock" the window position, preventing the user from moving the window position?

Some example lines of Python code would be appreciated.


Additional Clarification Notes

  • Python version: Python 3.X.X
  • Operating System: Windows 10
  • User is Administrator: Yes
  • Is it your own application you are trying to lock the size: No. It's an external 3rd party application.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文