I have code that launches the Screen Saver Settings dialog:
TCHAR path[_MAX_PATH];
CString strPath;
GetSystemDirectory(path, sizeof(path)/sizeof(TCHAR));
strPath = _T(“”“);
strPath += path;
strPath += _T(”control.exe");
strPath += _T(“”");
UINT status = (UINT) ShellExecute(NULL, NULL, strPath, _T(“desk.cpl,1”), NULL, SW_SHOWNORMAL);
Note that the string that contains the path to control.exe surrounds the path with quotes. Not sure why, but is has worked fine for over 20 years!
Until I ran Windows Update on two different Windows 10 machines this week. This code is still working on my Windows 11 machine.
This is probably some hack that Microsoft has put in recently to make things a little more difficult for bad actors.
But my program has a legit need to present the screen saver setup dialog to my users. My program comes with a custom screen saver, and I need to be able to show it to
my users. Especially now, because Microsoft keeps hiding access to screen savers.
The screen saver settings dialog should appear:
enter image description here
This is still working on my Windows 11 machine, but not 2 of my Windows 10 machines.
Elliot Leonard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.