主要部分:
!define HWND_TOPMOST -1
!define SWP_NOSIZE 1
!define SWP_NOMOVE 2
System::Call "user32::SetWindowPos(i $HWNDPARENT, i ${HWND_TOPMOST}, i0, i0, i0, i0, i ${SWP_NOSIZE}|${SWP_NOMOVE})"
--------------------------------------------------------------------------------
详细用法:
;NSIS Modern User Interface
;Multilingual Example Script
;Written by Joost Verburg
!define HWND_TOPMOST -1
!define SWP_NOSIZE 1
!define SWP_NOMOVE 2
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
;Name and file
Name "Modern UI Test"
OutFile "MultiLanguage.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\Modern UI Test"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Modern UI Test" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Language Selection Dialog Settings
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Pages
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeMainFont
!insertmacro MUI_PAGE_LICENSE $(MUILicense)
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeFont2
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeFont
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English" # first language is the default language
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
;--------------------------------
;License Language String
LicenseLangString MUILicense ${LANG_ENGLISH} "${NSISDIR}\Docs\Modern UI\License.txt"
LicenseLangString MUILicense ${LANG_SIMPCHINESE} "${NSISDIR}\Docs\Modern UI\License.txt"
LicenseLangString MUILicense ${LANG_TRADCHINESE} "${NSISDIR}\Docs\Modern UI\License.txt"
;--------------------------------
;Reserve Files
;These files should be inserted before other files in the data block
;Keep these lines before any File command
;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
!insertmacro MUI_RESERVEFILE_LANGDLL
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
SetOutPath "$INSTDIR"
;ADD YOUR OWN FILES HERE...
;Store installation folder
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;--------------------------------
;Descriptions
;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
;Assign descriptions to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} "A test section."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
Function ChangeFont
FindWindow $0 "#32770" "" $HWNDPARENT
System::Call "user32::SetWindowPos(i $HWNDPARENT, i ${HWND_TOPMOST},i0, i0, i0, i0, i ${SWP_NOSIZE}|${SWP_NOMOVE})"
FunctionEnd
Function ChangeFont2
FindWindow $5 "#32770" "" $HWNDPARENT
System::Call "user32::SetWindowPos(i $HWNDPARENT, i ${HWND_TOPMOST},i0, i0, i0, i0, i ${SWP_NOSIZE}|${SWP_NOMOVE})"
FunctionEnd
Function ChangeMainFont
FindWindow $2 "#32770" "" $HWNDPARENT
System::Call "user32::SetWindowPos(i $HWNDPARENT, i ${HWND_TOPMOST},i0, i0, i0, i0, i ${SWP_NOSIZE}|${SWP_NOMOVE})"
FunctionEnd
免责声明:根据《计算机软件保护条例》第十七条规定“为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。”您需知晓本站所有内容资源均来源于网络,仅供用户交流学习与研究使用,版权归属原版权方所有,版权争议与本站无关,用户本人下载后不能用作商业或非法用途,需在24个小时之内从您的电脑中彻底删除上述内容,否则后果均由用户承担责任;如果您访问和下载此文件,表示您同意只将此文件用于参考、学习而非其他用途,否则一切后果请您自行承担,如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。丨本站为个人博客非盈利性站点,所有软件信息均来自网络,所有资源仅供学习参考研究目的,并不贩卖软件,不存在任何商业目的及用途。丨本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
BY-NC-SA协议进行授权
转载请注明:永恒心锁-分享互联网 » NSIS 窗体顶置