保持一个Windows应用程序在其他窗口的顶部和焦点 - 永远 [英] Keeping a Windows application on top of other windows and in focus - always

查看:432
本文介绍了保持一个Windows应用程序在其他窗口的顶部和焦点 - 永远的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个信息亭应用程序,我想确保它始终是,无论什么时候,在其他Windows应用程序顶部和Windows任务栏。

I am creating a kiosk application and I want to ensure it is always, no matter what, on top of other Windows applications and the Windows task bar.

我已经阻塞的Windows键盘命令(使用Alt-Tab等),但仍然存在的情况下,可能会导致应用程序启动并窃取屏幕。

I am already blocking Windows keyboard commands (alt-tab, etc) but there are still situations that could cause an application to launch and steal the screen.

是否有可能钩到Windows,从.NET和不断测试应用程序是否具有焦点,并在上面,如果没有的话给它重点,并使其在上面?

Is it possible to hook into Windows from .NET and continually test whether the application has focus and is on top, and if not then give it focus and make it on top?

推荐答案

其实我已经参与了生产亭(这是Windows 2000中,不过)。解决的办法是运行应用程序作为外壳。您完成此部分由以与应用程序替换Explorer.exe中的壳价值:

I've actually worked on a production kiosk (it was Windows 2000, however). The solution was to run our application as the shell. You accomplish this in part by replacing Explorer.exe with your application in the Shell value at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

请参阅这里一些更多的信息。

See here for some more information.

现在,我们也有一个秘密(嗯...混淆)的方式来关闭我们的应用程序。然后,我们将调出任务管理器(控制 - <大骨节病>移 - <大骨节病> Esc键),并选择文件/新建任务运行的Explorer.exe,弹出一个壳,然后有。

Now, we did have a secret (err... obfuscated) way to shut down our app. Then we would bring up Task Manager (Ctrl-Shift-Esc) and select File/New Task to run Explorer.exe to bring up a shell right then and there.

顺便说一句,当你的工作是这样的系统上,你自然会非常非常精通键盘和所有它的意思是使用键盘快捷键在Windows,因为你可能不会有一个方便的方式或地方放一个鼠标。

As an aside, when you work on a system like this, you naturally become very very proficient with the keyboard and all that it means to use keyboard shortcuts in Windows because you will likely not have a convenient way or place to put a mouse.

这篇关于保持一个Windows应用程序在其他窗口的顶部和焦点 - 永远的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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