![]() |
NSIS Function to get main display refresh rate?
Hi' i'm trying to include a function in my script to detect the refresh rate of the main display. However, I do not know how to incorporate the functions into NSIS code.
I already managed to find a way to get the resolution using the following code: System::Call user32::GetSystemMetrics(i0)i.r0 System::Call user32::GetSystemMetrics(i1)i.r1 However, in order to obtain the refresh rate, one must use EnumDisplayDevices to get the right display and then pass that to EnumDisplaySettings. I do not know how to do that. Any help would be much appreciated. I am trying to build a portable application using the portableapps.com framework that uses NSIS language. Thank you and sorry for being a n00b. |
You did say main display which I interpret as the primary monitor.
Quote:
Quote:
https://nsis.sourceforge.io/NSISMultiMon_plug-in can give you some information about the different monitors. https://nsis.sourceforge.io/ChangeRes_plug-in can change it but I don't think it can read it. |
It does seem to work but it only returns 0.
|
Quote:
Quote:
|
Hi, enzeinzen
If still relevant, is this solution suitable for you? https://cdn.discordapp.com/attachmen...23/unknown.png MfG MaGoth, :) |
No, sadly I didn't manage to find a way to make this work. What I'm trying to do is incorporate this into a PortableApps.com launcher. Getting a function that is so complex to work within the PA.com framework is, however above my level of competence.
|
For example, this is how obtaining the resolution for further use is done:
${SegmentInit} System::Call user32::GetSystemMetrics(i0)i.r0 System::Call user32::GetSystemMetrics(i1)i.r1 ${SetEnvironmentVariable} ScreenWidth $0 ${SetEnvironmentVariable} ScreenHeight $1 |
What is the problem with the last code I posted?
|
| All times are GMT. The time now is 17:20. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.