将项目添加到另一个应用程序的模式窗口的最佳方法?
将项目添加到另一个应用程序的模式窗口的最佳方法是什么?
我为此编写的简单示例(作为概念证明)使用了一种方法,我怀疑该方法对于微不足道的后台进程来说过于处理器密集型,但我很难想出替代方案。
例如,假设您是一名医生,正在使用处方数据填写模态窗口。您输入 30 天并补充 11 次,然后患者说他们想要 90 天并补充 3 次。原始应用程序(您无权访问其源代码)无法轻松转换。我编写了一个小实用程序,它监视这个特定的窗口(使用计时器和 findwindow),当它找到它时,使其自身可见并将其自身放置在目标模式窗口上的空白位置。当按下“30”按钮时,处方会写入 30 天,并可补充 11 次;当按下“90”按钮时,它会达到您所期望的效果。如果模态窗口移动,30 和 90 按钮也会随之移动。虽然这有效,但我担心在计时器上重复运行 findwindow 所涉及的开销。
1)有更好的方法吗? 2)我对此的担心是否正确? 3)你是在嘲笑我的杂技效率低下吗?
预先感谢 - 这里的人们给我留下了深刻的印象!
What's the best way to add items to another application's modal window?
The simple example I've written for this (as a proof of concept) uses a method that I suspect is much, much too processor intensive for a trivial background process but I am having trouble coming up with an alternative.
For example, let's say you are a physician filling out a modal window with prescription data. You enter it for 30 days with 11 refills and then the patient says they want 90 days with 3 refills. The original application (which you don't have access to the source for) has no easy conversion. I wrote a small utility which watches for this particular window (using a timer and findwindow) and when it finds it, makes itself visible and places itself in an empty spot on the target modal window. When the "30" button is pressed, the Rx is written for 30 days with 11 refills and when the "90" button is pressed, it does what you'd expect. If the modal window moves, the 30 and 90 buttons move with it. While this works, I am concerned about the overhead involved in running findwindow on a timer repeatedly.
1) is there a better way?
2) am I right to be concerned about this?
3) are you chuckling at how inefficient my kluge is?
Thanks in advance - I've been very impressed with the folks here!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的办法是...DLL注入。
The best way is... DLL injection.