From 9da4ff09c752cd5b4b55ceb691bc10b5c3e3752a Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Sat, 20 Jul 2024 01:21:28 +0200 Subject: [PATCH] Write screen resolution into SkyrimPrefs.ini --- EnderalInstaller.iss | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/EnderalInstaller.iss b/EnderalInstaller.iss index f02d35c..aebbd46 100644 --- a/EnderalInstaller.iss +++ b/EnderalInstaller.iss @@ -161,6 +161,8 @@ Filename: "{app}\MO2\ModOrganizer.ini"; Section: "Plugins"; Key: "Skyrim%20Speci Filename: "{app}\MO2\ModOrganizer.ini"; Section: "Plugins"; Key: "Skyrim%20VR%20Support%20Plugin\enderal_downloads"; String: "true" Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iShadowMaskQuarter"; String: "4" +Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iSize W"; String: "{code:GetScreenWidth}" +Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iSize H"; String: "{code:GetScreenHeight}" Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Controls"; Key: "fMouseHeadingSensitivity"; String: "0.0320"; Flags: createkeyifdoesntexist [Icons] @@ -327,3 +329,20 @@ begin S := S + NewLine + Space + 'v' + sSkyrimVersion; Result := S; end; + +function GetSystemMetrics(nIndex: Integer): Integer; + external 'GetSystemMetrics@User32.dll stdcall setuponly'; + +Const + SM_CXSCREEN = 0; // The enum-value for getting the width of the cient area for a full-screen window on the primary display monitor, in pixels. + SM_CYSCREEN = 1; // The enum-value for getting the height of the client area for a full-screen window on the primary display monitor, in pixels. + +function GetScreenWidth(Param: String): String; +begin + Result := IntToStr(GetSystemMetrics(SM_CXSCREEN)); +end; + +function GetScreenHeight(Param: String): String; +begin + Result := IntToStr(GetSystemMetrics(SM_CYSCREEN)); +end;