简体   繁体   中英

In NSIS, how to apply a onClick event on a dialog control at runtime?

On this control,

 CONTROL "link", 1002, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 195, 45, 10 

In nsis,

!define MUI_UI "myUi.exe"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "License.rtf"
...
Function LicenseShow
  ...

  ; Inner window
  FindWindow $0 "#32770" "" $HWNDPARENT

  ; Link
  GetDlgItem $1 $0 1002
  SetCtlColors $1 0x0000FF 0xFFFFFF ; This works
  ${NSD_SetText} $1 "Link to google" ; This works too
  ${NSD_OnClick} $1 on_click_link ; This does NOT work

  ...
FunctionEnd

Then,

Function on_click_link
    ExecShell "open" "http://www.google.com"
FunctionEnd

How can I add a onClick event on this 'Label' at runtime ? I don't want to use nsDialogs::Create 1018 et nsDialogs::Show for this.

Any ideas ?

NSD_On *回调仅适用于nsDialogs页面上的控件,请尝试使用ButtonEvent插件 ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM