To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example uses user32.dll to programmatically control the power state of the a computer's monitor.
Description
The user32.dll can be used to programmatically control the power state of the a computer's monitor. This function can be called using the Call Library Function Node to call PostMessage(). The API for the function being called can be found on MSDN: http://msdn.microsoft.com/en-us/library/ms644944. The code broadcasts a message to all windows to turn off the monitor. It will then stay off until the user provides input, such as moving the mouse. The same function can be used to then turn the monitor back on. Here is another useful page that explains how the function works. http://www.codeproject.com/KB/cs/Monitor_management_guide.aspx
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.