块控制+ Alt + DeleteAlt、Delete

由网友(巴黎街头的一抹阳光)分享简介:我做在C#中的在线测验项目。测试客户端是在Windows XP上运行的Windows桌面应用程序。我需要阻止的控制 + ALT + 从最小化/关闭应用程序中删除组合键prevent学生。 I am doing an Online Quiz project in C#. The test client is a W...

我做在C#中的在线测验项目。测试客户端是在Windows XP上运行的Windows桌面应用程序。我需要阻止的控制 + ALT + 从最小化/关闭应用程序中删除组合键prevent学生。

I am doing an Online Quiz project in C#. The test client is a Windows Desktop Application running on Windows XP. I need to block the control+alt+delete key combination to prevent students from minimizing/closing the application.

使用PInvoke的是好的,对我来说。

Using PInvoke is okay for me.

我知道这是绝对有可能的,因为我已经看到了三个应用程序这样做。他们都是私有的,所以我没有办法知道它是怎么做的。

I know this is definitely possible because I have seen three applications doing this. They are all proprietary, so I have no way of knowing how it was done.

推荐答案

对于Windows XP,要做到这一点正确的方法是创建自己的图形标识和身份验证动态链接库,或GINA.DLL的简称。 下面是关于它的MSDN文章。这个DLL导出一组与Winlogon进程交互功能,并提供了用户界面的登录请求 - 安全动作序列事件。主要的登录请求是CTRL-ALT-DELETE响应。该标准GINA.DLL调用登录屏幕或任务管理器/注销对话框。这不是太难创建自己的吉娜但它确实需要C / C ++编码,而不是C#和它很容易使系统无法启动。这并不能阻止pressing F8人在启动和选择安全启动选项,这将不会加载自定义GINA.DLL。

For Windows XP, the correct way to do this is to create your own Graphical Identification and Authentication Dynamic Link Library, or gina.dll for short. Here's an MSDN article about it. This DLL exports a set of functions that interact with the Winlogon process and provides the user interface to logon requests - the Secure Action Sequence event. The main logon request is the ctrl-alt-delete response. The standard gina.dll invokes the logon screen or the task manager/logoff dialog. It's not too difficult to create your own gina but it does require C/C++ coding and not C# and it is quite easy to make the system fail to boot. This does not stop people from pressing F8 at boot up and selecting the Safe Boot option, which won't load the custom gina.dll.

编辑:我还要说,你并不需要实现所有实施吉娜是所需的功能,可以动态加载previous GINA.DLL并通过所有你不感兴趣的呼叫到旧GINA.DLL

I should also say that you don't need to implement all the functions the gina is required to implement, you can dynamically load the previous gina.dll and pass all the calls you're not interested in to the old gina.dll.

编辑2:这个不起作用与Vista / Win7的,因为他们更改了登录过程的体系结构。它仍然有可能禁用VISTA / Win7的CTRL-ALT-DELETE,但它需要一个不同的机制 - 有关于它的MSDN文章某处

EDIT 2: This does not work with Vista/Win7 as they changed the architecture of the logon process. It is still possible to disable ctrl-alt-delete in Vista/Win7 but it requires a different mechanism - there are MSDN articles about it somewhere.

编辑3:这里包含源$ C ​​$ c键使GINA.DLL 它是用DevStudio的2005年文件GinaInterface.cpp详细说明来安装新GINA.DLL库所需的步骤建立。这将禁用欢迎屏幕,它与'preSS CRTL-Alt-Del组合登录对话框取代。按照现在的情况,还有这个和标准GINA.DLL没有区别,所有的吉娜相关的调用都将传递到原来的GINA.DLL文件(称为MSGIN​​A.DLL在Windows System32文件夹中)。要禁用CTRL-ALT-DEL键preSS,更新GinaInterface.cpp功能WlxLoggedOnSAS里边。要停止CTRL-ALT-DEL,而您的应用程序正在运行,你可以创建一个名为互斥体(CreateMutex),并测试其presence在GINA.DLL,停止CTRL-ALT-DEL如果互斥体存在。

EDIT 3: Here's a ZIP file containing the source code to make a gina.dll It was built using DevStudio 2005. The file GinaInterface.cpp details the steps needed to install the new gina.dll library. This will disable the "Welcome" screen and replace it with the 'press crtl-alt-del' to login dialog. As it stands, there is no difference between this and a standard gina.dll, all the gina related calls are passed through to the original gina.dll file (called msgina.dll in the WindowsSystem32 folder). To disable the ctrl-alt-del key press, update the function WlxLoggedOnSAS in GinaInterface.cpp. To stop ctrl-alt-del whilst your application is running, you could create a named mutex (CreateMutex) and test for its presence in the gina.dll, stopping ctrl-alt-del if the mutex exists.

阅读全文

相关推荐

最新文章