Archive: ShowWindow Problem


ShowWindow Problem
I have a very simple installer that just shows the license page. I have modified the resource to extend the RichEdit control for the entire width and height of the dialog. Within .onGuiInit, I'm hiding the Cancel button and within the license page Show function, I'm hiding the icon and label controls. This use to work, but now it doesn't. When the installer is shown, the RichEdit control is of the correct width/height, but the other two controls, which I hid, are visible. The weird thing is, though, that when you ALT+TAB to another window and then go back (or minimize and then restore), the installer looks the way I want it. Here is an example of what I'm doing. Am I missing something obvious?


Page license "" LicenseShow

Outfile 'setup.exe'
ChangeUI all "my_modified_default.exe"

!macro HideWindow _ITEM
Push $0
GetDlgItem $0 $HWNDPARENT ${_ITEM}
ShowWindow $0 0
Pop $0
!macroend
!define HideWindow `!insertmacro HideWindow`

Function .onGuiInit
${HideWindow} 2
FunctionEnd

Function LicenseShow
${HideWindow} 1006
${HideWindow} 1031
FunctionEnd

As a workaround, I just took away the WS_VISIBLE flag from the dialogs in the resource, but I still think what I was doing should work.

$HWNDPARENT is the handle to the outer dialog. You need the handle to the inner dialog by using:
FindWindow $0 "#32770" "" $HWNDPARENT
I'm surprised that the labels are being hidden at all.

-Stu


:eek: I feel dumb...