Hi, I've been looking for a program that could terminate the windows screensaver cuz sometimes people put screensaver password on the computer and i dont like to have to reboot it anymore, So i looked on the web and i found a $40 program that u burn on cd but i dont have any money so i figured i'd try create my own screensaver killer program, I did a FindWindow for "Screen Saver" and then terminate process but that doesn't work and i haven't been able to figure it out, does anyone know a good way to terminate something like screensaver?

Posted on 2002-05-06 13:34:30 by poison
Well I'm going to just assume that you work on other people's pc's at work or something and that this is a completely legitimate situation.

I did something like this for this very reason awhile back for win98 but it wasn't in asm. What I did was grab the encrypted password from the registry, decrypt it, paste it into the screensaver password dialog and did a WM_KEYDOWN (I think) with <enter>.

The reason why it had to be burned onto a disc is because all the systems in my office had the cd autostart notification on by default and most of the users didn't know better to change it. So when the disc was inserted on a system with the screensaver on and password protected, the autorun.inf file started my program and the screensaver ended.

That should be enough to get you going in the right direction.

Good luck
Posted on 2002-05-06 14:59:36 by Will

HKEY_CURRENT_USER\Control Panel\Desktop\



Will disable the screen saver password. If you make a program to do it, put it on a CD with a file named "autorun.inf" containing these two lines:


Then insert the CD. If autorun is enabled, the password should be disabled. Otherwise just hit the reset switch and turn off the password ; )
Posted on 2002-05-07 15:48:19 by Citrus538

I was doing it the hard way. But it was fun decrypting the screensaver password.

Does that method work across all windows platforms?
Posted on 2002-05-07 15:49:54 by Will
On NT based systems (dunno about 9x systems), the screen saver runs on a separate desktop. So, while i haven't tried this, my guess is that a simple EnumProcesses will not find the screensaver on an NT system, you will have to enumerate the desktops first.

So why are you (trying) to use machines that have been locked by other people?
Posted on 2002-05-08 06:58:36 by sluggy
if you're not an admin on the workstation then you won't be allowed to change the registry either probably and with good reason for that.

Get XP for multiple concurrent sessions.
Posted on 2002-05-08 07:33:04 by Hiroshimator
Well I can't speak for poison but at the time I coded the program that I mentioned I was in a position where I needed to access certain other user's win9x machines after hours. The problem was that a lot of the users wouldn't power down their machines, and would just activate their screensavers. So this way I was able to keep what's left of my hair, not get any more gray hair, be a little more stress free, and get my work done when it needed to get done without having to wait until the following day and interrupt the users routines by kicking them off their pc. -shrugs-

Wow, I didn't know that xp can handle multiple sessions. I still doubt that I'll buy it anytime soon but it's good to know.
Posted on 2002-05-08 10:12:04 by Will
The systems are at work, I am a administrator for the network and need to check some win9x/me systems url history for websites that are not to be viewed on a company PC.

So anyways the PC's are either occupied or windows screensaver protected.

I have been working on some other computers lately and thats why I haven't posted on here for a while.

I still haven't got my program I made to kill the screensaver to work, It does a Sleep,3000 in the beginning so I can test it by clicking on preview screensaver so I don't have to burn to a cd.

And I put some error checking things in the code and it(the problem) seems to be in the OpenProcess part.

I recently had my computer crash so I lost the code I was working on.
This is some code I found in VB that i've been trying to convert and make work in ASM:
Private Const HIGH_PRIORITY_CLASS = &H80
' Indicates a process that must be executed immediately for it to run correctly.

'Enables to terminate the process using the process handle in the
'TerminateProcess function.

'Custom contant to use for our purpose

Private Declare Function GetDesktopWindow Lib "user32" () As Long
'The GetDesktopWindow function returns a handle to the desktop window.
'The desktop window covers the entire screen.
'It is the area on top of which all icons and other windows are painted.

Private Declare Function GetTopWindow Lib "user32" (ByVal hwnd As Long) As Long
'The GetTopWindow function examines the Z order of the child windows
'associated with the specified parent window and retrieves a handle
'to the child window at the top of the Z order.

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
'The GetWindowThreadProcessId function retrieves the identifier of the thread
'that created the specified window and, optionally, the identifier of the process
'that created the window

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
'The OpenProcess function opens an existing process object (using specific flags).

Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
'The TerminateProcess function terminates the specified process and all of its threads

Public Sub Main()

Dim Desktop_Handle As Long
Dim TopWindow_Handle As Long
Dim TopWindow_Retval As Long
Dim ScreenSaver_ProcID As Long
Dim scrOpProcID As Long

On Error Resume Next

Desktop_Handle = GetDesktopWindow()
'First we get Desktop Window Handle

TopWindow_Handle = GetTopWindow(Desktop_Handle)
'Now we obtain the topmost window handle of our desktop window handle

TopWindow_Retval = GetWindowThreadProcessId(TopWindow_Handle, ScreenSaver_ProcID)
'Here we get the (topmost) screensaver process id

scrOpProcID = OpenProcess(SCREENSAVER_DEATH, False, ScreenSaver_ProcID)
'So now we can open our process (Screensaver) using our custom flag..

TerminateProcess scrOpProcID, 0
'..and here we terminate the process.
''Screensaver is now killed even if we have password-protected it!!!
Unload Me

End Sub


I do not have a VB compiler so I cannot use that and have been trying to convert to asm.
Posted on 2002-05-14 10:41:06 by poison
How about:

Adding an admin password to the

Setting up a server on each terminal
so it can be done remotely.
Posted on 2002-05-14 11:03:14 by bdjames
I would have to get into the machine before I could put a server or admin password on it. ;)
Posted on 2002-05-14 11:10:05 by poison
you are an admin, you should have the authority to enter those pc's at any time, like a storm trooper if needed.

Which leads me to believe that you are trying to do this without the user's knowing. Maybe some of these users are genuinely bad, and using company resources in an inappropriate way, but i cannot morally help you too much with this, as i personally do not agree with secretly monitoring employees.

These are the only pointers i will offer:
- install a proxy server that blocks inappropriate sites
- set up the user's hosts file so that these sites are blocked
- check out the NT resource kit, it has heaps of resources on it to enable an admin to access machines and files **remotely**

If the network is set up in a normal way, as a network admin you can access files on a machine through the default admin shares. If those shares are not set up, then set them up in each users login script.

I am sorry if i sound like an a*s*s*h*o*l*e with my comments, but you are making this whole problem a lot harder than what it actually is.
Posted on 2002-05-14 22:07:20 by sluggy