!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
THE END
暂无评论内容