检测应用程序启动时是否保持轮班
无论如何,当用户双击桌面上的应用程序图标来启动应用程序时,我是否可以查明用户是否一直按住 Shift(CTRL 或任何其他键)?
我有一个 WPF 应用程序,我希望能够检测用户在启动应用程序(通过双击)时是否按住了任何特殊键,以便在按下该键时我可以更改一些设置。
我尝试过:
private void Application_Startup(object sender, StartupEventArgs e)
{
}
但找不到任何方法来检测按键按下。
Is there anyway that I can find out if user has been holding Shift (CTRL or any other key) when she/he double click on application icon from desktop to start the application?
I have a WPF application where I want to be able to detect if the user has been holding any special key when he/she started the application (by double clicking) so I can change some settings if the key was pressed.
I tried :
private void Application_Startup(object sender, StartupEventArgs e)
{
}
but couldn't find any way to detect the key down .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的应用程序启动事件中写入以下代码:
Write this code in your application start-up event:
我认为你应该看看这个问题: Keyboard modifiers during applicationstartup 这可能是什么你正在寻找。
希望有帮助。
I think you should look at this question: Keyboard modifiers during application startup This is probably what you're looking for.
Hope it helps.