I've got a laptop that's suffered some chassis damage that makes it very cumbersome to open/close the laptop. Normally, the metal ends of the LCD hold onto the chassis, but in this case the magnesium alloy plastic that holds the screws is broken. The laptop is out of warranty and it'd be a bit expensive for me at the moment to send it off to HP for repair. There's a wire that runs up from the motherboard to the LCD. That wire is rubbed up against by the metal part every time I open or close the lid on the laptop. So to avoid further damage to my laptop (at least until I can get it fixed), I've made a simple program to shut the monitor off on command. It basically just uses the following:
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
It works just fine and it allows me to keep my laptop open indefinitely. The only problem is that some program keeps waking my screen up. There's almost nothing open, and I can't come up with anything immediately obvious.
I was just wondering how you guys would go about figuring out what's turning on my display? Can you recommend any software and maybe some information on what events/specifics I should be looking out for?