最新消息:

即时获取复选框通知

nsis 永恒心锁 1374浏览 0评论
outfile 'CheckboxNotify.exe'
showinstdetails show
licenseData 'QQ.rtf'
!define NOCHECKED_TEXT '请选择一个勾选'
!include WinMessages.nsh
!include LogicLib.nsh
page license
page custom CustomCreate CustomLeave
page instfiles
section -
sectionend
function .onInit
initpluginsdir
gettempfilename $0
rename $0 '$PLUGINSDIRcustom.ini'
call WriteIni
functionend
function CustomCreate
push $R1
InstallOptions::InitDialog /NOUNLOAD '$PLUGINSDIRcustom.ini'
pop $R1
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
InstallOptions::Show '$PLUGINSDIRcustom.ini'
pop $R1
pop $R1
pop $R1
functionend
function CustomLeave
readinistr $0 '$PLUGINSDIRcustom.ini' 'Settings' 'State'
${if} $0 == 1
readinistr $1 '$PLUGINSDIRcustom.ini' 'Field 1' 'Text'
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIRcustom.ini' 'Field 1' 'State'
${if} $3 == 1
SendMessage $2 ${WM_SETTEXT} 1 'STR:$1'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1
${else}
SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
${endif}
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 2' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 3' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${elseif} $0 == 2
readinistr $1 '$PLUGINSDIRcustom.ini' 'Field 2' 'Text'
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIRcustom.ini' 'Field 2' 'State'
${if} $3 == 1
SendMessage $2 ${WM_SETTEXT} 1 'STR:$1'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1
${else}
SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
${endif}
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 1' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 3' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${elseif} $0 == 3
readinistr $1 '$PLUGINSDIRcustom.ini' 'Field 3' 'Text'
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIRcustom.ini' 'Field 3' 'State'
${if} $3 == 1
SendMessage $2 ${WM_SETTEXT} 1 'STR:$1'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1
${else}
SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}'
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
${endif}
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 1' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIRcustom.ini' 'Field 2' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${endif}
functionend
function WriteIni
WriteIniStr '$PLUGINSDIRcustom.ini' 'Settings' 'NumFields' '5'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Left' '2'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Top' '2'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Right' '100'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Bottom' '14'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Text' 'Checkbox one'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'State' '0'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 1' 'Flags' 'NOTIFY'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Left' '2'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Top' '18'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Right' '100'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Bottom' '32'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Text' 'Checkbox two'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'State' '0'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 2' 'Flags' 'NOTIFY'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Left' '2'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Top' '36'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Right' '100'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Bottom' '50'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Text' 'Checkbox three'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'State' '0'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 3' 'Flags' 'NOTIFY'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Type' 'GroupBox'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Left' '30'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Top' '70'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Right' '-31'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Bottom' '120'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 4' 'Text' 'Select Checkbox'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'Type' 'Text'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'Left' '40'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'Top' '90'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'Right' '-41'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'Bottom' '105'
WriteIniStr '$PLUGINSDIRcustom.ini' 'Field 5' 'State' '${NOCHECKED_TEXT}'
Functionend
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » 即时获取复选框通知

您必须 登录 才能发表评论!