最新消息:

即时获取复选框通知

nsis 永恒心锁 1088浏览 0评论
outfile 'CheckboxNotify.exe'
showinstdetails show


!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 '$PLUGINSDIR\custom.ini'
call WriteIni
functionend

function CustomCreate
push $R1
InstallOptions::InitDialog /NOUNLOAD '$PLUGINSDIR\custom.ini'
pop $R1 
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
InstallOptions::Show '$PLUGINSDIR\custom.ini'
pop $R1 
pop $R1 
pop $R1
functionend

function CustomLeave
readinistr $0 '$PLUGINSDIR\custom.ini' 'Settings' 'State'
${if} $0 == 1
readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 1' 'Text'
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIR\custom.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 '$PLUGINSDIR\custom.ini' 'Field 2' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 3' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${elseif} $0 == 2
readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 2' 'Text'
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIR\custom.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 '$PLUGINSDIR\custom.ini' 'Field 1' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 3' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${elseif} $0 == 3
readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 3' 'Text'
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND'
readinistr $3 '$PLUGINSDIR\custom.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 '$PLUGINSDIR\custom.ini' 'Field 1' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 2' 'HWND'
SendMessage $2 ${BM_SETCHECK} 0 0
abort
${endif}
functionend

function WriteIni
WriteIniStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '5'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Left' '2'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Top' '2'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Right' '100'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Bottom' '14'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' 'Checkbox one'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'State' '0'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Flags' 'NOTIFY'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Left' '2'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Top' '18'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Right' '100'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Bottom' '32'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Text' 'Checkbox two'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' '0'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Flags' 'NOTIFY'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Type' 'Checkbox'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Left' '2'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Top' '36'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Right' '100'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Bottom' '50'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Text' 'Checkbox three'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'State' '0'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Flags' 'NOTIFY'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Type' 'GroupBox'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Left' '30'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Top' '70'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Right' '-31'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Bottom' '120'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Text' 'Select Checkbox'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Type' 'Text'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Left' '40'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Top' '90'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Right' '-41'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Bottom' '105'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'State' '${NOCHECKED_TEXT}'
Functionend
免责声明:根据《计算机软件保护条例》第十七条规定“为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。”您需知晓本站所有内容资源均来源于网络,仅供用户交流学习与研究使用,版权归属原版权方所有,版权争议与本站无关,用户本人下载后不能用作商业或非法用途,需在24个小时之内从您的电脑中彻底删除上述内容,否则后果均由用户承担责任;如果您访问和下载此文件,表示您同意只将此文件用于参考、学习而非其他用途,否则一切后果请您自行承担,如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。丨本站为个人博客非盈利性站点,所有软件信息均来自网络,所有资源仅供学习参考研究目的,并不贩卖软件,不存在任何商业目的及用途。丨本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权BY-NC-SA协议进行授权

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

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