Get User's screen resolution: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Added category links.)
m (Adding new author and category links.)
Line 1: Line 1:
{|align=right
{{PageAuthor|Joel}}
|<small>Author: [[{{ns:2}}:Joel|Joel]] ([[{{ns:3}}:Joel|talk]], [[{{ns:-1}}:Contributions/Joel|contrib]])</small>
 
|}
<br style="clear:both;">
== The Script ==
== The Script ==
<highlight-nsis>
<highlight-nsis>
Line 24: Line 22:
</highlight-nsis>
</highlight-nsis>


[[{{ns:14}}:System Plugin Examples]]
[[Category:System Plugin Examples]]

Revision as of 12:20, 24 June 2005

Author: Joel (talk, contrib)


The Script

; Get User screen resolution
 
OutFile "ScreenRes.exe"
Name "Get User Screen Resolution"
Caption "Get User Screen Resolution"
XPStyle "on"
 
Function ".onInit"
System::Call 'user32::GetSystemMetrics(i 0) i .r0'
System::Call 'user32::GetSystemMetrics(i 1) i .r1'
MessageBox MB_OK|MB_ICONINFORMATION "Screen Resolution: $\r$\n$0 X $1"
Quit
FunctionEnd
 
Section "-boo"
;
SectionEnd