Skip to content
⌘ NSIS Forum Archive

GetDlgItem - item_id

10 posts

b_avery@yahoo.c#

GetDlgItem - item_id

How do I find out all the item_id in the dialog I am looking at.

What I am trying to do is find the Close button on the last screen I have open and Enable/Disable the button.
b_avery@yahoo.c#
$hwnd is the custom dialog window

InstallOptions::dialog "$TEMP\Final.ini"
Pop $hwnd


GetDlgItem $1 $hwnd 1 ; ... Close button
EnableWindow $1 $0

But for some reason EnableWindow $1 $0 is not working $0 is set to either 0 or 1

Any ideas?
b_avery@yahoo.c#
GetDlgItem $1 $HWNDPARENT $0
EnableWindow $1 $0

The Close button is still enabled.

Where is the documentation detailing item_id in the GetDlgItem?
b_avery@yahoo.c#
Getting really confused:

This disables the Close button:

GetDlgItem $1 $HWNDPARENT 1
EnableWindow $1 1

And this should enable it, but it does not :-(
GetDlgItem $1 $HWNDPARENT 1
EnableWindow $1 0

What am I doing wrong?
deguix#
You did the inverse, to enable:

GetDlgItem $1 $HWNDPARENT 1 
EnableWindow $1 1 
To disable:

GetDlgItem $1 $HWNDPARENT 1 
EnableWindow $1 0 
b_avery@yahoo.c#
Sorry yes got it the wrong way around.

But even so, if I disable the Close button and then try and enable it via the user clicking a button on the form, it does not get enabled.

I know the code is running, but it just is not working.
Joost Verburg#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.