Skip to content

Commit

Permalink
Improve README, add download link.
Browse files Browse the repository at this point in the history
  • Loading branch information
DAVe3283 committed Mar 20, 2015
1 parent 06c2dc8 commit f402580
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,37 @@
A simple program to lock your workstation and put all monitors into powersave
mode.

## Doesn't NirCmd do this?
## Download

Yes, with a very simple nircmd script.
You can download the compiled executable [here][downloadLink].

## So why write your own?
## 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.

Plus, I just like writing C#, so why not? It's only a few lines of code.

## 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.
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!

[NirCmd]: http://www.nirsoft.net/utils/nircmd.html
[downloadLink]: https://drive.google.com/open?id=0B3hK6MOhVmfAdkJhdkhIX01pUDQ&authuser=0

0 comments on commit f402580

Please sign in to comment.