' Mel Bishop ' Turn off the monitor ' ' Turn the monitor off. To turn it back on, ' ' bump the mouse, press a key, whatever. ' ' ' #INCLUDE "win32api.inc" ' ' '=========================================== ' ' MessageBoxTimer code lifted from ' ' http://www.powerbasic.com/support/forums/Forum7/HTML/000941.html ' Author: John McWilliams ' ' Routed to this link by: Dave Biggs ' ' Via: http://www.powerbasic.com/support/forums/Forum4/HTML/013180.html ' Thanks much! ' ' FUNCTION MessageBoxTimer _ ' (BYVAL hWnd AS DWORD, _ ' BYVAL uiMsg AS DWORD, _ ' BYVAL idEvent AS DWORD, _ ' BYVAL dwTime AS DWORD) AS LONG ' ' PostQuitMessage 0 ' FUNCTION = 0 ' END FUNCTION ' ' '=========================================== ' FUNCTION TimedMessageBox _ ' (BYVAL hWnd AS DWORD, _ ' ptszMessage AS ASCIIZ, _ ' ptszTitle AS ASCIIZ, _ ' BYVAL flags AS DWORD) AS DWORD ' ' DIM iResult AS LONG ' DIM Msg AS tagMsg ' DIM TimerProcPtr AS DWORD ' DIM Delay AS LONG ' ' Delay = 3000 ' milliseconds to wait before ' killing the MsgBox ' TimerProcPtr = CODEPTR(MessageBoxTimer) ' SetTimer %NULL, 1, Delay, TimerProcPtr ' FUNCTION = MessageBox(%NULL, _ ' ptszMessage, _ ' ptszTitle, _ ' flags) ' KillTimer %NULL, 1 ' iResult= PeekMessage(Msg, _ ' %NULL, _ ' %WM_QUIT, _ ' %WM_QUIT, _ ' %PM_REMOVE) ' IF iResult THEN FUNCTION = 0 ' END FUNCTION ' ' FUNCTION PBMAIN() ' ' It's supposed to be: ' ' -1 = Wake up again ' ' 0 = Standby ' ' 2 = Power off ' ' LOCAL Msg AS ASCIIZ * 256 ' LOCAL Title AS ASCIIZ * 256 ' ' Msg = "Get'cher hand off the mouse." ' Msg = msg & $CRLF ' Msg = Msg & "Shutting down in 3 seconds." ' msg = msg & $CRLF ' Title = "Timed MessageBox..." ' TimedMessageBox %NULL, _ ' No Parent Msg, _ ' Message to display Title, _ ' Title %MB_OK OR _ ' %MB_TASKMODAL OR _ ' %MB_ICONINFORMATION ' How to display it ' SendMessage %HWND_BROADCAST, _ ' %WM_SYSCOMMAND, _ ' %SC_MONITORPOWER, 2 ' END FUNCTION '