我在SWT中开发了一个java应用程序,应该在作为kiosk运行的Windows系统上运行。应用程序应该是系统中运行的唯一应用程序,应该在系统启动后立即打开。应禁用任务管理器,Windows开始菜单,热键等所有内容(例如参见http://www.codeproject.com/Articles/7392/Lock-Windows-Desktop)。该应用程序还有一个内置管理员用户,可以再次激活所有可能在系统中进行更改的东西。这些东西已经实施了。问题是,当Windows启动时,它会持续几秒钟直到应用程序打开,在这短时间内,用户会看到所有内容(在应用程序启动之前不会禁用任何内容)。我搜索过互联网,唯一的解决方案似乎是在注册表中替换标准的Windows shell。现在问题来了:
有谁知道如何编写 shell for windows
或者您有任何其他想法如何实现这一目标?
由于
答案 0 :(得分:4)
由于我试图完成的事情变得复杂而且直到现在还没有人回答,我将根据我实施的事情自己回答这个问题。
为了有可能从桌面启动我的应用程序(因为我不得不删除它而不存在),我试图实现一种任务栏。我实现了一个带有菜单栏和零高度
的SWT对话框....
WindowsSystemUtility.disableWindowsFunctionality(true);
shell = new Shell(getParent(), getStyle());
createMenu();
shell.layout();
shell.pack();
Rectangle screenBounds = getParent().getMonitor().getBounds();
int monitorWidth = screenBounds.width;
int monitorHeight = screenBounds.height;
//System.out.println(monitorWidth + ", " + monitorHeight);
int dialogWidth = monitorWidth;
int dialogHeight = 0; //height 0 - > shell has no height. only menu is shown
Rectangle shellBounds = shell.computeTrim(0, 0, dialogWidth, dialogHeight);
shell.setSize(shellBounds.width, shellBounds.height);
//place the dialog
int x = 0;
int y = 0; //position north
//int y = monitorHeight - dialogHeight; //position south
shell.setLocation(x, y);
shell.open();
....
正如您看到此应用程序打开时,它会尝试禁用每个Windows功能而不是启动。在对话框的菜单栏中,我放入了1个带有2个菜单项的菜单。一个用于启动我的应用程序,一个用于管理员。生成一个jar,从jar中创建一个exe,并根据链接http://technet.microsoft.com/en-us/library/cc939862.aspx将其放在userinit键中。
我在http://www.codeproject.com/Articles/7392/Lock-Windows-Desktop中使用了来自dll的java生成代码来禁用任务栏,时钟,任务管理器等窗口功能以及用于安装密钥钩和http://umang-world.blogspot.de/2012/02/is-it-is-possible-to-disable-windows.html的链接http://www.kbdedit.com/manual/low_level_vk_list.html和http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx用于虚拟键映射。当用户使用菜单栏中的管理员项登录时,我通过相同的dll再次启用所有内容并停用挂钩。注销管理员会再次激活所有内容。
总结:
我希望这对于寻找相同事物的其他人有用。我在上面解释的是在windows xp sp3上测试并且工作正常。
答案 1 :(得分:0)
我已将 Windows 外壳程序更改为注册表上我的应用程序的启动器,而不是资源管理器,唯一有效的快捷方式是 ctrl-alt-del
以管理员身份运行 regedit
这将启动 cmd 而不是 explorer
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v Shell /t REG_SZ /d cmd.exe /f
将 Shell
值编辑为 c:\path\to\your\runMyShell.bat
所以只需放置一个脚本而不是像“runMyShell.bat”这样的资源管理器
@echo off
rem some Tasks To Be Done Before Custom Shell Loads
java -jar myshell.jar
从 control-alt-del 中删除任务管理器:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f