[译]用MFC方式锁定WorkStation
By robot-v1.0
本文链接 https://www.kyfws.com/applications/lock-workstation-the-mfc-way-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 3 分钟阅读 - 1193 个词 阅读量 0[译]用MFC方式锁定WorkStation
原文地址:https://www.codeproject.com/Articles/7806/Lock-WorkStation-the-MFC-way
原文作者:Vikram Kashyap
译文由本站 robot-v1.0 翻译
前言
Allows the user to lock the workstation during lunch or meeting hours
允许用户在午餐或开会时间锁定工作站
介绍(Introduction)
这是一个非常小的应用程序,它演示了基于全屏对话框的应用程序的用法.执行该应用程序后,它将进入系统托盘,并带有一个钥匙作为托盘图标.(This is a very small application that demonstrates the use of fullscreen dialog based applications. When the application is executed it goes and sits inside the systray with a key as a tray icon.)
使用应用程序(Using the application)
- 要锁定屏幕,用户必须按数字键盘上的Ctrl + Alt +减号的组合键.(To lock the screen, the user has to press a key combination of Ctrl+Alt+Minus sign on the numpad.)
- 要解锁屏幕,要求用户输入密码.(To unlock the screen user is asked to enter a password.)
- 在锁定模式下,鼠标光标和插入符号在正常的引导屏幕中被隐藏,同时Alt + Tab,Ctrl + Alt + Del键也被禁用.(During lock mode, mouse cursor and caret are hidden as it happens in a normal booting screen, also Alt+Tab, Ctrl+Alt+Del keys are disabled.)
但是用户仍然可以按Ctrl + Esc激活"开始"菜单,为了禁用任务栏/开始按钮,(But the user still can press Ctrl+Esc to activate the Start menu, In order to disable the Taskbar/StartButton,)
FindWindowEx
已使用API,并且在成功获取句柄之后,任务栏被禁用,因此用户也无法单击任务栏.当前,密码已在应用程序内部硬编码为" vkpassword".但是开发人员可以轻松地修改应用程序,以将密码存储在注册表或系统中的某些加密文件中.已经实现了热键的使用.要锁定屏幕,用户需要在数字键盘上按Ctrl + Alt +减号.特别感谢Chris Maunder的贡献(API has been used and after taking the handle successfully the Taskbar is disabled, so that the user is not able to clcik on the TaskBar also. Currently the password has been hardcoded inside the application as “vkpassword”. But developers can easily modify the application to store the password in registry or some encrypted file in the system. Use of Hotkeys have been implemented. To lock the screen user needs to press Ctrl+Alt+Minus sign on the numpad. A special thanks to Chris Maunder for his)CSystemTray
应用程序中使用的图标类.(icon class used in the application.)
如何安装?(How to get it installed?)
- 解压缩演示exe文件(Unzip the demo exe file)
- 双击exe文件(Double click on the exe file)
- 该应用程序可以放在系统托盘内(感谢克里斯!!)(The application goes and sits inside the SystemTray (thanx Chris!!)) 在数字键盘上按Ctrl + Alt +减号.现在系统已锁定,要解锁,请输入密码" vkpassword",当然不要使用双引号.(Press Ctrl+Alt+Minus sign on Numpad. The system is locked now, to unlock enter password as “vkpassword” of course without the double quotes.)
笔记(Notes)
该应用程序在注册表中进行了一些更改,以便在计算机启动期间运行,从而使用注册表hack禁用了任务管理器.希望大家都一样,也不要忘记给我发送您的意见和建议,以使它更好.谢谢.(The application makes some changes in the registry, as to run during the computer start up, disabling the task manager using a registry hack. Hope you all will like the same and also don’t forget to send me ur comments, suggestions to make it better. Thanks.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC6 WinXP Windows Win2K MFC Visual-Studio Dev 新闻 翻译