#!c:/perl/bin/perl -w $|++; use strict; use Win32::API; sub MONITOR_ON () { -1 } sub MONITOR_STANDBY () { 1 } sub MONITOR_OFF () { 2 } Win32::API->Import('user32', 'SendMessageA', 'NNNN', 'N'); Win32::API->Import('user32', 'FindWindowA', 'PP', 'N'); my $hwnd = FindWindowA('Shell_TrayWnd', 0); SendMessageA($hwnd, 0x112, 0xF170, MONITOR_STANDBY); sleep 6; SendMessageA($hwnd, 0x112, 0xF170, MONITOR_OFF); sleep 6; SendMessageA($hwnd, 0x112, 0xF170, MONITOR_ON);