views:

123

answers:

1

I need to build a screensaver which simply draws a picture and displays some information around it. That all isn't any problem.

The problem is that I would like to lock the screen, which I do with the API-Call

Private Declare Function LockWorkStation Lib "user32.dll" () As Long
Call LockWorkStation()

and in fact have my screensaver drawn over the lockscreen. this doesn't work as the lockscreen hides any window run by the user.

Is there a way to programmatically tell the window to stay in front of everything

I've tried with Tipp 0214 from activevb.de (the page is in German, but the essential should be understandable even to English speaking readers) but this is only for all the other windows, not for the lockscreen.

Yes, it does need to be VB6 and changing to .NET isn't an option due to memory consumption.

+2  A: 

Could you not instead call to lock the workstation when you deactivate as a screen saver? In addition, I assume you're aware that the OS supports this as a feature itself?

I seem to remember the reason that you can't overdraw the logon windows is purely for security (if you could, someone nasty could trick you into typing their credentials into their dodgy screensaver, which would be a very bad thing)

Rowland Shaw
Well, locking the screen after the exit of my application would be a solution! But is this safe? Couldn't someone kill the application preventing it from calling the lock-method? If you mean with "the OS supports this" the little flag "Password protect" or similar, then this doesn't seem to work...
Atmocreations
+1 I seem to remember the same thing about overdrawing logon windows. Just tried to Google confirmation in the documentation but no luck - the Force must be weak in me today.
MarkJ
@Atmocreations Not sure *how* they'd kill your screensaver, if your screensaver is running (after all, I'd expect you to cancel the screen saver on mouse or keyboard input...)
Rowland Shaw
@Rowland: sure I will. Just wanted to know whether I can run into difficulties
Atmocreations