Archive: need IO with no buttons


need IO with no buttons
i have a little problem.

i have an IO with infos but i dont need any button 'cause behind this IO there is action and when action is done IO is closed.
Unfortunatly IO has those buttons and one has to be pressed to continue action.

is it possible to have an IO without any button?

thx


IO allows you to disable the back and cancel button using CancelEnabled and BackEnabled. In the latest CVS version you can also disable and enable windows using EnableWindow from the script. Use this to disable the next button too:

GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0


>> using CancelEnabled and BackEnabled.

This is what i already have - all buttons are disabled (0) in IO - i only get "Fertigstellen" (german) (and "Beenden" greyed out)

hmm, where must i put that code?
Like this it disables the buttons from the next pane not the concerning IO

;Modern UI Configuration
page custom dosilent


Function dosilent
;if silent do backup and save all options
Call IsSilent
IfSilent notSilent 0
;silent stuff
call checkbackupfolder

;disable all buttons
GetDlgItem $5 $HWNDPARENT 1
EnableWindow $5 0

dosilent01:
!insertmacro MUI_HEADER_TEXT "Taskplaner" "These files are saved now.$\nPlease wait a moment"

dosilent04:
Push $INSTDIR
Call ConvertBStoDBS2
Pop ${TEMP1}


dosilent05:
!insertmacro MUI_INSTALLOPTIONS_WRITE "$R3silent01.ini" "Field 6" "Text" ${TEMP1}
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "$R3silent01.ini"
dosilent06:

sleep 5000 ;just testing
Quit
notSilent:
FunctionEnd

Replace MUI_INSTALLOPTIONS_DISPLAY with MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW and put the code between them.


yeah works so far
i had no success with _SHOW last night - i found it in the changelog and unfortunately i could not work with it. it was very late for me.


dosilent05:
!insertmacro MUI_INSTALLOPTIONS_WRITE "$R3silent01.ini" "Field 6" "Text" ${TEMP1}
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "$R3silent01.ini"
;disable all buttons
GetDlgItem $5 $HWNDPARENT 1
EnableWindow $5 0
!insertmacro MUI_INSTALLOPTIONS_SHOW
dosilent06:

sleep 5000
Quit


But now i have another problem - IO is waiting for input again.
i had to kick my prog with the taskmanager.

What do you mean waiting for input? Isn't that program of yours supposed to close IO?


i mean - input=button

i want this behaviour:
if "silent"
- show IO with infos (no user input)
- while showing IO do savings in background
- when done close IO and show messagebox success

(strip .nsi from attachment)

is that possible overall?

PS $R3 in script above contains language shorty - for attachment it is "e" - if you intend to test it.


Works fine for me... IO has no buttons enabled whatsoever. All you need to do is get your program to make IO destroy itself.


Does not work here... :(

you see that sleep command (for test) at the end (before quit) ?

That command is never reached. thats my trouble


So your program doesn't close IO? I thought your problem is just disabling the buttons... What you're trying to do is impossible (without changes to the source of course). IO is not multi-threaded and the script can't continue while IO is still running. For that there is the broken banner. It should work outside of .onInit though...


damn - so i have to use banners.

BTW how can i close the IO?


All you need to do is send the main NSIS window WM_COMMAND with 1 as wParam.


SendMessage HWND "" WM_COMMAND 1

?

when & where?

:confused:


In another application that will do the action. You can create a sub installer that will do all the action and send a message to the main window. To get the $HWNDPARENT into the sub installer you can pass it on the command line.


hmm, nice idea

you this one?

Exec '"prog.exe" $HWNDPARENT'

And prog.exe gets $CMDLINE and close it afterwards?


Yep, but don't close it, send the WM_COMMAND message.


thats what i mean ;)

SendMessage HWND "" WM_COMMAND #

(where # is from cmdline)
or - hmm, dont know now - confused...


SendMessage $HwndFromCMDLINE ${WM_COMMAND} 1 0


i though it was wrong what i wrote :D

thank you kichik :)