请帮忙!在NSIS,我正在使用
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
然后
Function LicenseShow
; New dialog for custom items
nsDialogs::Create 1018
Pop $0
; Accept button
${NSD_CreateButton} 373, 223, 50, 14 "Accept" ; Can't find IDOK (1) in the custom UI!
; Decline button
${NSD_CreateButton} 21, 223, 50, 14 "Decline"
; Picture
${NSD_CreateBitmap} 5 5 100% 100 "disclosure.bmp"
Pop $0
${NSD_SetImage} $0 $PLUGINSDIR\image.bmp $ImageHandle
; Disclaimer
nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_WANTRETURN}|${ES_MULTILINE} ${__NSD_Text_EXSTYLE} 5 220 660 115 ''
Pop $1
SendMessage $1 ${EM_SETREADONLY} 1 0
SetCtlColors $1 0x000000 0xFFFFFF
${NSD_SetText} $1 "The license text"
nsDialogs::Show
${NSD_FreeImage} $ImageHandle
FunctionEnd
如何判断“接受”按钮上是否有IDOK?
请帮忙。
答案 0 :(得分:0)
您可以通过调用System::Call 'user32::SetWindowLong(i $myhwnd,i -12,i $mynewid)'
来设置ID,但您真正应该做的是设置回调函数:
...
${NSD_CreateButton} ...
pop $0
${NSD_OnClick} $0 userclicked
...
Function userclicked
MessageBox mb_ok Hello
SendMessage $hwndparent ${WM_COMMAND} 1 0
FunctionEnd