推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
lon91ong
V2EX  ›  Python

双开的游戏窗口属性 bug

  •  
  •   lon91ong · Sep 21, 2023 · 1829 views
    This topic created in 1105 days ago, the information mentioned may be changed or developed.

    在上一个问题《 pywin32 实现的鼠标后台点击功能略有不足》多番试验的基础上,发现问题的症结在于强制双开了原本不支持双开的应用导致的窗口属性存在 bug

    双开方法

    PC 端微信通过批处理双开,或者点选快捷方式后迅速点击两次回车键双开,分别登录两个账号后各自打开小程序游戏窗口

    问题描述

    使用 pywin32 的 PostMessage 方法在后台向窗口发送鼠标点击事件,双开的两个窗口一个正常,另外一个会抢前台窗口焦点。 参考《Not take focus, but allow interaction?》的方法,使用下面的命令设置窗口 WS_EX_NOACTIVATE 属性,强制使窗口无法激活,使用 spyxx 查看窗体属性验证设置命令执行正常

    SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_NOACTIVATE)

    对于能后台接收鼠标消息的正常窗体有效,表现为窗口无法接收键盘输入, 鼠标点击窗体也无法激活

    而无法后台接收鼠标消息(会抢活动窗口焦点)的窗体小概率生效,大概率无效。

    请教大侠 有没有方法补全这种窗体 bug ,使之能正常接收后台鼠标消息。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2530 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:24 · PVG 21:24 · LAX 06:24 · JFK 09:24
    ♥ Do have faith in what you're doing.