views:

1277

answers:

7

I have an iMac, and I want to be able to turn off the monitor when I go to sleep,. Alas, the iMac has no switch for this. I do not want to put the iMac into sleep mode, i want to write a "expose" like application or service, which when the mouse is put into the upper left hand corner of my screen, the display will sleep. Likewise, if i move the mouse away, it comes back.

Does anyone have experience with tracking mouse movements within the Windows and Display APIs I'd need to look up. I just need some direction to get started.

Cheers! Chris

A: 

Not really the answer you seem to be looking for, but cant you do this via the power save option and/or the screen saver - can it be set to nothing.

Chris Kimpton
+2  A: 

In Leopard, you can just go to "System Preferences" and "Desktop & Screensaver". Click the Screensaver tab, click "Hot Corners", selected the corner you want to change, then chose "Sleep display". Does that not work?

Jared Updike
It looks like the question is: under Bootcamp (or on any Windows computer, really...) how does any program detect "hot corners" mouse touches and then launch my program (where your program causes the display to sleep).
Jared Updike
A: 

Can you not use the monitor power button?

David Sykes
Do iMacs even have a monitor power button?
Jared Updike
You got me there. Apparently not.
David Sykes
+1  A: 

If it's an old CRT iMac then you can't switch off the screen without switching the computer off - the convection from the CRT is used to cool the processor!

Douglas Leeder
A: 

Jared, that does work, but I'm talking about writing something in Windows, not using "Sleep Display" in OSX. Thanks for your comment.

So you are trying to do this under Windows in Bootcamp, making something akin to the existing Mac solution I gave. Ahh that's a good question... hot corners in Windows...
Jared Updike
Just use a pre-existing solution like this: http://www.southbaypc.com/HotCorners/ If it runs your pre-selected screensaver, then all you need to do is make an exe that does what you want and then rename it whatever.scr (http://computer.howstuffworks.com/screensaver.htm/printable)
Jared Updike
+1  A: 

I've been asked to clarrify. Sorry if i'm confusing anyone. I'm running Windows Vista 32 via Bootcamp. I like that Mac OSX has a "hot corners" feature via Expose. I have noticed that besides power managment which runs on a time metric, there is no way to sleep the display at will in Vista.

I would like to write my own tool for this. I might be a glutton for punishment, but i'm a coder, and it's a good excuse to learn something new.

A: 

Thanks for the clarification, Chris. I would reiterate:

  1. just use a pre-existing solution like this: http://www.southbaypc.com/HotCorners/ (untested anything that does the same thing would work). If it allows you to run your pre-selected screensaver, then all you need to do is ...
  2. ... make an exe that does what you want (sleep the screen) and then rename it whatever.scr http://computer.howstuffworks.com/screensaver.htm/printable Do you have this working yet?
  3. Once you get that working (and you can enjoy a Windows version of your desired OS X hot corners functionality) then worry about how hot corners are implemented. Your Win32 API question is still a good question but like you said you sound like you want to build it yourself. If that is the case, I would post a new question "Hot corners in Windows Win32 API Low level mouse tracking" or something to that effect and just ask: "how do these Hot Corners programs detect hot corner mouse-over events?" By the way my brother used the low level API to move the mouse cursor and simulate clicks so I know what you're asking is probably possible. It's just that your REAL question seems barried in all this discussion.
Jared Updike