Archive: Getting window handle of radio button added to directory page


Getting window handle of radio button added to directory page
I'm trying to get the window handle from a control I've added using ResHacker on the directory page. Here is the details of the added controls...


CONTROL "", 2000, BUTTON, BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 95, 243, 10


This part works great. I can see the radio button and interact with it. However I need to replace the text adjacent to the actual button and haven't had the best of luck doing that. Here's what I've attempted...


Function DirectoryPageShow
GetDlgItem $R0 $MUI_HWND 2000
SendMessage $R0 ${WM_SETTEXT} 0 "STR:----"
FunctionEnd


Yet there is no change on the controls text. I'm certain this is an issue with how I am retrieving the window handle. Any help is greatly appreciated.

!include "WinMessages.nsh"

!define ITEM_ID "2000"

var DIR_HWND
var ITEM_HWND

Function DirectoryPageShow

FindWindow $DIR_HWND "#32770" "" $HWNDPARENT
GetDlgItem $ITEM_HWND $DIR_HWND ${ITEM_ID}
SendMessage $ITEM_HWND ${WM_SETTEXT} 0 "STR:----"

FunctionEnd

Once again Red you have solved my problems. I am in your debt sir. It's been a while since I've visited the NSIS community and it's great to still see such fine ambassadors amongst it's ranks.