TTouchKeyboard: send keystroke to other program?

拥有回忆 提交于 2019-12-05 09:13:46

TTouchKeyboard sends the keys to the current control focused: so if you have a TEdit with the focus, the TEdit will receive the key...

You can create a form which contains the TTouchKeyboard and add this procedure:

  protected
    procedure CreateParams(var Params: TCreateParams); override;

...

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do
  begin
    ExStyle   := ExStyle or WS_EX_NOACTIVATE;
    WndParent := GetDesktopwindow;
  end;
end;

Your form can't have the focus... so, the key is sent to the previous focused control. (I have just tested it and it works: the key has been sent to this webpage)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!