Detect TabletPC: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
 
m (Added WinVer note)
 
Line 1: Line 1:
{{PageAuthor|crdoconnor}}
{{PageAuthor|crdoconnor}}
<div style="border: 1px solid #808040; background-color:#f8f880; color:#000; padding:0.5em;"><b>Note: </b>This detection is now also available in WinVer.nsh</div>


== The Script ==
== The Script ==
<highlight-nsis>
<highlight-nsis>
; Check whether a tablet PC is running
RequestExecutionLevel User
 
ShowInstDetails Show
OutFile "DetectTabletPC.exe"
Name "Detect Tablet PC"
Caption "Detect Tablet PC"
XPStyle "on"


Function ".onInit"
Function ".onInit"
Line 18: Line 16:
FunctionEnd
FunctionEnd


Section "-boo"
Section
;
SectionEnd
SectionEnd
</highlight-nsis>
</highlight-nsis>


[[Category:System Plugin Examples]]
[[Category:System Plugin Examples]]

Latest revision as of 20:51, 28 September 2022

Author: crdoconnor (talk, contrib)


Note: This detection is now also available in WinVer.nsh

The Script

RequestExecutionLevel User
ShowInstDetails Show
 
Function ".onInit"
System::Call 'user32::GetSystemMetrics(i 86) i .r0'
strcmp $0 0 +1 +3
MessageBox MB_OK|MB_ICONINFORMATION "This is not a tablet PC."
Quit
MessageBox MB_OK|MB_ICONINFORMATION "This is a tablet PC."
FunctionEnd
 
Section
SectionEnd