Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

I was requested to make something like this: http://www.e-motional.com/TScreenLock.htm[^]. The idea is to have Windows locked for interactions but to see the desktop as it would not be locked (have a live view). When user does any mouse or keyboard event, it sohuld ask for credentials.
It looks straightforward to make a transparent screensaver. I made it. Works like a charm as long as it is not started by the system itself. At that point all application windows disappear and only the windows background is visible below.

If still valid for Windows 7, here[^] is stated, that ScreenSavers run on their own desktop.

Is there any way to overcome this?
Thank you.
Posted
Comments
CHill60 17-Jun-15 11:25am    
Not posting this as a solution as it may be way off-base... but have you considered a global key and mouse hook - if input received then get logon/password and validate them before "releasing" the screen.
In a previous post (job) we had a "mouse-twitcher" in place to stop the PC from auto-locking (not sure how this would interfere with a global hook though)
Zoltán Zörgő 17-Jun-15 14:34pm    
Yes, that might be the other direction. Still, it looks a little bit more complicated than just placing a global hook. The main issue would be Ctrl-Alt-Del. There is an approach for that too, but looks to be a hard way...
Sergey Alexandrovich Kryukov 17-Jun-15 15:20pm    
You are absolutely right. That said, the global keyboard hook won't help, as far as I can see. I did not know that Windows 7 runs the screen saver on a separate desktop, which explains your problem. If I'm not much mistaken, I developed some screen saver only for W2K and XP, where it behaves like the usual windows (which one can merely maximize or use no client area), and it was on a regular desktop. At that time, I actually used the desktop for some screen server effect, so I am sure your functionality could be easily implemented for those Windows version.

If, as you say, Windows 7 starts the screen saver automatically always in a separate desktop (which could be done, say, for certain safety reasons), the problem is not that your screen saver shows something wrong in transparent implementation, the problem is that the main desktop simply does not exist or is not shown at this time. If your information and my reasoning is correct, it would mean that this problem, as you formulate it, is not solvable.

I won't post it as a formal solution, too, because — who knows?.. The search shows some commercial products which promise such feature for Windows 7. :-)

—SA
Philippe Mori 17-Jun-15 23:25pm    
I don't remember from which version a separate desktop was used for the screen safer. At some point, that feature was only in professionnal version and screen safer like Bubble would display over actual desktop content in home edition and over a blue background on pro version. As of Windows 8.1, the screen safer is always displayed on a different desktop.

By the way, it was done that way for safety reason. Thus it would not be a good idea to bypass it as doing so it might be considered as a breach in the system and the OS might then be made even more secure. Similar to UAC stuff or virus/antivirus war. If one work around the system, safety of the system might get increaded and then it become still harder to make things. As much as possible, one should not try to work around things that were put there for security.

So I really recommand you to stop trying to work around the system. At some point, the system was made more secure by using a distinct desktop for screen safer. By doing that, it become essentially impossible for example to create a fake screen safer that would record user password.
[no name] 18-Jun-15 14:12pm    
Philippe - your advice is not realistic. There are lots of applications that want a secure way to display a windows desktop in a read-only fashion.

1 solution

This is pure speculation. I've not tried it.

Since your screen saver runs on it's own desktop - you'll need a way to attach to the "real" desktop and make a copy of the pixels to display in your screen saver.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms687107%28v=vs.85%29.aspx[^]

If the real desktop image is updated frequently - you may need to poll for pixel changes.

It might also be possible to tell Windows to switch back to the real desktop.
 
Share this answer
 
Comments
Philippe Mori 17-Jun-15 23:29pm    
Not a good idea to post solution to go around security that was added to the system...

Anyway the reason that another desktop is used is to prevent a screen saver to interact with the normal desktop or to fake disalog asking the password and other similar things that could compromise the system.
[no name] 18-Jun-15 14:07pm    
The OP wants to provide a read only screen - like a kiosk - while keeping the machine secure. Displaying the information on a separate desktop that does not accept input would actually be more secure than what an out-of-the box Windows install provides today.

The alternative is to disable the screen saver and block user input - which has other issues - and isn't any more secure.

Using your example - a screen saver that prompts for a password - you're already compromised.

Please post your solution that satisfies the OPs requirements and provides adequate security.
Philippe Mori 18-Jun-15 15:05pm    
I don't have any alternative. If a screen saver show user desktop content, then in some situation like in a company security could be compromized if someone could see sensible informations (maybe a popup Windows that would popup while the user is not there). If you do you own work-around not using a screen saver, then the system might be less secure that one that would run a real screen saver.
Zoltán Zörgő 19-Jun-15 14:18pm    
Just a note: I wasn't he one who downvoted you.
Although I can accept the general view of Philippe Mori, that this could let people see what's going on the desktop, this is the goal of it. A screen saver is just a screen saver. As long as it is the decision of the user to disable it or change the the timeout - it can be the decision of the user to have a transparent screensaver. Yes, of course, with a GPO the administrator can stop the user to disable the screensaver or alter the timeout - but can also stop him from changing the screensaver or from adding a new one. And that's the decision of the administrator - and not of Microsoft.
I think that the screen saver itself is not a security tool.

My goal is exactly what's described on the web page of the tool I have linked in my post: the application running on the workstation does not provide the feature to lock only the user interactions - so I need to add this from system side.

Your idea might work. Still it is not viable in my case, as the application is displaying the result of an industrial camera. I might not be able to capture at all or at the desired refresh rate what's on the original desktop. If it is an overlayed image, I would need a mirror driver to do that. But as long as it is not displayed, the mirror driver won't be useful either...

I think I need to abandon this direction...
Thank you trough for your post.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900