如何动态填写表单到第三方应用程序? [英] How to dynamically fill forms to a third party application?

查看:95
本文介绍了如何动态填写表单到第三方应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关主题的知识:C / C ++,Windows API,C#以及其他内容。



我有一个用C#编写的应用程序。我们将其称为A.应用程序A使用Windows API使用SendInput模拟键盘按键(TAB,某些文本,SHIFT)( link )。我可以注意到,当在记事本等应用程序中使用这种模拟方法时,Chrome可以毫无问题地工作。



B应用程序,需要通过模拟键来填充,是用C / C ++编写的,但我不知道哪个版本和细节。如果有一个熟悉的,它是关于Micros Fidelio。



问题是当从应用程序A模拟TAB键时,应用程序B停止,阻塞,检测不到TAB键按。即使通过物理按下TAB键盘,光标也不会从当前位置移动。只有几个关键的新闻通过后。另一件事是Alt + N等键盘快捷键有时也无法正常工作。是否有模拟键的缓冲区,当你填充缓冲区时,你无法执行下一次推送?







我的问题是,有没有人有办法解决省略TAB的问题?



我尝试了什么:



我尝试了100,250,500毫秒品种的TAB之间的延迟,但它们仍然可以检测到。



我注意到了什么:

*重新启动应用程序B时模拟正在运行,但经过一段时间后它再次累积并开始检测

*当键盘语言切换到西里尔语时,键盘快捷键不起作用,西里尔语文字的写入消失 - ?????



我也测试了AutoHotKey还有一个问题。

解决方案

也许这些文章会有所帮助: https://dzone.com/article s / sending-keys-other-apps [ ^ ]

和:发送用C#敲击另一个应用程序 [ ^ ]



另一个选项可能是使用自动化工具,如 AutoHotkey ,请参阅此处的概述: https://www.slant.co/topics/2195/~gui-automation-工具换窗口 [ ^ ]

Knowledge of the topic: C / C++, Windows API, C#, and something along these.

I have an application written on C#. We will call it A. Application A uses the Windows API to simulate keyboard key press (TAB, some text, SHIFT) using SendInput (link). I can note that when using this simulation method in applications such as Notepad, Chrome works without any problems.

The B application, which needs to be filled in by simulating keys, is written in C/C++, but I do not know which version and details. If there is a familiar one, it's about Micros Fidelio.

The problem is that when simulating the TAB keys from application A, application B stops, jams, undetect TAB key press. Even by physically pressing the TAB keyboard the cursor does not move from its current position. Only after a few key press passes. Another thing that happens is keyboard shortcuts like Alt + N also do not work sometimes and sometimes work. Is there any buffer with the simulated keys and when you fill that buffer you can not perform the next push?



My question is, does anyone have a way to solve the problem of omitting TABs?

What I have tried:

I've tried out delay between TABs of the 100, 250, 500 ms variety, but they still detect.

What I have noticed:
* when restarting Application B the simulation is working, but after a certain period of time it accumulates again and starts to detect
* when the keyboard language is switched to Cyrillic, the keyboard shortcuts do not work and the writing of Cyrillic text goes out - ?????

I have test also AutoHotKey and there is a problem there also.

解决方案

Maybe these articles will be of help: https://dzone.com/articles/sending-keys-other-apps[^]
and: Sending Keystrokes to another Application in C#[^]

Another option might be using an automation tool like AutoHotkey, see overview here: https://www.slant.co/topics/2195/~gui-automation-tools-for-windows[^]


这篇关于如何动态填写表单到第三方应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆