Question

How can I obtain the window "id" - unique number associated with a Win32 window?

Can I obtain the id within a NSIS script(.nsi file)? If not what outside program can I use? ResHacker is not showing me the correct dialogs when I run my installer for some reason. I've heard of GDISpy or something with a name similar to that.

What I am trying to do is change the z index of some windows within a MUI2 pages and to set checkboxes backgrounds to transparent within a custom page.

What your easiest method for finding out a windows unique id?

EDIT Sorry I'm not familiar with the correct term is for what I am talking about. I am not talking about the HWND variable/handle I am talking about that windows unique window id thats an integer.

# In NSIS 
GetDlgItem $R0 ${parentHWND} 1012 # the 1012 is what I am referring to as the window ID 
Was it helpful?

Solution

The ids for a dialogs child controls can be found with a spy tool like Winspy++ (This tool displays it in hex so convert with calc.exe or prefix the number with 0x in the .nsi)

NSIS has two nested dialogs, the outer dialog hosts the next, back and cancel buttons. The inner dialog hosts the controls for the current page.

To get the handle to a button in the outer dialog:

GetDlgItem $1 $hwndparent 1

And for the inner dialog:

FindWindow $0 "#32770" "" $HWNDPARENT ;Find inner dialog first
GetDlgItem $1 $0 0x666

For a custom page, the id (and z-order) depends on the order you create the controls in...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top