LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Windows display settings from LabView

Literally for years I have looked for a 'red light' screen on a PC, I have found various solutions but none perfect - finally Windows 10 and other peoples hard work has delivered a solution see Windows 10 Night Vision Mode - The ATMs Workshop (atm-workshop.com) which gives the best solution I have found so far (and all in W10). So my query is can I do the required 'switching' commands from inside LabView? I can set up the two *.theme files manually so would need a 'call' to switch to a given theme, them a 'call' to toggle Night mode ON/OFF. Both actions probably quite simple if you know where to find the command in the many Windows APIs but I do not. Anyone have any clues or sample VIs? Many thanks Ian

0 Kudos
Message 1 of 2
(937 Views)

The most simple way would be to use the command line with System Exec.

 

In this link they describe a utility to change the theme with the Winaero tool through the command line. It is also described which registry key defines the theme, but just changing that registry key alone won't be enough as you also need to send the according event to all applications to refresh their view (or logout and back in).

 

There are other ways but they will usually cause the Customization Control Panel to open, which your user then has to close, or you have to kill it. https://stackoverflow.com/questions/546818/how-do-i-change-the-current-windows-theme-programmaticall...

 

Basically if you do something like

SystemExec(cmd -k "your path to the them file")

it should open the control panel with the correct theme already selected.

 

Then after a small delay a 

SystemExec(taskkill /F /IM systemsettings.exe & close window)

 You could also put them in a batch file or power shell script and execute that instead.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(917 Views)