여러분이 다시 나를 도울 수 있기를 바랍니다. 나는 커스텀 페이지를 만들었고, 그 페이지에는 텍스트 필드와 풀리스트가있다. 나는 또한 클리어 버튼을 누르면 화면상의 모든 필드가 지워진다.NSIS 버튼 누름시 텍스트 및 드롭리스트 다시 설정
참고 : 나는 예
내가 가진 문제에 TestNotify.nsu의 코드를 사용하더라도 분명한 값이 마지막 필드는 채우기를 사용하여 프로그램을 다시로드에 있도록 INI 파일에 기록을 압박 한 (이다 내가 분명히 누르면, ini 파일을 두 번 지워야 만합니다.)
둘째, 어떻게하면 리셋을 누를 때 선택한 드롭리스트를 기본값으로 재설정 할 수 있습니까?
내가 지금하고있는 유일한 부분은 clearbtn입니다. 그래서 어떻게 한 번만 droplists를 특정 값으로 재설정하고 한 번만 지울 때 ini에서 데이터를 지울 수 있습니다.
###Add Auto Start option
SetCompressor lzma
XPStyle on
!define FolderImages "Included\Images"
!define ImageIcon "Icon.ico"
!define ImageHDR "HDR.bmp"
!define PRODUCT_NAME "Test"
!define PRODUCT_VERSION "1.0"
!define MUI_ICON ".\${FolderImages}\${ImageIcon}"
Icon ".\${FolderImages}\${ImageIcon}"
!include WinVer.nsh
!include LogicLib.nsh
!include x64.nsh
!include FileFunc.nsh
!include MUI.nsh
!include WinMessages.nsh
!include InstallOptions.nsh
!include Sections.nsh
!include nsDialogs.nsh
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\${FolderImages}\${ImageHDR}"
Page custom SetCustom ValidateCustom
!insertmacro MUI_LANGUAGE "English"
Function SetCustom
!insertmacro MUI_HEADER_TEXT "Licence Key Generator" "Create or Read Licence Keys"
#Hides the close button
GetDlgItem $R0 $HWNDPARENT 1
ShowWindow $R0 ${SW_HIDE}
InstallOptions::initDialog ".\UserProfiles.ini"
; In this mode InstallOptions returns the window handle so we can use it
Pop $0
; Now show the dialog and wait for it to finish
InstallOptions::show
; Finally fetch the InstallOptions status value (we don't care what it is though)
Pop $0
FunctionEnd
Function ValidateCustom
# At this point the user has either pressed cancel or one of our custom buttons
# We find out which by reading from the INI file
ReadINIStr $0 ".\UserProfiles.ini" "Settings" "State"
StrCmp $0 0 cancelbtn
StrCmp $0 19 createbtn
StrCmp $0 20 readbtn
StrCmp $0 21 comparebtn
StrCmp $0 22 clearbtn
Abort # Return to the page
createbtn:
Abort # Return to the page
readbtn:
Abort # Return to the page
comparebtn:
Abort # Return to the page
clearbtn:
#Text Field
ReadINIStr $1 ".\UserProfiles.ini" "Field 6" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
#Text Field
ReadINIStr $1 ".\UserProfiles.ini" "Field 8" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
#Text Field
ReadINIStr $1 ".\UserProfiles.ini" "Field 10" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
#Drop List ------------------------------------------------------------<<<<
ReadINIStr $1 ".\UserProfiles.ini" "Field 12" "HWND"
SendMessage $1 ${WM_SETTETX} 0 "STR:"
#Text Field
ReadINIStr $1 ".\UserProfiles.ini" "Field 14" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
#Drop List ------------------------------------------------------------<<<<
ReadINIStr $1 ".\UserProfiles.ini" "Field 16" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
#Text Field
ReadINIStr $1 ".\UserProfiles.ini" "Field 18" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
Abort # Return to the page
cancelbtn:
FunctionEnd
Section Dummy
SectionEnd
최소한의 UserProfiles.ini를 게시하면 도움이됩니다. – Anders
WM_SETTETX는 오타입니다. – Anders