Note that this application was written for the Graphics Master and includes driver references that will not work on other platforms. See topic 1292 for a sample that works on other platforms.
In some cases, your application may need to complete some operations before putting the system to sleep (eg. flush data to flash disk, prepare digital I/Os, etc). This eVC application illustrates how to trap the PWROFF event issued when the RQONOFF signal is toggled (the registry entry must be enabled).
This application demonstrates trapping the PWROFF event, polling the RQONOFF signal and shows how quickly you can put the system to sleep. It uses the LED to indicate the current state of the app and the debug port for additional messages.
The exe included was built for and used on the Graphics Master. You can easily change the application to work with Graphics Client Plus and Bitsy by changing a single indexing variable.
Key APIs Used
keybd_event VK_OFF CreateFile
Lines of Code: 227
Source Download Rev 1 (61k zip) Edited 31-Mar-2002 by ctacke: Added key APIs and lines of code (LOC) Edited 11-Oct-2006 by akidder: Indicate that this application is only for Graphics Master