保持对表单的关注
我正在使用 C# .NET 为盲人开发一个软件。
该软件仅适用于键盘和语音转语音。
当计算机启动时,该程序位于启动菜单中,但由于某种原因,该程序被激活时不在焦点中,因此除非将焦点重新转移到该程序,否则该程序无法正常工作。
我找到了一种方法,即使软件没有聚焦,也可以挂钩键盘按键,但我不认为这是一个解决方案。
我想要一种方法来执行以下一项或多项操作:
- 确保程序在启动时加载并处于焦点位置。
- 保持对程序的关注(该计算机将仅使用该程序运行)。
- 找到一个键盘快捷键,最好只有一个键(不是 Alt + Tab)将焦点返回到程序。
I am developing a software for a blind individual in C# .NET.
The software works only with the keyboard and voice to speech.
When the computer starts the program is in the start up menu, but for some reason the program is activated not in focus therefore it does not work properly unless the focus is re transferred to it.
I found a way to hook keyboard keys even when the software is not in focus but I don't see that as a solution.
I want a way to do one or more of the following:
- Make sure the program loads on start up and is in focus.
- Maintain focus on the program (this computer will be run only using this program).
- Find a keyboard shortcut, preferably one key only (not Alt + Tab) to return focus to the program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法可以解决这个问题,即您可以在启动控制台应用程序上运行,该应用程序将运行并集中您的程序:
您可以托管 Windows 服务应用程序并使用计时器检查您的应用程序是否处于活动状态并集中,或者您可以使用热键来启动它回到焦点:http://www.codeproject.com/KB/miscctrl/ashsimplehotkeys。 aspx
编辑
这是控制台应用程序,这将使您的应用程序保持活力并集中(经过测试)。我需要找到 Windows 服务的解决方案,因为自从 Vista 以来,某些内容发生了变化,当从服务中凝视时,表单是不可见的:P
There are many ways you can solve this ie you can run on startup console app that will run and focus your program:
You can host a windows service application and using timer check if your app is alive and is focused or you can use hotkeys to bring it back focused: http://www.codeproject.com/KB/miscctrl/ashsimplehotkeys.aspx
Edited
this is console application, that will keep your app alive and focused (tested). i need to find walkaround for windows service becouse since vista something changed and form is invisible when stared from service :P