F=far.Flags Event group:"DialogEvent" description:"Extend Quit Dialog" action:(event,param)-> if event==F.DE_DLGPROCINIT and param.Msg==F.DN_INITDIALOG id=far.SendDlgMessage param.hDlg,F.DM_GETDIALOGINFO id=id and id.Id or "" if id==win.Uuid far.Guids.FarAskQuitId windows=far.AdvControl F.ACTL_GETWINDOWCOUNT,0,0 viewers,editors,ss=0,0,"" for ii=1,windows do info=far.AdvControl F.ACTL_GETWINDOWINFO,ii,0 if info and F.WTYPE_VIEWER==info.Type then viewers+=1 if info and F.WTYPE_EDITOR==info.Type then editors+=1 if viewers>0 or editors>0 if viewers>0 ss..="\nOpen viewer(s): %d"..viewers if editors>0 ss..="\nOpen editor(s): %d"..editors ss..="\n\n" code = (1==far.Message ss.."Do you want to quit FAR?","Quit",";YesNo") and 4 or 5 param.hDlg\send "DM_CLOSE",code false |