例子:Sendmessage简单例子
优质
小牛编辑
132浏览
2023-12-01
引用test.nsi的内容:
;Sendmessage简单例子 ;WWW.Dreams8.CoM ; !include "WinMessages.nsh" !include "LogicLib.nsh" name "Sendmessage简单例子" outfile "test.exe" page custom show leave reservefile "pagecustom.ini" section sectionend var HWND function .oninit initpluginsdir setoutpath $pluginsdir file "pagecustom.ini" functionend function show installoptions::initdialog /nounload $pluginsdir\pagecustom.ini Pop $HWND installoptions::show functionend function leave ReadINIStr $0 "$pluginsdir\pagecustom.ini" Settings State ReadINIStr $3 "$pluginsdir\pagecustom.ini" "Field 3" "HWND" ReadINIStr $4 "$pluginsdir\pagecustom.ini" "Field 4" "HWND" ReadINIStr $5 "$pluginsdir\pagecustom.ini" "Field 5" "HWND" ${Switch} $0 ${Default} Abort ${Case} 2 ;全选(001,002,003) SendMessage $3 ${BM_SETCHECK} 1 0 SendMessage $4 ${BM_SETCHECK} 1 0 SendMessage $5 ${BM_SETCHECK} 1 0 Abort ${Case} 6 ;使001不可用 EnableWindow $3 0 Abort ${Case} 8 ;全否(001,002,003) SendMessage $3 ${BM_SETCHECK} 0 0 SendMessage $4 ${BM_SETCHECK} 0 0 SendMessage $5 ${BM_SETCHECK} 0 0 Abort ${Case} 7 ;使001可用 EnableWindow $3 1 Abort ${Case} 0 ${EndSwitch} functionend
引用pagecustom.ini的内容:
; ;WWW.Dreams8.CoM ; [Settings] NumFields=8 [Field 1] Type=Groupbox Text=消息学习Sendmessage Left=32 Right=229 Top=17 Bottom=107 [Field 2] Type=RadioButton Flags=NOTIFY Text=全选(001,002,003) State=0 Left=48 Right=132 Top=35 Bottom=46 [Field 3] Type=Checkbox Flags=NOTIFY Text=001 State=0 Left=48 Right=88 Top=56 Bottom=67 [Field 4] Type=Checkbox Text=002 Left=100 Right=144 Top=56 Bottom=66 Flags=NOTIFY State=0 [Field 5] Type=Checkbox Text=003 Left=159 Right=207 Top=58 Bottom=66 Flags=NOTIFY State=0 [Field 6] Type=Button Text=使001不可用 Flags=NOTIFY Left=46 Right=130 Top=78 Bottom=94 [Field 7] Type=Button Text=使001可用 Flags=NOTIFY Left=138 Right=222 Top=78 Bottom=94 [Field 8] Type=RadioButton Text=全否(001,002,003) Flags=NOTIFY State=0 Left=141 Right=227 Top=35 Bottom=46