Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:03:44+00:00 2026-06-07T11:03:44+00:00

I tried the ButtonEvent plugin, but when I run compiled example, it fails with

  • 0

I tried the ButtonEvent plugin, but when I run compiled example, it fails with memory access error. Maybe it is able to do with System plugin via Windows API or something else? Can anyone show how it can be done?

UPD: Error was appeared because I tried to use non-unicode ButtonEvent on Unicode NSIS. Now example compiles and executes OK, but when I click on TryMe button, callback function is not called and nothing happens. How to determine what is the problem? Can anyone compile ButtonEventMUI.nsi and click on TryMe button? I downloaded latest ButtonEvent version. Using NSIS 2.46 Unicode

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:03:45+00:00Added an answer on June 7, 2026 at 11:03 am

    The system plugin cannot do this because it cannot subclass windows.

    The ButtonEvent plugin works fine for me (NSIS 2.46):

    Name BtnTest
    Outfile test.exe
    Installdir "$temp"
    RequestExecutionLevel user
    BrandingText " " ;Button covers this text
    !include nsDialogs.nsh ;For WS_*
    
    Function .onGuiInit
    ; You are supposed to use ChangeUI (or MUI_UI) and a modified ui file to add new buttons but this example adds the button at run-time...
    GetDlgItem $0 $hwndparent 2 ; Find cancel button
    System::Call *(i,i,i,i)i.r1
    System::Call 'USER32::GetWindowRect(ir0,ir1)'
    System::Call *$1(i.r2,i.r3,i.r4,i.r5)
    IntOp $5 $5 - $3 ;height
    IntOp $4 $4 - $2 ;width
    System::Call 'USER32::ScreenToClient(i$hwndparent,ir1)'
    System::Call *$1(i.r2,i.r3)
    System::Free $1
    IntOp $2 $2 + $4 ;x
    IntOp $2 $2 + 8  ;x+padding
    System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Click Me",i${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP},ir2,ir3,ir4,ir5,i $hwndparent,i 0x666,i0,i0)i.r0'
    SendMessage $hwndparent ${WM_GETFONT} 0 0 $1
    SendMessage $0 ${WM_SETFONT} $1 1
    
    GetFunctionAddress $0 onmybtnclick
    ButtonEvent::AddEventHandler 0x666 $0
    FunctionEnd
    
    Function onmybtnclick
    MessageBox mb_ok "You clicked me!"
    FunctionEnd
    
    Page Directory
    Page Instfiles
    
    Section
    SectionEnd
    

    Example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried to reuse Sum but got this error: cannot resolve method Sum how can
Tried every solution found on the net, but still couldn't fix my error: on
tried uncommenting pam_limits.so from the pam.d directory but no luck. Basic PAM seems to
Tried searching the site, but cannot find an answer to my problem: Lets say
Tried a bunch of things but I can't get it to work consistently amid
tried to find the answer by googling and in MSDN but with no luck.
Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
Tried with : IList<IList<string>> matrix = new List<new List<string>()>(); but I can't. How can
tried this many times but I just can't figure out how to define custom
Tried : var a=10.3; var b=2.3; alert(a+b); but I get 12.600000000000001 . I know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.