Search code examples
installationcontrolsonchangensisnsdialogs

Attach an OnChange handler to existing textbox control NSIS


I'm trying to attach an onchange event handler to the existing Install directory textbox in NSIS. However, it never seems to trigger. Any ideas how I can do this?

GetDlgItem $TextControl $HWNDPARENT 1019
GetFunctionAddress $R0 MYFUNCTION
nsDialogs::OnChange  $TextControl $R0

I've used Resource hacker to get the control ID and I added the above code to a MUI_PAGE_CUSTOMFUNCTION_SHOW before displaying the MUI_PAGE_DIRECTORY.

Any help on getting a function to trigger on an already existing control would be greatly appreciated.

Thanks


Solution

  • The nsDialogs On* callbacks only works on nsDialogs custom pages.

    You can use the .onVerifyInstDir function callback if you need to inspect the $InstDir variable on the directory page.