我正在尝试向 MUI2 组件页面添加一些自定义功能。
当用户选择一个组件(复选框)时,我想调用我的自定义函数。如果已选择第一个组件,那么我也想检查/选择第二个组件。
我下面的代码尝试编写此功能,但出现编译错误:
宏 8 上的宏 __NSD_OnControlEvent 错误
!include nsdialogs.nsh
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW compshow
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
OutFile "test.exe"
Function OnCustomisationComponentClick
#SendMessage 1032 ${TVM_SETITEM} 0 $someTVItem
MessageBox MB_OK "abc"
FunctionEnd
Function compshow
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1032 # 1032 is the Treeview that holds the components
!insertmacro __NSD_OnControlEvent ${TVM_SELECTITEM} $0 OnCustomisationComponentClick
FunctionEnd
Section "Dummy"
SectionEnd