Archive: Wrong Handle of MUI_PAGE_INSTFILES? or what?


Wrong Handle of MUI_PAGE_INSTFILES? or what?
Hi all:
Im using an nsis script like a loader of aplications it works very fine now, but, i just want to add a last feature "Hide the Minimize" button of my "only page" the "MUI_PAGE_INSTFILES", but i cant get the handle or i dont know whats wrong, this is my script:


!define MF_GRAYED 1
!define SC_MINIMIZE 0xF020
!define SC_MAXIMIZE 0xF030
!define SC_CLOSE 0xF060
!define NOMBRE "Boot"
!define VERSION "v1.0"

!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit

!define MUI_ICON "IMG\icon_install.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "IMG\header-install.bmp"

;LIBS
!include "MUI2.nsh"
!include "WinMessages.nsh"
!include "WordFunc.nsh"
!include "Library.nsh"

;PAGES
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE Spanish

BrandingText "srl"
Name "${NOMBRE} ${VERSION}"
CRCCheck on
Caption "Boot"
XPStyle off
VIProductVersion 1.0.0.0
VIAddVersionKey /LANG=${LANG_SPANISH} ProductName "Inicio de CAI v5.0 v1.0"
VIAddVersionKey /LANG=${LANG_SPANISH} ProductVersion "v1.0"
VIAddVersionKey /LANG=${LANG_SPANISH} FileVersion "v1.0"
VIAddVersionKey /LANG=${LANG_SPANISH} FileDescription "Boot"
VIAddVersionKey /LANG=${LANG_SPANISH} LegalCopyright "srl"
ShowInstDetails nevershow
ShowUninstDetails nevershow
AutoCloseWindow true
SetOverwrite on
SetDatablockOptimize on
InstallDir "C:\Archivos de Programa\Boot"
OutFile "Bootnnova.exe"
AUTOCLOSEWINDOW true

;Secciones

Section "Install"
#0.-
#HIDE SOME BUTTONS FROM THE PAGE
GetDlgItem $R0 $HWNDPARENT 1
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 2
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 3
ShowWindow $R0 ${SW_HIDE}

#0.-
#DISABLE MIMIZED BUTTON
#THE NEXT CODE DONT WORK AT RUN TIME
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})'

#NOT EVEN THIS ONE WORKS AT RUN 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'


#1-
EXECWAIT '"$INSTDIR\EXE1.exe"'

sleep 1000

#2-
EXECWAIT '"$INSTDIR\EXE2.exe"'

SectionEnd


Function myGUIInit
!macro GetReturnValue
!ifdef DEBUG
Pop $R9
StrCmp $R9 success +2
DetailPrint "Error: $R9"
!endif
!macroend

!ifdef DEBUG
BgImage::SetReturn /NOUNLOAD on
!endif

#DESCOMPRIMIR EL FONDO
SETOUTPATH "$INSTDIR\Imagenes"
File "Imagenes\Background.bmp"

#SET BACKGROUND
BgImage::SetBg /NOUNLOAD /FILLSCREEN $INSTDIR\Imagenes\Background.bmp
!insertmacro GetReturnValue
#REDRAW
BgImage::Redraw /NOUNLOAD

FunctionEnd

Function .onGUIEnd

#DELETE BACKGROUND
Delete "$INSTDIR\Imagenes\Background.bmp"

FunctionEnd

Function .onInit
;ONLY ONE INSTANCE
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +2
quit

functionend



So?? :confused: what is wrong?? and a little question more:

¿How can i hide this loader not showing it at the taskbar?

Thanks in advance for all the help bye...
:up: ;)

Change in each EnableMenuItem(i s to EnableMenuItem(i r0
The handle isn't on the stack.

Stu


Re: Wrong Handle of MUI_PAGE_INSTFILES? or what?

Originally posted by AuGuS666
¿How can i hide this loader not showing it at the taskbar?
[/B]
Three steps: 1) hide the main window 2) add the Extended Style bit WS_EX_TOOLWINDOW (0x080) 3) reenable the main window.

Don

;)
Testing in progress :D
Ill post reply soon...


Well this is the working code for what i was looking for:



#0.1
#0.-HIDE MAIN WINDOW FROM UPDATES
ShowWindow $HWNDPARENT ${SW_HIDE}

#0.2
#HIDE BUTTONS OK -----------------
GetDlgItem $R0 $HWNDPARENT 1
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 2
ShowWindow $R0 ${SW_HIDE}
GetDlgItem $R0 $HWNDPARENT 3
ShowWindow $R0 ${SW_HIDE}

#0.3
#Afrow UK SUGGEST
#HIDE MINIMIZE FROM MENU OK ---------------------------------------------
System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i r0, i ${SC_MINIMIZE}, i ${MF_GRAYED})'
System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i r0, i ${SC_MAXIMIZE}, i ${MF_GRAYED})'
System::Call 'user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r0'
System::Call 'user32::EnableMenuItem(i r0, i ${SC_CLOSE}, i ${MF_GRAYED})'
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'

#0.4
#demiller9 SUGGEST
#TO HIDE THE APLICATION FROM THE TASK BAR
!insertmacro _NSD_AddExStyle $HWNDPARENT 0x080
ShowWindow $HWNDPARENT ${SW_SHOW}

...


Thanks for the tips :)