Archive: How to hide the close button on a custom page window?


How to hide the close button on a custom page window?
I have one custom page, want to hide the close[X] button, because we don't want users to cancel or close the page during copying files.
Any thoughts, thanks.


In your custom ini under settings add CancelEnabled=0

EDIT: gosh I misunderstood, you mean the X button, if I remember correctly discussed recently here, perform a forum search.


The X button maps to the Cancel button. If that's the disabled, the X button has no effect.


Yeah, I have disabled cancel button, the close button doesn't work at all.
So since the close button looks like a dummy button, why need I to show to users?
That's why I want to hide it as well.


I am wodering that the code you gave me last time:

System::Call 'user32::GetWindowLong(i $hwndparent,i -16)i.r0'
intop $1 0x30000 ~
intop $0 $0 & $1
System::Call 'user32::SetWindowLong(i $hwndparent,i -16,i $0)i'

this function can hide the System Minimize and Maximize buttons, how can i just modify it to hide the close button, and only can apply it on my specific custom page.

Thank you guys.


Use tonight's nightly build of InstallOptions where the X button is disabled when the CancelEnabled=0 is used, or use the code from the following thread.

http://forums.winamp.com/showthread....hreadid=270392


sorry, I wanna apply it to install page...
!define MUI_PAGE_CUSTOMFUNCTION_PRE 'CopyFiles'
!insertmacro MUI_PAGE_INSTFILES

!define SC_MINIMIZE 0xF020
!define SC_MAXIMIZE 0xF030
!define SC_CLOSE 0xF060

!define MF_GRAYED 1

Function CopyFiles

GetDlgItem $R0 $HWNDPARENT 1
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 2
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 3
ShowWindow $R0 ${SW_HIDE}

System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i s, i ${SC_MINIMIZE}, i ${MF_GRAYED})'
System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i s, i ${SC_MAXIMIZE}, i ${MF_GRAYED})'
System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i s, i ${SC_CLOSE}, i ${MF_GRAYED})'
FunctionEnd


it seems that I can hide "next, cancel,back" button, but i couldn't hide the Close[X] button?
something wrong with my code?


That code doesn't hide the button. It only disables it.


yeah...
I have download the latest buid of NSIS, the close button looks disabled
that what I want, if it could be hidden, then would be perfect for me.