簡體   English   中英

有人在組件MUI頁面上選擇組件時調用函數

[英]Call Function When Someone Selects a Component on the Component MUI Page

我正在嘗試向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

NSDialogs宏僅在NSDialog頁面上起作用,組件頁面是本機NSIS頁面。

您必須使用.onSelChange回調函數來處理更改(使用sections.nsh中的幫助程序宏)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM