diff --git a/monitorcontrol/vcp/vcp_windows.py b/monitorcontrol/vcp/vcp_windows.py index c15abf1..908b319 100644 --- a/monitorcontrol/vcp/vcp_windows.py +++ b/monitorcontrol/vcp/vcp_windows.py @@ -148,7 +148,23 @@ def get_vcp_capabilities(self): except OSError as e: raise VCPError("failed to get VCP capabilities") from e return cap_string.value.decode("ascii") + + def save_current_settings(self): + """ + Saves the current settings to monitor NVRAM. + Raises: + VCPError: Failed to set VCP feature. + """ + self.logger.debug("SaveCurrentSettingsCommand") + try: + if not ctypes.windll.dxva2.SaveCurrentSettings( + HANDLE(self.handle) + ): + raise VCPError("failed to save current settings: " + ctypes.FormatError()) + except OSError as e: + raise VCPError("failed to close handle") from e + @staticmethod def _get_physical_monitors() -> Iterator[Tuple[HANDLE, str]]: """