LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

turn off monitor

Is there anyway to turn off/on monitor in CVI?
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 1 of 2
(3,455 Views)
Hello Sheetal,
 
You can use the Windows SDK SendMessage function.
 
#include "windows.h"
HWND hwnd;
hwnd = (HWND)GetCVIWindowHandle();
To turn off the monitor: 
SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2) ;
 
To put the monitor in standby:
SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1) ;

To turn on the monitor:
SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1) ;
 
More documentation on these functions can be found on MSDN.
 
Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 2 of 2
(3,436 Views)