Based on KRosUser's desk.patch.
JIRA issue: CORE-18187, CORE-16878
- Add FindBestElement helper function.
- Use FindBestElement to find the best
display settings.
NOTE: IDS_ADMINISTRATOR_NAME translation excluded for the time being.
It should be "Администратор", but bg-BG translation missing in samsrv.dll,
therefore don't translate it because otherwise this would introduce a mismatch
(samsrv falls back into english when translation is missing).
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
- Introduce AddScreenSaver[Item] helpers for adding screensavers in
the list (either given by file path or by item structure).
- Rename "AddScreenSavers" to "EnumScreenSavers", and
"ScreenSaverItem" type to "SCREEN_SAVER_ITEM".
- Ensure the stored "SCRNSAVE.EXE" value is NULL-terminated.
- Add the current screensaver, specified by the "SCRNSAVE.EXE" registry
value, in the list if it isn't already present; otherwise select it
in the list.
- Make the filename comparison case-insensitive.
CORE-6812 ; see also commit ff0951356 (r66688)
This function "just" changes the per-user SCRNSAVE.EXE registry value
to point to the new specified file, changes the SPI values and opens
the desk.cpl "Screensaver" property tab for letting the user change
the new selected screensaver properties.
In particular, it does *NOT* copy the specified file to System32 or
anything else (and doesn't verify that it is a valid PE executable).
Our previous implementation did none of that, and was also relying on
some private setupapi functions.
We now behave closer to Windows' desk.cpl.
Additionally:
- ReactOS-specific feature (compile-time define) disabled by default:
Verify that the specified file actually exists, before changing
the screensaver.
- Use NDEBUG, disabling DPRINT by default;
- Improve InstallScreenSaver[A,W] spec entries;
- Remove NUM_APPLETS define and use _countof() instead.
This avoids having desk.cpl depend on a private function that may change
or disappear, and increase the probability of being able to use that CPL
across different Windows versions.
(Note: this pSetupMultiByteToUnicode was one of those whose name changed
between Windows 2000 and XP+)
This mostly reverts commit 221f21c62 (r29328), that was a hack for
building with MSVC. We can nowadays correctly link with the shell32
SHCreatePropSheetExtArrayEx() export.
Actually I was working on a much bigger commit in the same context for releases/0.4.7
when I realized that related glitches do also affect master head
and also other release-branches in some areas.
Fix a bug when after closing the settings window for a screensaver,
the preview for it wouldn't restart.
- Keep waiting for messages from the settings window while it's open
- Fix leaking two handles to avoid creating zombie processes
CORE-18680
In fact Windows XP/2003 desk.cpl uses only user-defined values,
and performs fallback to shell32.dll strings in case they are missing.
CORE-18565 CORE-8427
- Addendum to bb43363416
- Also update resource file header
Reviewed-by: Adam Słaboń <asaillen@protonmail.com>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
- All functions now implemented, except no support for themes.
- Fixed listview height to avoid vertical scrollbar in Windows.
- Refactored existing code for show/hide desktop icons.
CORE-3567 CORE-8427
Use window subclassing to override WM_PAINT message handling
and use RedrawWindow function along with WS_CLIPCHILDREN style
for the parent window in order to preserve screensaver drawing.
CORE-15929
Hide multiple monitor selection controls in this case.
Otherwise, show them when multiple monitors are detected
and hide the monitor preview bitmap.
This fixes the focus on the resolution slider when tested in Windows XP.
Also use the monitor bitmap globally, because it's used on multiple pages.
CORE-17939 CORE-10606
- CM_Locate_DevNodeW expects a Device Instance ID as second argument,
so it cannot be used for converting a Hardware ID.
- Use SetupAPI functions here instead, as documented in:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdisplaydevicesw
- Now our desk.cpl passes correct identifier to CPL extensions,
such as deskadp and deskmon, so clicking on "Properties" in the
advanced display properties now works in Windows XP.
- Also fix copypasta in DisplayAdvancedSettings that affected applet
built with MSVC - deskadp extension was loaded twice.
- Also fix magic flag value for EDD_GET_DEVICE_INTERFACE_NAME.