![]() |
#1 |
Junior Member
Join Date: Jun 2019
Posts: 4
|
![]()
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. |
![]() |
![]() |
![]() |
#2 | ||
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,183
|
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. IntOp $PostCount $PostCount + 1 |
||
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jun 2019
Posts: 4
|
It does seem to work but it only returns 0.
|
![]() |
![]() |
![]() |
#4 | ||
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,183
|
Quote:
Quote:
IntOp $PostCount $PostCount + 1 |
||
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Sep 2010
Posts: 21
|
Hi, enzeinzen
If still relevant, is this solution suitable for you? ![]() MfG MaGoth, ![]() |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jun 2019
Posts: 4
|
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.
|
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Jun 2019
Posts: 4
|
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 |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,183
|
What is the problem with the last code I posted?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|