模拟没有sendkey的Keypress. [英] Simulate Keypress without sendkeys.

查看:159
本文介绍了模拟没有sendkey的Keypress.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自动存储塔程序正在运行,如果您按键盘上的某些按钮,它会发出通知.我想使用我自己的程序在特定时间段内在后台运行按键.

我已经使用过sendkeys.send和my.computer.keyboard.sendkeys,但是它不起作用.
这很奇怪,因为当我打开记事本时,按键会起作用.
如果您自己按下按钮,自动点唱机程序公告将起作用.

我想知道是否还有另一种方法可以进行按键操作.

I have a jukebox program running that does announcements if you press certain buttons on the keyboard. I wanted to do the key presses using my own program, running in the background, based on certain time periods.

I have used sendkeys.send and my.computer.keyboard.sendkeys but it doesn''t work.
This is strange because when I have notepad open the key press works.
The jukebox program announcements does work if you press the button yourself.

I was wondering if there was another way to do the key press.

推荐答案

Windows Vista和更高版本中的用户帐户控制可以阻止发送键.

如果一个进程具有提升的权限,它将无法将密钥发送给另一个进程.

阅读以下MSDN文章中的注释:

SendKeys类 [
User account control in windows Vista and later can block send keys.

If one process has elevated permissions it won''t be able to send keys to another.

Read the notes in the follow MSDN article:

SendKeys Class[^]


这篇关于模拟没有sendkey的Keypress.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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