2 ways:

1. under TForm:
   if assigned(focused) then
      Focused.keydown(key,keychar,[]);

2. using screen object:

if assigned(Screen.focusControl) then
      Screen.focusControl.keydown(key,keychar,[]);

I think lots of people want to know this.

Best regards

John Shi

http://bbs.2ccc.com/topic.asp?topicid=513745

simulate windows postmessage or keydown的更多相关文章

  1. simulate windows touch input

    更多信息请参考页面http://social.technet.microsoft.com/wiki/contents/articles/6460.simulating-touch-input-in-w ...

  2. ystem.Windows.Forms.SplitContainer : ContainerControl, ISupportInitialize

    #region 程序集 System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  3. System.Windows.Forms.Control : Component, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject....

    #region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  4. TAxThread - Inter thread message based communication - Delphi

    http://www.cybletter.com/index.php?id=3 http://www.cybletter.com/index.php?id=30 Source Code http:// ...

  5. 【C#/WPF】键盘事件

    需求:按下回车键,触发事件. 搜MSDN时,看到的键盘事件是System.Windows.Forms里的,在WPF中没法用: https://msdn.microsoft.com/zh-tw/libr ...

  6. Qt 按键键值 与 相关字符串 的映射表(转)

    Qt快捷键 映射     "Esc",/*Qt::Key_Escape 0x01000000 */ "Tab",/*Qt::Key_Tab 0x01000001 ...

  7. 完美解决前端跨域之 easyXDM 的使用和解析

    前端跨域问题在大型网站中是比较常见的问题.本文详细介绍了利用 easyXDM 解决前端跨域的原理细节和使用细节,具体使用时可以在文中代码实例的基础上扩展完成. 0.背景 因个别网络运营商存在 HTTP ...

  8. Qt事件与常用事件处理、过滤

    转载: https://blog.csdn.net/apollon_krj/article/category/6939539 https://blog.csdn.net/qq_41072190/art ...

  9. PostMessage 向Windows窗口发送Alt组合键

    PostMessage 向Windows窗口发送Alt组合键 关于向Windows窗口发送Alt组合键的问题,这个真是经典问题啊,在网上找了一下,问的人N多,方法差不多, 但就是没有很好解决问题. 之 ...

随机推荐

  1. linux image writes boot log to console

  2. UVa 116: Undirectional TSP

    简单动态规划题.用取模实现第一行与最后一行连续,注意取字典序即可. 我的解题代码如下: #include <iostream> #include <cstdio> #inclu ...

  3. 简单JVM思维导图

  4. 【Ruby on Rails 学习一】ubuntu14.04配置rvm与ruby

    要安装ruby,首先要安装rvm,借助rvm安装ruby rvm 的全称是 Ruby Version Manager ,是一款由 Wayne E. Seguin  开发的一款命令行工具.rvm 能够让 ...

  5. 日期函数(SqlServer)

    1.常用日期方法(下面的GetDate() = '2006-11-08 13:37:56.233') (1)DATENAME ( datepart ,date ) 返回表示指定日期的指定日期部分的字符 ...

  6. 验证合法的url

    package test; import java.util.regex.Matcher;import java.util.regex.Pattern; public class Test { pub ...

  7. (3)选择元素——(15)总结(Summary)

    With the techniques that we have covered in this chapter, we should now be able to locate sets of el ...

  8. Linux安装WebLogic12

    # groupadd weblogic# useradd -g weblogic weblogic# passwd weblogic# mkdir -p /var/bea# chown -R webl ...

  9. [Angular 2] Using Array ...spread to enforce Pipe immutability

    Pipes need a new reference or else they will not update their output. In this lesson you will use th ...

  10. Java基础知识强化67:基本类型包装类之Integer直接赋值的面试题

    1. 面试题: Integer  i = 1: i += 1: 做了哪些事情? (1)其中Integer i =1:做了自动装箱( 使用valueOf()方法,int ---> Integer ...