Skip to content

Program to lock your Windows session & turn off your monitor(s)

License

Notifications You must be signed in to change notification settings

DAVe3283/Sleepytime

Repository files navigation

Sleepytime

A simple program to lock your workstation and put all monitors into powersave mode.

Download

You can download the compiled executable here.

Doesn't NirCmd do this?

Yes, with a very simple script:

lockws
monitor off

So why write something new?

Because NirCmd hangs after putting my monitor to sleep, leaving an army of zombie processes over time. This annoys me more than it should.

What causes that?

Interestingly enough, the Windows SendMessage API is not returning on my system when called with HWND_BROADCAST or HWND_TOPMOST and the monitor power command. So, really, it is probably not NirCmd's fault.

The "fix"

Rather than figure out which program/driver/whatever is causing that problem, I just decided to write my own that doesn't broadcast the monitor off message to everyone. Instead, I create a dummy form, and send the message to that.

Windows intercepts the message and does its thing, and we're golden!

About

Program to lock your Windows session & turn off your monitor(s)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages