Archive: disable buttons while actions


disable buttons while actions
i want disable all buttons, than patch my files and if this ready, i want enable only the next button.


call write_patchFiles.ini
InstallOptions::InitDialog /NOUNLOAD c:\patchFiles.ini #initialisiert die Seite
!insertmacro MUI_HEADER_TEXT 'patchFiles-headertext' 'PatchFiles-subtext'
InstallOptions::Show #'c:\patchFiles.ini' zeigt die Seite an

GetDlgItem $2 $HWNDPARENT 3
EnableWindow $2 0
GetDlgItem $1 $HWNDPARENT 2
EnableWindow $1 0
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0

#patch actions, write files etc.#

GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 1



the Problem is, the buttons are enabled all the time.

Do you search the forum before posting your questions? IMHO no.


yes


Don't get HWND's using GetDlgItem. Use ReadINIStr instead.

InstallOptions documentation reads:
After initDialog returns, this will contain the HWND of the control created by this field. It can be used instead of FindWindow and GetDlgItem.

Use the documentation, please.


(CODE)
Function write_patchFiles.ini

WriteIniStr 'c:\patchFiles.ini' 'Settings' 'NumFields' '1'
WriteIniStr 'c:\patchFiles.ini' 'state' 'State' '0'

WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Type' 'Label'
WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Text' 'Die Installation wird abgeschlossen, bitte Warten!'
WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Left' '30'
WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Right' '250'
WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Top' '30'
WriteIniStr 'c:\patchFiles.ini' 'Field 1' 'Bottom' '50'

FunctionEnd
[/CODE]

i have no Field that i change, only a Label for information.


Try moving the code to the page's leave function rather than having it in the show function after InstallOptions::Show.

pospec he is using GetDlgItem correctly to get the handles of the back, next and cancel buttons.

Stu


works. thank you Afrow.

Can i move from createFunction zo LeaveFunktion automaticly without klicking a button?

the problem is , that i want disable the buttons while patching, and display a message or labal "wait" for the use. That he knows, all is right, there is no Failure.

you know what i mean?