最新消息:

EmbeddedLists为NSIS提供listbox和treeview增加label和edittext和checkbox等功能

nsis 永恒心锁 1741浏览 0评论
!AddPluginDir "../../Plugins"
!include MUI2.nsh
# EmbeddedLists example: ListView_MultiColumnCheckBoxes.nsi
# Uses ListView_MultiColumnCheckBoxes.ini
# Displays a list view dialog containing a few items,
# width two different icons.
# Only one item can be selected.
# Settings
Name `EmbeddedLists Plugin Example`
OutFile `ListView_MultiColumnCheckBoxes.exe`
# Pages
!insertmacro MUI_PAGE_WELCOME
Page Custom ListViewShow ListViewLeave
!insertmacro MUI_PAGE_COMPONENTS
# Languages
!insertmacro MUI_LANGUAGE `English`
# Reserve plugin files (good practice)
ReserveFile `ListView_MultiColumnCheckBoxes.ini`
#ReserveFile `${NSISDIR}PluginsInstallOptions.dll`
#ReserveFile `${NSISDIR}PluginsEmbeddedLists.dll`
# Callback functions
Function .onInit
 InitPluginsDir
 File `/oname=$PLUGINSDIRListView_MultiColumnCheckBoxes.ini` `ListView_MultiColumnCheckBoxes.ini`
 WriteINIStr `$PLUGINSDIRListView_MultiColumnCheckBoxes.ini` `Icons` `Icon1` `$EXEDIRicon1.ico`
 WriteINIStr `$PLUGINSDIRListView_MultiColumnCheckBoxes.ini` `Icons` `Icon2` `$EXEDIRicon2.ico`
FunctionEnd
# Custom page functions
# [[
Function ListViewShow
 EmbeddedLists::Dialog `$PLUGINSDIRListView_MultiColumnCheckBoxes.ini`
 Pop $R0
FunctionEnd
Function ListViewLeave
 StrCpy $R1 `` ; Clear selected items list.
 Pop $R0 ; Selected item number.
 StrCmp $R0 /END +4 ; No item selected?
 ReadINIStr $R0 `$PLUGINSDIRListView_MultiColumnCheckBoxes.ini` `Item $R0` `Text`
 StrCpy $R1 $R1|$R0
 Goto -4 ; Loop.
 StrCpy $R1 $R1 `` 1 ; Trim first | from front.
 StrCmp $R1 `` +2 ; Skip MessageBox.
 MessageBox MB_OK `Selected items:$r$n$R1`
FunctionEnd
# ]]
# Empty section
Section
SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » EmbeddedLists为NSIS提供listbox和treeview增加label和edittext和checkbox等功能

您必须 登录 才能发表评论!