jammusi
27th January 2010 10:58 UTC
Hiding finish page run program check box
Hi,
1. I'm trying to hide the finish page run text box (added with !define MUI_FINISHPAGE_RUN)
2. This check box is defined for both Install and uninstall finish pages
3. This is how i try to do that (within the finish page show page call back)
;Find the internal window in the finish page
FindWindow $5 "#32770" "" $HWNDPARENT
;Get the check box handle
GetDlgItem $3 $5 "1203" ; 1203 - control id
;uncheck it
SendMessage $3 ${WM_LBUTTONDOWN} 0 0
SendMessage $3 ${WM_LBUTTONUP} 0 0 ;
;Hide the window
ShowWindow $3 ${SW_HIDE}
4. The problem is that this is not working always
For example:
- If i display only the welcome and finish pages - it works
- If I add any other page (say Install files page) it doesn't work.
Debugging using dumpstate and WinSpy++ I can see that in the second case the code line
FindWindow $5 "#32770" "" $HWNDPARENTdoes not return the handle to the internal window but rather to another window I can not recognize - thus the check box is not found and the all thing does not succeed
Any idea why?5. Also I read in the thread
forums.winamp.com/showthread.php?postid=1364382 about the $MUI_HWND that is supposed to hold the internal windows handle. but this one is not populated for me.
Ideas please?Tx
Jammusi
jpderuiter
27th January 2010 11:39 UTC
First of all, why creating a checkbox, and then later hide it?
Or do you do that conditionally?
Anyway, have a look at these threads:
http://forums.winamp.com/showthread....hreadid=291799
http://forums.winamp.com/showthread....hreadid=273029
http://forums.winamp.com/showthread....hreadid=248633
jammusi
27th January 2010 12:01 UTC
1. Yes I do conditionally ;-)
2. The first link suggest using $mui.FinishPage for MUI2 and that $MUI_HWND does not work for MUI1 - this answer the second question. Cool but still
What to do with $mui.FinishPage - can not find documentation for that
3. Unless i miss something - it seems that the other links do the same as me
Afrow UK
27th January 2010 15:02 UTC
The check box handle should already be stored in $mui.FinishPage.Run.
Stu
jammusi
27th January 2010 17:58 UTC
Yep - mui.FinishPage.Run
That's the answer
Thanks
BUT
It took me few hours to understand the problem
When I reference the mui.FinishPage.Run within the nsi file - all good
I have though another nsi file holding common functions, which i include in some scripts.
The function hiding the checkbox is defined there.
It seems in that case the mui.FinishPage.Run was not defined as:
StrCpy $0 $mui.FinishPage.Run
Leaves $0 have the string value "$mui.FinishPage.Run" rather than the handle.
Why is that?
MSG
27th January 2010 21:37 UTC
I have though another nsi file holding common functions, which i include in some scripts.
The function hiding the checkbox is defined there.
It seems in that case the mui.FinishPage.Run was not defined as:
StrCpy $0 $mui.FinishPage.Run
Leaves $0 have the string value "$mui.FinishPage.Run" rather than the handle.
Why is that?
That's because you included the common functions file before you included MUI2.nsh. Reverse the order and it should work. (Although perhaps you also need to define the pages before the variable becomes active, I'm not sure. Try it out.)
Edit: On second thought... If a variable doesn't exist, it shouldn't become a string, should it? The value becoming "$mui.FinishPage.Run" seems rather weird. o__O
jammusi
27th January 2010 22:07 UTC
I include mui2 first