0

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 
3
  • 3
    Please be more specific what you mean by "window id." Do you mean the window handle? The dialog control id? May 22, 2012 at 4:22
  • @RaymondChen please see edit above
    – sazr
    May 22, 2012 at 4:36
  • I don't think z-order is the problem. See also: sourceforge.net/tracker/…
    – Anders
    May 22, 2012 at 6:59

1 Answer 1

2

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.