模拟keybord / mouse动作来控制由delphi编写的程序 [英] Simulate the keybord/mouse actions to control a program which was written by delphi

查看:59
本文介绍了模拟keybord / mouse动作来控制由delphi编写的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我试图模拟delphi / pascal编写的程序的操作。在查看spy ++消息和windows样式和窗口类之后,我发现目标程序是由delphi编写的,使用了很多VCL。控件类和wm_消息不是标准的win32 WM_消息。

有人告诉我使用delphi IDE编写模拟代码,我不知道。

是否还有其他方法可以使用windows标准WM_来操作目标程序形式交往?更好地使用C / C ++



我尝试过:



VCL控件像TBitBtns / TEdit / TComboBox和其他数据访问控件一起使用数据库,这些控件只能接受简单的WM_CHAR WM_CLICK,我只能获取windows / controls capture / style / window类等。

可以轻松访问编辑/列表框/树视图等标准win32控件,文本/列项信息/注释项。但是VCL使用sef-defined WM_ msessages。在vcl中访问此信息的任何方法?

Here I'm trying to simulate the operations on a program written by delphi/pascal.After looking the spy++ message and windows styles and window class , I find out the target program was written by delphi ,using a lot VCL. the control class and the wm_ messages are not standard win32 WM_ messages.
Some one told me to use delphi IDE to write the simulate code,which I have no idea.
Is there any other method to operate the target program using windows standard WM_ messsages? better using C/C++

What I have tried:

The VCL controls like TBitBtns / TEdit / TComboBox and other data access controls working together with database,these controls can only accept the simple WM_CHAR WM_CLICK , I can only get the windows/controls capture / style / window class etc.
Standard win32 controls like Edit/listbox/treeview could be easily accessed,the text/column item info/note items. But the VCL use the sef-define WM_ msessages. Any method to access this info in vcl ?

推荐答案

引用:

有没有使用Windows标准WM_消息来操作目标程序的任何其他方法?更好地使用C / C ++

Is there any other method to operate the target program using windows standard WM_ messsages? better using C/C++



当然有。但是你应该使用 SendInput 函数。请参阅:

  • 您无法使用PostMessage模拟键盘输入 - The Old新事物 [ ^ ]。
  • SendInput功能(Windows) [ ^ ]。

  • Of course there is. However you should possibly use SendInput function for that. See:

    • You can’t simulate keyboard input with PostMessage – The Old New Thing[^].
    • SendInput function (Windows)[^].

    • 我使用AutoHotkey来控制Delphi应用程序。 Autohotkey允许您使用Delphi应用程序编写大多数用户交互的脚本。可以使用位置或类名称引用输入。需要记住的重要一点是,Delphi创建了一个不可见的主窗口来与Windows消息传递系统进行交互。这个不可见的主窗口不是主应用程序窗口。因此,如果您想与Delphi应用程序用户界面进行交互,最好学习这个应用程序设计,这样您就可以实现目标。

      看看 https://autohotkey.com/board/topic/49125-autohotkey-and-delphi/

      The通常的Delphi应用程序的显示窗口不是主窗口。通常,主窗口是0x0大小的窗口,类名为TApplication。显示的窗口只是它的一个拥有窗口。所以,如果你想要正常的最小化,你应该尽量减少主窗口TApplication,而不是显示的窗口。如果您认为这很麻烦,您可以尝试使用带有SC_MINIMIZE的WM_SYSCOMMAND来显示窗口,该窗口应该模仿最小化按钮上的点击。
      I have used AutoHotkey to control Delphi applications. Autohotkey allows you to script most user interactions with a Delphi application. The input can be referenced using position or class names. The important point to remember is that Delphi creates an invisible Main Window to interact with the windows messaging system. This invisible main window is not the main application window. So if you want to interact with the Delphi app user interface it is best to study this application design so you can accomplish your objective.
      Take a look at https://autohotkey.com/board/topic/49125-autohotkey-and-delphi/
      "The displayed window of usual Delphi app is not the main window. Typically, the main window is 0x0 sized window with the class name TApplication. And the displayed window is just an owned window of it. So, if you want normal minimize, you should minimize the main window TApplication, not the displayed window. If you think it's cumbersome to do, you may try instead WM_SYSCOMMAND with SC_MINIMIZE to the displayed window, which is supposed to mimic the click on minimize button. "


      这篇关于模拟keybord / mouse动作来控制由delphi编写的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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