Example Code

Enable/Disable Windows Screensaver Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI enables/disables the screensaver in Windows 

 

Description

This VI uses the Windows Registry functions in LabVIEW to write values to the ScreenSaveActive Key. The VI opens a reference to the Desktop sub key in the Windows registry, then write values to the ScreenSaveActive Key according to the boolean value provided by the user pushing  the Screensaver Control. Finally, the VI closes the desktop sub key in the Windows registry 

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Switch the toggle on the Front Panel to either Enabled or Disable Windows Screensaver
  2. Click the Apply button to save the setting to the Registry

Additional Information or References

VI Block DiagramEnable and Disable Windows Screensaver LV2012 NI Verified BD.jpg

**This document has been updated to meet the current required format for the NI Code Exchange. **

Jason W.
Applications Engineer
National Instruments UK & Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
jatinpatel1489@gmail.com
Member
Member
on

Hello,
This VI is proved very useful to me.
But while developing it by myself, I stumble upon Enum constant block.
I am not able to connect my Enum constant block with write to registry block.

Kindly help what configuration I have to take care of while connecting these two blocks.

Thank You,

Jatin Patel

CLAD
Passionate for LabVIEW
GarryG
Member
Member
on

Jatin,

The Read (And write) Registry Value Simple vis are polymorphic.  The selector terminals are not visible by default, but you can right click and change that under "Visible items".  For write, you probably want to select the U32 case if you're using an enum as the type of data.

Hope this helps.

CLA, CTA
Not my tempo... AGAIN!