From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I retrieve a screen saver path for the SetScreenSaver programmer's toolbox function?

Hi,

I'm using LabWindows CVI V5.5.1 on Windows 98 to write an automated
test program. To prevent possible interference from screen saver
activities, I want to disable the screen saver before testing and then
enable it again when testing is complete. I was hoping to use the
GetScreenSaver/SetScreenSaver combination of functions from the
programmer's toolbox. I can disable the screen saver by using
SetScreenSaver(FALSE, SleepTime, NULL), but to re-enable it, I need
the path of the original .scr file used - i.e. SetScreenSaver(TRUE,
SleepTime, scr_path). Strangely, GetScreenSaver retrieves the enabled
status and the sleep time, but not the path! I tried
SetScreenSaver(TRUE, SleepTime,
NULL) to no avail. Any help on how I
might find the path of an active screen saver file would be
appreciated.

Thanks in advance,
John.
0 Kudos
Message 1 of 2
(2,573 Views)
John,

The path of your screensaver file is stored in the registry, in HKCU>>Control Panel>>Desktop.

You can obtain it with something like this:

RegReadString (REGKEY_HKCU, "Control Panel\\Desktop", "SCRNSAVE.EXE", fileBuffer, fileBufferSize, &actualSize);

Luis
NI
0 Kudos
Message 2 of 2
(2,573 Views)