nsDialogs.nsh 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. /*
  2. nsDialogs.nsh
  3. Header file for creating custom installer pages with nsDialogs
  4. */
  5. !ifndef NSDIALOGS_INCLUDED
  6. !verbose push 2
  7. !define NSDIALOGS_INCLUDED
  8. !verbose 3
  9. !include LogicLib.nsh
  10. !include WinMessages.nsh
  11. !define /ifndef WS_EX_DLGMODALFRAME 0x00000001
  12. !define /ifndef WS_EX_NOPARENTNOTIFY 0x00000004
  13. !define /ifndef WS_EX_TOPMOST 0x00000008
  14. !define /ifndef WS_EX_ACCEPTFILES 0x00000010
  15. !define /ifndef WS_EX_TRANSPARENT 0x00000020
  16. !define /ifndef WS_EX_MDICHILD 0x00000040
  17. !define /ifndef WS_EX_TOOLWINDOW 0x00000080
  18. !define /ifndef WS_EX_WINDOWEDGE 0x00000100
  19. !define /ifndef WS_EX_CLIENTEDGE 0x00000200
  20. !define /ifndef WS_EX_CONTEXTHELP 0x00000400
  21. !define /ifndef WS_EX_RIGHT 0x00001000
  22. !define /ifndef WS_EX_LEFT 0x00000000
  23. !define /ifndef WS_EX_RTLREADING 0x00002000
  24. !define /ifndef WS_EX_LTRREADING 0x00000000
  25. !define /ifndef WS_EX_LEFTSCROLLBAR 0x00004000
  26. !define /ifndef WS_EX_RIGHTSCROLLBAR 0x00000000
  27. !define /ifndef WS_EX_CONTROLPARENT 0x00010000
  28. !define /ifndef WS_EX_STATICEDGE 0x00020000
  29. !define /ifndef WS_EX_APPWINDOW 0x00040000
  30. !define /ifndef WS_CHILD 0x40000000
  31. !define /ifndef WS_VISIBLE 0x10000000
  32. !define /ifndef WS_DISABLED 0x08000000
  33. !define /ifndef WS_CLIPSIBLINGS 0x04000000
  34. !define /ifndef WS_CLIPCHILDREN 0x02000000
  35. !define /ifndef WS_MAXIMIZE 0x01000000
  36. !define /ifndef WS_BORDER 0x00800000
  37. !define /ifndef WS_VSCROLL 0x00200000
  38. !define /ifndef WS_HSCROLL 0x00100000
  39. !define /ifndef WS_GROUP 0x00020000
  40. !define /ifndef WS_MINIMIZEBOX 0x00020000
  41. !define /ifndef WS_MAXIMIZEBOX 0x00010000
  42. !define /ifndef WS_TABSTOP 0x00010000
  43. !define ES_LEFT 0x00000000
  44. !define ES_CENTER 0x00000001
  45. !define ES_RIGHT 0x00000002
  46. !define ES_MULTILINE 0x00000004
  47. !define ES_UPPERCASE 0x00000008
  48. !define ES_LOWERCASE 0x00000010
  49. !define ES_PASSWORD 0x00000020
  50. !define ES_AUTOVSCROLL 0x00000040
  51. !define ES_AUTOHSCROLL 0x00000080
  52. !define ES_NOHIDESEL 0x00000100
  53. !define ES_OEMCONVERT 0x00000400
  54. !define ES_READONLY 0x00000800
  55. !define ES_WANTRETURN 0x00001000
  56. !define ES_NUMBER 0x00002000
  57. !define ES_SAVESEL 0x00008000
  58. !define SS_LEFT 0x00000000
  59. !define SS_CENTER 0x00000001
  60. !define SS_RIGHT 0x00000002
  61. !define SS_ICON 0x00000003
  62. !define SS_BLACKRECT 0x00000004
  63. !define SS_GRAYRECT 0x00000005
  64. !define SS_WHITERECT 0x00000006
  65. !define SS_BLACKFRAME 0x00000007
  66. !define SS_GRAYFRAME 0x00000008
  67. !define SS_WHITEFRAME 0x00000009
  68. !define SS_USERITEM 0x0000000A
  69. !define SS_SIMPLE 0x0000000B
  70. !define SS_LEFTNOWORDWRAP 0x0000000C
  71. !define SS_OWNERDRAW 0x0000000D
  72. !define SS_BITMAP 0x0000000E
  73. !define SS_ENHMETAFILE 0x0000000F
  74. !define SS_ETCHEDHORZ 0x00000010
  75. !define SS_ETCHEDVERT 0x00000011
  76. !define SS_ETCHEDFRAME 0x00000012
  77. !define SS_TYPEMASK 0x0000001F
  78. !define SS_REALSIZECONTROL 0x00000040
  79. !define SS_NOPREFIX 0x00000080
  80. !define SS_NOTIFY 0x00000100
  81. !define SS_CENTERIMAGE 0x00000200
  82. !define SS_RIGHTJUST 0x00000400
  83. !define SS_REALSIZEIMAGE 0x00000800
  84. !define SS_SUNKEN 0x00001000
  85. !define SS_EDITCONTROL 0x00002000
  86. !define SS_ENDELLIPSIS 0x00004000
  87. !define SS_PATHELLIPSIS 0x00008000
  88. !define SS_WORDELLIPSIS 0x0000C000
  89. !define SS_ELLIPSISMASK 0x0000C000
  90. !define BS_PUSHBUTTON 0x00000000
  91. !define BS_DEFPUSHBUTTON 0x00000001
  92. !define BS_CHECKBOX 0x00000002
  93. !define BS_AUTOCHECKBOX 0x00000003
  94. !define BS_RADIOBUTTON 0x00000004
  95. !define BS_3STATE 0x00000005
  96. !define BS_AUTO3STATE 0x00000006
  97. !define BS_GROUPBOX 0x00000007
  98. !define BS_USERBUTTON 0x00000008
  99. !define BS_AUTORADIOBUTTON 0x00000009
  100. !define BS_PUSHBOX 0x0000000A
  101. !define BS_OWNERDRAW 0x0000000B
  102. !define BS_TYPEMASK 0x0000000F
  103. !define BS_LEFTTEXT 0x00000020
  104. !define BS_TEXT 0x00000000
  105. !define BS_ICON 0x00000040
  106. !define BS_BITMAP 0x00000080
  107. !define BS_LEFT 0x00000100
  108. !define BS_RIGHT 0x00000200
  109. !define BS_CENTER 0x00000300
  110. !define BS_TOP 0x00000400
  111. !define BS_BOTTOM 0x00000800
  112. !define BS_VCENTER 0x00000C00
  113. !define BS_PUSHLIKE 0x00001000
  114. !define BS_MULTILINE 0x00002000
  115. !define BS_NOTIFY 0x00004000
  116. !define BS_FLAT 0x00008000
  117. !define BS_RIGHTBUTTON ${BS_LEFTTEXT}
  118. !define CBS_SIMPLE 0x0001
  119. !define CBS_DROPDOWN 0x0002
  120. !define CBS_DROPDOWNLIST 0x0003
  121. !define CBS_OWNERDRAWFIXED 0x0010
  122. !define CBS_OWNERDRAWVARIABLE 0x0020
  123. !define CBS_AUTOHSCROLL 0x0040
  124. !define CBS_OEMCONVERT 0x0080
  125. !define CBS_SORT 0x0100
  126. !define CBS_HASSTRINGS 0x0200
  127. !define CBS_NOINTEGRALHEIGHT 0x0400
  128. !define CBS_DISABLENOSCROLL 0x0800
  129. !define CBS_UPPERCASE 0x2000
  130. !define CBS_LOWERCASE 0x4000
  131. !define LBS_NOTIFY 0x0001
  132. !define LBS_SORT 0x0002
  133. !define LBS_NOREDRAW 0x0004
  134. !define LBS_MULTIPLESEL 0x0008
  135. !define LBS_OWNERDRAWFIXED 0x0010
  136. !define LBS_OWNERDRAWVARIABLE 0x0020
  137. !define LBS_HASSTRINGS 0x0040
  138. !define LBS_USETABSTOPS 0x0080
  139. !define LBS_NOINTEGRALHEIGHT 0x0100
  140. !define LBS_MULTICOLUMN 0x0200
  141. !define LBS_WANTKEYBOARDINPUT 0x0400
  142. !define LBS_EXTENDEDSEL 0x0800
  143. !define LBS_DISABLENOSCROLL 0x1000
  144. !define LBS_NODATA 0x2000
  145. !define LBS_NOSEL 0x4000
  146. !define LBS_COMBOBOX 0x8000
  147. !define ACS_CENTER 0x0001
  148. !define ACS_TRANSPARENT 0x0002 ; The parent of the animation control must not have the WS_CLIPCHILDREN style
  149. !define ACS_AUTOPLAY 0x0004
  150. !define ACS_TIMER 0x0008 ; < CC6
  151. !define TBS_AUTOTICKS 0x0001
  152. !define TBS_VERT 0x0002
  153. !define TBS_HORZ 0x0000
  154. !define TBS_TOP 0x0004
  155. !define TBS_BOTTOM 0x0000
  156. !define TBS_LEFT 0x0004
  157. !define TBS_RIGHT 0x0000
  158. !define TBS_BOTH 0x0008
  159. !define TBS_NOTICKS 0x0010
  160. !define TBS_ENABLESELRANGE 0x0020
  161. !define TBS_FIXEDLENGTH 0x0040
  162. !define TBS_NOTHUMB 0x0080
  163. !define TBS_TOOLTIPS 0x0100 ; IE3
  164. !define TBS_REVERSED 0x0200 ; IE5
  165. !define TBS_DOWNISLEFT 0x0400 ; _WIN32_IE >= 0x0501
  166. !define TBS_NOTIFYBEFOREMOVE 0x0800 ; IE6?
  167. !define TBS_TRANSPARENTBKGND 0x1000 ; Vista
  168. !define UDS_WRAP 0x0001
  169. !define UDS_SETBUDDYINT 0x0002
  170. !define UDS_ALIGNRIGHT 0x0004
  171. !define UDS_ALIGNLEFT 0x0008
  172. !define UDS_AUTOBUDDY 0x0010
  173. !define UDS_ARROWKEYS 0x0020
  174. !define UDS_HORZ 0x0040
  175. !define UDS_NOTHOUSANDS 0x0080
  176. !define UDS_HOTTRACK 0x0100 ; 98+
  177. !define MCS_DAYSTATE 0x0001
  178. !define MCS_MULTISELECT 0x0002
  179. !define MCS_WEEKNUMBERS 0x0004
  180. !define MCS_NOTODAYCIRCLE 0x0008
  181. !define MCS_NOTODAY 0x0010 ; IE4+?
  182. !define MCS_NOTRAILINGDATES 0x0040 ; Vista+
  183. !define MCS_SHORTDAYSOFWEEK 0x0080 ; Vista+
  184. !define MCS_NOSELCHANGEONNAV 0x0100 ; Vista+
  185. !define DTS_UPDOWN 0x01
  186. !define DTS_SHOWNONE 0x02
  187. !define DTS_SHORTDATEFORMAT 0x00
  188. !define DTS_LONGDATEFORMAT 0x04
  189. !define DTS_SHORTDATECENTURYFORMAT 0x0C
  190. !define DTS_TIMEFORMAT 0x09
  191. !define DTS_APPCANPARSE 0x10
  192. !define DTS_RIGHTALIGN 0x20
  193. !define /ifndef LR_DEFAULTCOLOR 0x0000
  194. !define /ifndef LR_MONOCHROME 0x0001
  195. !define /ifndef LR_COLOR 0x0002
  196. !define /ifndef LR_COPYRETURNORG 0x0004
  197. !define /ifndef LR_COPYDELETEORG 0x0008
  198. !define /ifndef LR_LOADFROMFILE 0x0010
  199. !define /ifndef LR_LOADTRANSPARENT 0x0020
  200. !define /ifndef LR_DEFAULTSIZE 0x0040
  201. !define /ifndef LR_VGACOLOR 0x0080
  202. !define /ifndef LR_LOADMAP3DCOLORS 0x1000
  203. !define /ifndef LR_CREATEDIBSECTION 0x2000
  204. !define /ifndef LR_COPYFROMRESOURCE 0x4000
  205. !define /ifndef LR_SHARED 0x8000
  206. !define /ifndef IMAGE_BITMAP 0
  207. !define /ifndef IMAGE_ICON 1
  208. !define /ifndef IMAGE_CURSOR 2
  209. !define /ifndef IMAGE_ENHMETAFILE 3
  210. !define /ifndef GWL_STYLE -16
  211. !define /ifndef GWL_EXSTYLE -20
  212. #define /ifndef ICC_LISTVIEW_CLASSES 0x0001 ; SysListView32 and SysHeader32
  213. #define /ifndef ICC_TREEVIEW_CLASSES 0x0002 ; SysTabControl32 and tooltips_class32
  214. #define /ifndef ICC_BAR_CLASSES 0x0004 ; ToolbarWindow32, msctls_statusbar32, msctls_trackbar32 and tooltips_class32
  215. #define /ifndef ICC_TAB_CLASSES 0x0008 ; SysTabControl32 and tooltips_class32
  216. #define /ifndef ICC_UPDOWN_CLASS 0x0010 ; msctls_updown32
  217. #define /ifndef ICC_PROGRESS_CLASS 0x0020 ; msctls_progress32
  218. #define /ifndef ICC_HOTKEY_CLASS 0x0040 ; msctls_hotkey32
  219. #define /ifndef ICC_ANIMATE_CLASS 0x0080 ; SysAnimate32
  220. #define /ifndef ICC_WIN95_CLASSES 0x00FF
  221. !define /ifndef ICC_DATE_CLASSES 0x0100 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) SysDateTimePick32, SysMonthCal32 and CC6.10+(Vista+) DropDown
  222. !define /ifndef ICC_USEREX_CLASSES 0x0200 ; CC4.??+ (NT4+/IE3.?+/Win95 OSR2) ComboBoxEx32
  223. !define /ifndef ICC_COOL_CLASSES 0x0400 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) ReBarWindow32
  224. !define /ifndef ICC_INTERNET_CLASSES 0x0800 ; CC4.71+ (IE4+) SysIPAddress32
  225. !define /ifndef ICC_PAGESCROLLER_CLASS 0x1000 ; CC4.71+ (IE4+) SysPager
  226. !define /ifndef ICC_NATIVEFNTCTL_CLASS 0x2000 ; CC4.71+ (IE4+) NativeFontCtl
  227. !define /ifndef ICC_STANDARD_CLASSES 0x4000 ; WinXP+ Button, Static, Edit, ListBox, ComboBox, ComboLBox, ScrollBar and ReaderModeCtl
  228. !define /ifndef ICC_LINK_CLASS 0x8000 ; WinXP+ SysLink
  229. !define DEFAULT_STYLES ${WS_CHILD}|${WS_VISIBLE}|${WS_CLIPSIBLINGS}
  230. !define __NSD_HLine_CLASS STATIC
  231. !define __NSD_HLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDHORZ}|${SS_SUNKEN}
  232. !define __NSD_HLine_EXSTYLE ${WS_EX_TRANSPARENT}
  233. !define __NSD_VLine_CLASS STATIC
  234. !define __NSD_VLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDVERT}|${SS_SUNKEN}
  235. !define __NSD_VLine_EXSTYLE ${WS_EX_TRANSPARENT}
  236. !define __NSD_Label_CLASS STATIC
  237. !define __NSD_Label_STYLE ${DEFAULT_STYLES}|${SS_NOTIFY}
  238. !define __NSD_Label_EXSTYLE ${WS_EX_TRANSPARENT}
  239. !define __NSD_Icon_CLASS STATIC
  240. !define __NSD_Icon_STYLE ${DEFAULT_STYLES}|${SS_ICON}|${SS_NOTIFY}
  241. !define __NSD_Icon_EXSTYLE 0
  242. !define __NSD_Bitmap_CLASS STATIC
  243. !define __NSD_Bitmap_STYLE ${DEFAULT_STYLES}|${SS_BITMAP}|${SS_NOTIFY}
  244. !define __NSD_Bitmap_EXSTYLE 0
  245. !define __NSD_BrowseButton_CLASS BUTTON
  246. !define __NSD_BrowseButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  247. !define __NSD_BrowseButton_EXSTYLE 0
  248. !define __NSD_Link_CLASS LINK
  249. !define __NSD_Link_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_OWNERDRAW}
  250. !define __NSD_Link_EXSTYLE 0
  251. !define __NSD_Button_CLASS BUTTON
  252. !define __NSD_Button_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  253. !define __NSD_Button_EXSTYLE 0
  254. !define __NSD_GroupBox_CLASS BUTTON
  255. !define __NSD_GroupBox_STYLE ${DEFAULT_STYLES}|${BS_GROUPBOX}
  256. !define __NSD_GroupBox_EXSTYLE ${WS_EX_TRANSPARENT}
  257. !define __NSD_CheckBox_CLASS BUTTON
  258. !define __NSD_CheckBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTOCHECKBOX}|${BS_MULTILINE}
  259. !define __NSD_CheckBox_EXSTYLE 0
  260. !define __NSD_RadioButton_CLASS BUTTON
  261. !define __NSD_RadioButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}
  262. !define __NSD_RadioButton_EXSTYLE 0
  263. !define __NSD_FirstRadioButton_CLASS ${__NSD_RadioButton_CLASS}
  264. !define __NSD_FirstRadioButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_GROUP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}
  265. !define __NSD_FirstRadioButton_EXSTYLE ${__NSD_RadioButton_EXSTYLE}
  266. !define __NSD_AdditionalRadioButton_CLASS ${__NSD_RadioButton_CLASS}
  267. !define __NSD_AdditionalRadioButton_STYLE ${DEFAULT_STYLES}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}
  268. !define __NSD_AdditionalRadioButton_EXSTYLE ${__NSD_RadioButton_EXSTYLE}
  269. !define __NSD_Text_CLASS EDIT
  270. !define __NSD_Text_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
  271. !define __NSD_Text_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  272. !define __NSD_MLText_CLASS EDIT
  273. !define __NSD_MLText_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${WS_HSCROLL}|${WS_VSCROLL}
  274. !define __NSD_MLText_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  275. !define __NSD_Password_CLASS EDIT
  276. !define __NSD_Password_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_PASSWORD}
  277. !define __NSD_Password_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  278. !define __NSD_Number_CLASS EDIT
  279. !define __NSD_Number_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_NUMBER}
  280. !define __NSD_Number_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  281. !define __NSD_FileRequest_CLASS EDIT
  282. !define __NSD_FileRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
  283. !define __NSD_FileRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  284. !define __NSD_DirRequest_CLASS EDIT
  285. !define __NSD_DirRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
  286. !define __NSD_DirRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  287. !define __NSD_RichEdit_CLASS_10 "RICHEDIT" ; 1.0 (Riched32.dll) Win95/NT4
  288. !define __NSD_RichEdit_CLASS_20A "RICHEDIT20A" ; 2.0 (Riched20.dll) Win98/NT4 (NSIS makes sure this is registered even on Windows 95)
  289. !define __NSD_RichEdit_CLASS_20W "RICHEDIT20W"
  290. !define __NSD_RichEdit_CLASS_41W "RICHEDIT50W" ; 4.1 (MsftEdit.DLL) WinXP.SP1
  291. !ifdef NSIS_UNICODE
  292. !define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20W}
  293. !else
  294. !define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20A}
  295. !endif
  296. !define __NSD_RichEdit_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${ES_SAVESEL}|${WS_HSCROLL}|${WS_VSCROLL}
  297. !define __NSD_RichEdit_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  298. !define __NSD_ComboBox_CLASS COMBOBOX
  299. !define __NSD_ComboBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWN}
  300. !define __NSD_ComboBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  301. !define __NSD_DropList_CLASS COMBOBOX
  302. !define __NSD_DropList_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWNLIST}
  303. !define __NSD_DropList_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  304. !define __NSD_ListBox_CLASS LISTBOX
  305. !define __NSD_ListBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}
  306. !define __NSD_ListBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  307. !define __NSD_SortedListBox_CLASS LISTBOX
  308. !define __NSD_SortedListBox_STYLE ${__NSD_ListBox_STYLE}|${LBS_SORT}
  309. !define __NSD_SortedListBox_EXSTYLE ${__NSD_ListBox_EXSTYLE}
  310. !define __NSD_ProgressBar_CLASS msctls_progress32
  311. !define __NSD_ProgressBar_STYLE ${DEFAULT_STYLES}
  312. !define __NSD_ProgressBar_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  313. !define __NSD_Animation_CLASS SysAnimate32
  314. !define __NSD_Animation_STYLE ${DEFAULT_STYLES}|${ACS_TRANSPARENT}|${ACS_AUTOPLAY}
  315. !define __NSD_Animation_EXSTYLE 0
  316. !define __NSD_HTrackBar_CLASS msctls_trackbar32
  317. !define __NSD_HTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_HORZ}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}
  318. !define __NSD_HTrackBar_EXSTYLE 0
  319. !define __NSD_VTrackBar_CLASS msctls_trackbar32
  320. !define __NSD_VTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_VERT}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}
  321. !define __NSD_VTrackBar_EXSTYLE 0
  322. !define __NSD_UpDown_CLASS msctls_updown32
  323. !define __NSD_UpDown_STYLE ${DEFAULT_STYLES}|${UDS_SETBUDDYINT}|${UDS_ARROWKEYS}|${UDS_NOTHOUSANDS}|${UDS_ALIGNRIGHT}
  324. !define __NSD_UpDown_EXSTYLE 0
  325. !define __NSD_AutoUpDown_CLASS msctls_updown32
  326. !define __NSD_AutoUpDown_STYLE ${__NSD_UpDown_STYLE}|${UDS_AUTOBUDDY}
  327. !define __NSD_AutoUpDown_EXSTYLE ${__NSD_UpDown_EXSTYLE}
  328. !define __NSD_HotKey_CLASS msctls_hotkey32
  329. !define __NSD_HotKey_STYLE ${DEFAULT_STYLES}
  330. !define __NSD_HotKey_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  331. !define __NSD_Calendar_CLASS SysMonthCal32
  332. !define __NSD_Calendar_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  333. !define __NSD_Calendar_EXSTYLE 0
  334. !define __NSD_DatePicker_CLASS SysDateTimePick32
  335. !define __NSD_DatePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  336. !define __NSD_DatePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  337. !define __NSD_TimePicker_CLASS SysDateTimePick32
  338. !define __NSD_TimePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${DTS_TIMEFORMAT}
  339. !define __NSD_TimePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  340. !define __NSD_IPAddress_CLASS SysIPAddress32 ; IE4+/CC4.71+
  341. !define __NSD_IPAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  342. !define __NSD_IPAddress_EXSTYLE 0
  343. !define __NSD_NetAddress_CLASS msctls_netaddress ; Vista+
  344. !define __NSD_NetAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
  345. !define __NSD_NetAddress_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
  346. !macro __NSD_DefineControl NAME
  347. !define NSD_Create${NAME} "nsDialogs::CreateControl ${__NSD_${Name}_CLASS} ${__NSD_${Name}_STYLE} ${__NSD_${Name}_EXSTYLE}"
  348. !macroend
  349. !insertmacro __NSD_DefineControl HLine
  350. !insertmacro __NSD_DefineControl VLine
  351. !insertmacro __NSD_DefineControl Label
  352. !insertmacro __NSD_DefineControl Icon
  353. !insertmacro __NSD_DefineControl Bitmap
  354. !insertmacro __NSD_DefineControl BrowseButton
  355. !insertmacro __NSD_DefineControl Link
  356. !insertmacro __NSD_DefineControl Button
  357. !insertmacro __NSD_DefineControl GroupBox
  358. !insertmacro __NSD_DefineControl CheckBox
  359. !insertmacro __NSD_DefineControl RadioButton
  360. !insertmacro __NSD_DefineControl FirstRadioButton
  361. !insertmacro __NSD_DefineControl AdditionalRadioButton
  362. !insertmacro __NSD_DefineControl Text
  363. !insertmacro __NSD_DefineControl MLText
  364. !insertmacro __NSD_DefineControl Password
  365. !insertmacro __NSD_DefineControl Number
  366. !insertmacro __NSD_DefineControl FileRequest
  367. !insertmacro __NSD_DefineControl DirRequest
  368. !insertmacro __NSD_DefineControl RichEdit
  369. !insertmacro __NSD_DefineControl ComboBox
  370. !insertmacro __NSD_DefineControl DropList
  371. !insertmacro __NSD_DefineControl ListBox
  372. !insertmacro __NSD_DefineControl SortedListBox
  373. !insertmacro __NSD_DefineControl ProgressBar
  374. !insertmacro __NSD_DefineControl Animation
  375. !insertmacro __NSD_DefineControl HTrackBar
  376. !insertmacro __NSD_DefineControl VTrackBar
  377. !insertmacro __NSD_DefineControl UpDown
  378. !insertmacro __NSD_DefineControl AutoUpDown
  379. !insertmacro __NSD_DefineControl HotKey
  380. !insertmacro __NSD_DefineControl Calendar
  381. !insertmacro __NSD_DefineControl DatePicker
  382. !insertmacro __NSD_DefineControl TimePicker
  383. !insertmacro __NSD_DefineControl IPAddress
  384. !insertmacro __NSD_DefineControl NetAddress
  385. !macro __NSD_OnControlEvent EVENT HWND FUNCTION
  386. Push $0
  387. Push $1
  388. StrCpy $1 "${HWND}"
  389. GetFunctionAddress $0 "${FUNCTION}"
  390. nsDialogs::On${EVENT} $1 $0
  391. Pop $1
  392. Pop $0
  393. !macroend
  394. !macro __NSD_DefineControlCallback EVENT
  395. !define NSD_On${EVENT} `!insertmacro __NSD_OnControlEvent ${EVENT} `
  396. !macroend
  397. !macro __NSD_OnDialogEvent EVENT FUNCTION
  398. Push $0
  399. GetFunctionAddress $0 "${FUNCTION}"
  400. nsDialogs::On${EVENT} $0
  401. Pop $0
  402. !macroend
  403. !macro __NSD_DefineDialogCallback EVENT
  404. !define NSD_On${EVENT} `!insertmacro __NSD_OnDialogEvent ${EVENT} `
  405. !macroend
  406. !insertmacro __NSD_DefineControlCallback Click
  407. !insertmacro __NSD_DefineControlCallback Change
  408. !insertmacro __NSD_DefineControlCallback Notify
  409. !insertmacro __NSD_DefineDialogCallback Back
  410. !define NSD_Return "!insertmacro NSD_Return "
  411. !macro NSD_Return val
  412. StrCpy $_OUTDIR ${val}
  413. SetSilent silent
  414. Return
  415. !macroend
  416. !define __NSD_MkCtlCmd "!insertmacro __NSD_MkCtlCmd "
  417. !macro __NSD_MkCtlCmd msg wp lp hCtl
  418. SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
  419. !macroend
  420. !define __NSD_MkCtlCmd_WP "!insertmacro __NSD_MkCtlCmd_WP "
  421. !macro __NSD_MkCtlCmd_WP msg lp hCtl wp
  422. SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
  423. !macroend
  424. !define __NSD_MkCtlCmd_LP "!insertmacro __NSD_MkCtlCmd_LP "
  425. !macro __NSD_MkCtlCmd_LP msg wp hCtl lp
  426. SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
  427. !macroend
  428. !define __NSD_MkCtlCmd_WPLP "!insertmacro __NSD_MkCtlCmd_WPLP "
  429. !macro __NSD_MkCtlCmd_WPLP msg hCtl wp lp
  430. SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
  431. !macroend
  432. !define __NSD_MkCtlCmd_RV "!insertmacro __NSD_MkCtlCmd_RV "
  433. !macro __NSD_MkCtlCmd_RV msg wp lp hCtl VAR
  434. SendMessage ${hCtl} ${${msg}} ${wp} ${lp} ${VAR}
  435. !macroend
  436. !define NSD_InitCommonControlsEx "!insertmacro __NSD_InitCommonControlsEx "
  437. !macro __NSD_InitCommonControlsEx ICC
  438. !pragma warning push
  439. !pragma warning disable 7070 ; Invalid number
  440. !if ${ICC} <> 0
  441. !define /ReDef /IntFmt NSD_InitCommonControlsEx_TEMP "0x%X" ${ICC}
  442. System::Call 'COMCTL32::InitCommonControlsEx(*l${NSD_InitCommonControlsEx_TEMP}00000008)'
  443. !undef NSD_InitCommonControlsEx_TEMP
  444. !else
  445. System::Int64Op ${ICC} << 32
  446. System::Int64Op 8 |
  447. System::Call 'COMCTL32::InitCommonControlsEx(*ls)' ; INITCOMMONCONTROLSEX as UINT64
  448. !endif
  449. !pragma warning pop
  450. !macroend
  451. !define NSD_InitCommonControl_IPAddress `${NSD_InitCommonControlsEx} ${ICC_INTERNET_CLASSES}`
  452. !define NSD_InitCommonControl_NetAddress `System::Call SHELL32::InitNetworkAddressControl()i`
  453. !define NSD_InitCommonControl_SysLink `${NSD_InitCommonControlsEx} ${ICC_LINK_CLASS}`
  454. !define NSD_CreateTimer `!insertmacro _NSD_CreateTimer `
  455. !macro _NSD_CreateTimer FUNCTION INTERVAL
  456. Push $0
  457. GetFunctionAddress $0 "${FUNCTION}"
  458. nsDialogs::CreateTimer $0 "${INTERVAL}"
  459. Pop $0
  460. !macroend
  461. !define NSD_KillTimer `!insertmacro _NSD_KillTimer `
  462. !macro _NSD_KillTimer FUNCTION
  463. Push $0
  464. GetFunctionAddress $0 "${FUNCTION}"
  465. nsDialogs::KillTimer $0
  466. Pop $0
  467. !macroend
  468. !define NSD_AddStyle "!insertmacro _NSD_GWLAddFlags ${GWL_STYLE} "
  469. !define NSD_AddExStyle "!insertmacro _NSD_GWLAddFlags ${GWL_EXSTYLE} "
  470. !macro _NSD_GWLAddFlags GWL HWND DATA
  471. System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
  472. System::Int64Op "${DATA}" |
  473. System::Call "user32::SetWindowLong(p${HWND},p${GWL},ps)"
  474. !macroend
  475. !define NSD_RemoveStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_STYLE} "
  476. !define NSD_RemoveExStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_EXSTYLE} "
  477. !macro _NSD_GWLRemoveFlags GWL HWND DATA
  478. System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
  479. System::Int64Op "${DATA}" ~ & ; Perform ~ and prepare the stack for &
  480. System::Int64Op ; Perform &
  481. System::Call "user32::SetWindowLong(p${HWND},i${GWL},ps)"
  482. !macroend
  483. !define NSD_GetStyle "!insertmacro _NSD_GWLGetFlags ${GWL_STYLE} "
  484. !define NSD_GetExStyle "!insertmacro _NSD_GWLGetFlags ${GWL_EXSTYLE} "
  485. !macro _NSD_GWLGetFlags GWL HWND RET
  486. System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
  487. Pop ${RET}
  488. !macroend
  489. !macro __NSD_GetStyleBit GWL BIT HWND RET
  490. !insertmacro _NSD_GWLGetFlags ${GWL} ${HWND} ${RET}
  491. IntOp ${RET} ${RET} & ${BIT}
  492. !macroend
  493. !define NSD_SetFocus `!insertmacro __NSD_SetFocus `
  494. !macro __NSD_SetFocus HWND
  495. System::Call "user32::SetFocus(p${HWND})"
  496. !macroend
  497. !define NSD_GetText "!insertmacro __NSD_GetText "
  498. !macro __NSD_GetText CONTROL VAR
  499. System::Call user32::GetWindowText(p${CONTROL},t.s,i${NSIS_MAX_STRLEN})
  500. Pop ${VAR}
  501. !macroend
  502. !define NSD_SetText "!insertmacro __NSD_SetText "
  503. !macro __NSD_SetText CONTROL TEXT
  504. SendMessage ${CONTROL} ${WM_SETTEXT} 0 `STR:${TEXT}`
  505. !macroend
  506. ### Edit ###
  507. !define NSD_Edit_GetTextLimit `${__NSD_MkCtlCmd_RV} EM_GETLIMITTEXT 0 0 `
  508. !define NSD_Edit_SetTextLimit `${__NSD_MkCtlCmd_WP} EM_SETLIMITTEXT 0 `
  509. !define NSD_Edit_SetPasswordChar `${__NSD_MkCtlCmd_WP} EM_SETPASSWORDCHAR 0 `
  510. !define NSD_Edit_GetReadOnly `!insertmacro __NSD_GetStyleBit ${GWL_STYLE} ${ES_READONLY} ` ; Non-zero if read-only
  511. !define NSD_Edit_SetReadOnly `${__NSD_MkCtlCmd_WP} EM_SETREADONLY 0 ` ; Toggles the ES_READONLY style
  512. !define NSD_Edit_GetModify `${__NSD_MkCtlCmd_RV} EM_GETMODIFY 0 0 `
  513. !define NSD_Edit_SetModify `${__NSD_MkCtlCmd_WP} EM_SETMODIFY 0 `
  514. !define NSD_Edit_EmptyUndoBuffer `${__NSD_MkCtlCmd} EM_EMPTYUNDOBUFFER 0 0 `
  515. !define NSD_Edit_CanUndo `${__NSD_MkCtlCmd_RV} EM_CANUNDO 0 0 `
  516. !define NSD_Edit_ScrollCaret `${__NSD_MkCtlCmd} EM_SCROLLCARET 0 0 `
  517. !define NSD_Edit_LineScroll `${__NSD_MkCtlCmd_WPLP} EM_LINESCROLL `
  518. !define NSD_Edit_SetSel `${__NSD_MkCtlCmd_WPLP} EM_SETSEL ` ; WP:Start LP:End
  519. !define NSD_Edit_SetCueBannerText "!insertmacro __NSD_Edit_SetCueBannerText " ; CC6+
  520. !macro __NSD_Edit_SetCueBannerText CONTROL SHOWWHENFOCUSED TEXT
  521. !if ${NSIS_CHAR_SIZE} > 1
  522. SendMessage ${CONTROL} ${EM_SETCUEBANNER} ${SHOWWHENFOCUSED} `STR:${TEXT}`
  523. !else
  524. System::Call 'USER32::SendMessage(p${CONTROL},i${EM_SETCUEBANNER},p${SHOWWHENFOCUSED},ws)' `${TEXT}` ; Must be PWSTR
  525. !endif
  526. !macroend
  527. !define NSD_Edit_GetLineCount `${__NSD_MkCtlCmd_RV} EM_GETLINECOUNT 0 0 `
  528. !define NSD_Edit_GetLine "!insertmacro __NSD_Edit_GetLine "
  529. !macro __NSD_Edit_GetLine CONTROL LINEINDEX OUTPUT
  530. System::Call '*(&i2 ${NSIS_MAX_STRLEN},&t${NSIS_MAX_STRLEN})p.s'
  531. System::Call 'USER32::SendMessage(p${CONTROL},i${EM_GETLINE},p${LINEINDEX},pss)'
  532. System::Call 'KERNEL32::lstrcpyn(t.s,pss,i${NSIS_MAX_STRLEN})'
  533. Pop ${OUTPUT}
  534. System::Free
  535. !macroend
  536. !define NSD_SetTextLimit `${NSD_Edit_SetTextLimit} ` ; Legacy alias
  537. ### RichEdit ###
  538. !define NSD_RichEd_SetTextLimit `${__NSD_MkCtlCmd_LP} EM_EXLIMITTEXT 0 `
  539. !define NSD_RichEd_GetEventMask `${__NSD_MkCtlCmd_RV} EM_GETEVENTMASK 0 0 `
  540. !define NSD_RichEd_SetEventMask `${__NSD_MkCtlCmd_LP} EM_SETEVENTMASK 0 ` ; LP:ENM_*
  541. !define NSD_RichEd_SetSystemBackgroundColor `${__NSD_MkCtlCmd} EM_SETBKGNDCOLOR 1 0 ` ; COLOR_WINDOW
  542. !define NSD_RichEd_SetCustomBackgroundColor `${__NSD_MkCtlCmd_LP} EM_SETBKGNDCOLOR 0 ` ; LP:COLORREF
  543. !define NSD_RichEd_SetHideSelection `${__NSD_MkCtlCmd_WP} EM_HIDESELECTION 0 ` ; WP(BOOL):HideSelWithoutFocus (Toggles ES_NOHIDESEL & TXTBIT_HIDESELECTION)
  544. ### CheckBox ###
  545. !define NSD_GetState `!insertmacro __NSD_GetState `
  546. !macro __NSD_GetState CONTROL VAR
  547. SendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}
  548. !macroend
  549. !define NSD_SetState `!insertmacro __NSD_SetState `
  550. !macro __NSD_SetState CONTROL STATE
  551. SendMessage ${CONTROL} ${BM_SETCHECK} ${STATE} 0
  552. !macroend
  553. !define NSD_Check `!insertmacro __NSD_Check `
  554. !macro __NSD_Check CONTROL
  555. ${NSD_SetState} ${CONTROL} ${BST_CHECKED}
  556. !macroend
  557. !define NSD_Uncheck `!insertmacro __NSD_Uncheck `
  558. !macro __NSD_Uncheck CONTROL
  559. ${NSD_SetState} ${CONTROL} ${BST_UNCHECKED}
  560. !macroend
  561. !define NSD_GetChecked `!insertmacro __NSD_GetState `
  562. !define NSD_SetChecked `!insertmacro __NSD_SetState `
  563. ### ComboBox ###
  564. !define NSD_CB_AddString "!insertmacro _NSD_CB_AddString "
  565. !macro _NSD_CB_AddString CONTROL STRING
  566. SendMessage ${CONTROL} ${CB_ADDSTRING} 0 `STR:${STRING}`
  567. !macroend
  568. !define NSD_CB_InsertString "!insertmacro _NSD_CB_InsertString "
  569. !macro _NSD_CB_InsertString CONTROL INDEX STRING
  570. SendMessage ${CONTROL} ${CB_INSERTSTRING} ${INDEX} `STR:${STRING}`
  571. !macroend
  572. !define NSD_CB_PrependString "!insertmacro _NSD_CB_PrependString "
  573. !macro _NSD_CB_PrependString CONTROL STRING
  574. SendMessage ${CONTROL} ${CB_INSERTSTRING} 0 `STR:${STRING}`
  575. !macroend
  576. !define NSD_CB_AppendString "!insertmacro _NSD_CB_AppendString "
  577. !macro _NSD_CB_AppendString CONTROL STRING
  578. SendMessage ${CONTROL} ${CB_INSERTSTRING} -1 `STR:${STRING}`
  579. !macroend
  580. !define NSD_CB_SelectString "!insertmacro _NSD_CB_SelectString "
  581. !macro _NSD_CB_SelectString CONTROL STRING
  582. SendMessage ${CONTROL} ${CB_SELECTSTRING} -1 `STR:${STRING}`
  583. !macroend
  584. !define NSD_CB_GetSelectionIndex `!insertmacro __NSD_CB_GetSelectionIndex `
  585. !macro __NSD_CB_GetSelectionIndex CONTROL VAR
  586. SendMessage ${CONTROL} ${CB_GETCURSEL} 0 0 ${VAR}
  587. !macroend
  588. !define NSD_CB_SetSelectionIndex `!insertmacro __NSD_CB_SetSelectionIndex `
  589. !macro __NSD_CB_SetSelectionIndex CONTROL INDEX
  590. SendMessage ${CONTROL} ${CB_SETCURSEL} ${INDEX} 0
  591. !macroend
  592. !define NSD_CB_GetItemData `!insertmacro __NSD_CB_GetItemData `
  593. !macro __NSD_CB_GetItemData CONTROL INDEX VAR
  594. SendMessage ${CONTROL} ${CB_GETITEMDATA} ${INDEX} 0 ${VAR}
  595. !macroend
  596. !define NSD_CB_SetItemData `${__NSD_MkCtlCmd_WPLP} CB_SETITEMDATA ` ; Index Data
  597. !define NSD_CB_DelItem `${__NSD_MkCtlCmd_WP} CB_DELETESTRING 0 `
  598. !define NSD_CB_LimitText `${__NSD_MkCtlCmd_WP} CB_LIMITTEXT 0 `
  599. !define /IfNDef NSD_CB_Clear `${__NSD_MkCtlCmd} CB_RESETCONTENT 0 0 `
  600. !define /IfNDef NSD_CB_GetCount `${__NSD_MkCtlCmd_RV} CB_GETCOUNT 0 0 `
  601. !ifndef NSD_CB_DelString
  602. !define NSD_CB_DelString `!insertmacro __NSD_CB_DelString `
  603. !macro __NSD_CB_DelString CONTROL STRING
  604. System::Call 'USER32::SendMessage(p${CONTROL},i${CB_FINDSTRINGEXACT},p-1,ts)p.s' `${STRING}`
  605. System::Call 'USER32::SendMessage(p${CONTROL},i${CB_DELETESTRING},ps,p0)'
  606. !macroend
  607. !endif
  608. ;define /IfNDef NSD_CB_GetSelection
  609. ### ListBox ###
  610. !define NSD_LB_AddString "!insertmacro _NSD_LB_AddString "
  611. !macro _NSD_LB_AddString CONTROL STRING
  612. SendMessage ${CONTROL} ${LB_ADDSTRING} 0 `STR:${STRING}`
  613. !macroend
  614. !define NSD_LB_InsertString "!insertmacro _NSD_LB_InsertString "
  615. !macro _NSD_LB_InsertString CONTROL INDEX STRING
  616. SendMessage ${CONTROL} ${LB_INSERTSTRING} ${INDEX} `STR:${STRING}`
  617. !macroend
  618. !define NSD_LB_PrependString "!insertmacro _NSD_LB_PrependString "
  619. !macro _NSD_LB_PrependString CONTROL STRING
  620. SendMessage ${CONTROL} ${LB_INSERTSTRING} 0 `STR:${STRING}`
  621. !macroend
  622. !define NSD_LB_AppendString "!insertmacro _NSD_LB_AppendString "
  623. !macro _NSD_LB_AppendString CONTROL STRING
  624. SendMessage ${CONTROL} ${LB_INSERTSTRING} -1 `STR:${STRING}`
  625. !macroend
  626. !define NSD_LB_DelString `!insertmacro __NSD_LB_DelString `
  627. !macro __NSD_LB_DelString CONTROL STRING
  628. System::Call 'USER32::SendMessage(p${CONTROL},i${LB_FINDSTRINGEXACT},p-1,ts)p.s' `${STRING}`
  629. System::Call 'USER32::SendMessage(p${CONTROL},i${LB_DELETESTRING},ps,p0)'
  630. !macroend
  631. !define NSD_LB_DelItem "!insertmacro __NSD_LB_DelItem "
  632. !macro __NSD_LB_DelItem CONTROL INDEX
  633. SendMessage ${CONTROL} ${LB_DELETESTRING} ${INDEX} 0
  634. !macroend
  635. !define NSD_LB_Clear `${__NSD_MkCtlCmd} LB_RESETCONTENT 0 0 `
  636. !define NSD_LB_GetCount `!insertmacro __NSD_LB_GetCount `
  637. !macro __NSD_LB_GetCount CONTROL VAR
  638. SendMessage ${CONTROL} ${LB_GETCOUNT} 0 0 ${VAR}
  639. !macroend
  640. !define NSD_LB_SelectString "!insertmacro _NSD_LB_SelectString "
  641. !macro _NSD_LB_SelectString CONTROL STRING
  642. SendMessage ${CONTROL} ${LB_SELECTSTRING} -1 `STR:${STRING}`
  643. !macroend
  644. !define NSD_LB_GetSelection `!insertmacro __NSD_LB_GetSelection `
  645. !macro __NSD_LB_GetSelection CONTROL VAR
  646. SendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}
  647. System::Call 'user32::SendMessage(p ${CONTROL}, i ${LB_GETTEXT}, p ${VAR}, t .s)'
  648. Pop ${VAR}
  649. !macroend
  650. !define NSD_LB_GetSelectionIndex `!insertmacro __NSD_LB_GetSelectionIndex `
  651. !macro __NSD_LB_GetSelectionIndex CONTROL VAR
  652. SendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}
  653. !macroend
  654. !define NSD_LB_SetSelectionIndex `!insertmacro __NSD_LB_SetSelectionIndex `
  655. !macro __NSD_LB_SetSelectionIndex CONTROL INDEX
  656. SendMessage ${CONTROL} ${LB_SETCURSEL} ${INDEX} 0
  657. !macroend
  658. !define NSD_LB_GetSelectionCount `!insertmacro __NSD_LB_GetSelectionCount `
  659. !macro __NSD_LB_GetSelectionCount CONTROL VAR
  660. SendMessage ${CONTROL} ${LB_GETSELCOUNT} 0 0 ${VAR}
  661. !macroend
  662. !define NSD_LB_GetItemText `!insertmacro __NSD_LB_GetItemText `
  663. !macro __NSD_LB_GetItemText CONTROL INDEX VAR
  664. System::Call 'user32::SendMessage(p${CONTROL}, i${LB_GETTEXT}, p${INDEX}, t.s)'
  665. Pop ${VAR}
  666. !macroend
  667. !define NSD_LB_GetItemData `!insertmacro __NSD_LB_GetItemData `
  668. !macro __NSD_LB_GetItemData CONTROL INDEX VAR
  669. SendMessage ${CONTROL} ${LB_GETITEMDATA} ${INDEX} 0 ${VAR}
  670. !macroend
  671. !define NSD_LB_SetItemData `${__NSD_MkCtlCmd_WPLP} LB_SETITEMDATA ` ; Index Data
  672. !define NSD_LB_FindStringPrefix `!insertmacro __NSD_LB_FindStringPrefix `
  673. !macro __NSD_LB_FindStringPrefix CONTROL STRING VAR
  674. SendMessage ${CONTROL} ${LB_FINDSTRING} -1 `STR:${STRING}` ${VAR}
  675. !macroend
  676. !define NSD_LB_FindStringExact `!insertmacro __NSD_LB_FindStringExact `
  677. !macro __NSD_LB_FindStringExact CONTROL STRING VAR
  678. SendMessage ${CONTROL} ${LB_FINDSTRINGEXACT} -1 `STR:${STRING}` ${VAR}
  679. !macroend
  680. ### ProgressBar ###
  681. !define NSD_ProgressBar_SetPos `${__NSD_MkCtlCmd_WP} PBM_SETPOS 0 `
  682. !define NSD_ProgressBar_SetStep `${__NSD_MkCtlCmd_WP} PBM_SETSTEP 0 `
  683. !define NSD_ProgressBar_StepIt `${__NSD_MkCtlCmd} PBM_STEPIT 0 0 `
  684. !define NSD_ProgressBar_AdvanceBy `${__NSD_MkCtlCmd_WP} PBM_DELTAPOS 0 `
  685. !define NSD_ProgressBar_SetPackedRange `${__NSD_MkCtlCmd_LP} PBM_SETRANGE 0 ` ; LP(DWORD):MAKELONG(min,max)
  686. !define NSD_ProgressBar_SetRange32 `${__NSD_MkCtlCmd_WPLP} PBM_SETRANGE32 ` ; [IE3+] WP:min LP:max
  687. !define NSD_ProgressBar_GetPos `${__NSD_MkCtlCmd_RV} PBM_GETPOS 0 0 ` ; [IE3+]
  688. ### Animation ###
  689. !define NSD_Anim_Close `${__NSD_MkCtlCmd} ACM_OPEN 0 0 `
  690. !define NSD_Anim_Play `${__NSD_MkCtlCmd} ACM_PLAY -1 0xFFFF0000 `
  691. !define NSD_Anim_PlayLoops `${__NSD_MkCtlCmd_WP} ACM_PLAY 0xFFFF0000 ` ; WP(UINT16):LoopCount
  692. !define NSD_Anim_Stop `${__NSD_MkCtlCmd} ACM_STOP 0 0 `
  693. !define NSD_Anim_IsPlaying `${__NSD_MkCtlCmd_RV} ACM_ISPLAYING 0 0 `
  694. !define NSD_Anim_OpenFile `!insertmacro __NSD_Anim_OpenFile `
  695. !macro __NSD_Anim_OpenFile CONTROL PATH
  696. SendMessage ${CONTROL} ${ACM_OPEN} 0 "STR:${PATH}"
  697. !macroend
  698. !define NSD_Anim_OpenResource `!insertmacro __NSD_Anim_OpenResource `
  699. !macro __NSD_Anim_OpenResource CONTROL HINSTANCE_CC471 RESID
  700. SendMessage ${CONTROL} ${ACM_OPEN} "${HINSTANCE_CC471}" "${RESID}"
  701. !macroend
  702. ### TrackBar ###
  703. !define NSD_TrackBar_GetPos `${__NSD_MkCtlCmd_RV} TBM_GETPOS 0 0 `
  704. !define NSD_TrackBar_SetPos `${__NSD_MkCtlCmd_LP} TBM_SETPOS 1 `
  705. !define NSD_TrackBar_SetRangeMin `${__NSD_MkCtlCmd_LP} TBM_SETRANGEMIN 1 `
  706. !define NSD_TrackBar_SetRangeMax `${__NSD_MkCtlCmd_LP} TBM_SETRANGEMAX 1 `
  707. !define NSD_TrackBar_GetLineSize `${__NSD_MkCtlCmd_RV} TBM_GETLINESIZE 0 0 `
  708. !define NSD_TrackBar_SetLineSize `${__NSD_MkCtlCmd_LP} TBM_SETLINESIZE 0 `
  709. !define NSD_TrackBar_GetPageSize `${__NSD_MkCtlCmd_RV} TBM_GETPAGESIZE 0 0 `
  710. !define NSD_TrackBar_SetPageSize `${__NSD_MkCtlCmd_LP} TBM_SETPAGESIZE 0 `
  711. !define NSD_TrackBar_ClearTics `${__NSD_MkCtlCmd} TBM_CLEARTICS 0 0 `
  712. !define NSD_TrackBar_GetNumTics `${__NSD_MkCtlCmd_RV} TBM_GETNUMTICS 0 0 `
  713. !define NSD_TrackBar_SetTic `${__NSD_MkCtlCmd_LP} TBM_SETTIC 0 `
  714. !define NSD_TrackBar_SetTicFreq `${__NSD_MkCtlCmd_WP} TBM_SETTICFREQ 0 `
  715. !define NSD_TrackBar_GetThumbLength `${__NSD_MkCtlCmd_RV} TBM_GETTHUMBLENGTH 0 0 `
  716. !define NSD_TrackBar_SetBuddy `${__NSD_MkCtlCmd_WPLP} TBM_SETBUDDY ` ; WP(BOOL):Left/Right LP:HWND
  717. ### UpDown ###
  718. !define NSD_UD_SetBuddy `${__NSD_MkCtlCmd_WP} UDM_SETBUDDY 0 `
  719. !define NSD_UD_GetPos `${__NSD_MkCtlCmd_RV} UDM_GETPOS 0 0 `
  720. !define NSD_UD_SetPos `${__NSD_MkCtlCmd_LP} UDM_SETPOS 0 `
  721. !define NSD_UD_GetPackedRange `${__NSD_MkCtlCmd_RV} UDM_GETRANGE 0 0 `
  722. !define NSD_UD_SetPackedRange `${__NSD_MkCtlCmd_LP} UDM_SETRANGE 0 ` ; LP(DWORD):MAKELONG(min,max)
  723. !define NSD_UD_GetPos32 `${__NSD_MkCtlCmd_RV} UDM_GETPOS32 0 0 `
  724. !define NSD_UD_SetPos32 `${__NSD_MkCtlCmd_LP} UDM_SETPOS32 0 `
  725. !define NSD_UD_SetRange32 `${__NSD_MkCtlCmd_WPLP} UDM_SETRANGE32 ` ; WP(INT32):min LP(INT32):max
  726. !define NSD_UD_GetRange32 `!insertmacro __NSD_UD_GetRange32 `
  727. !macro __NSD_UD_GetRange32 CONTROL OUTLO OUTHI
  728. System::Call 'USER32::SendMessage(p${CONTROL},i${UDM_GETRANGE32},*i.s,*i.s)'
  729. Pop ${OUTLO}
  730. Pop ${OUTHI}
  731. !macroend
  732. !define NSD_UD_SetStaticRange `!insertmacro __NSD_UD_SetStaticRange `
  733. !macro __NSD_UD_SetStaticRange CONTROL MI MA
  734. !define /redef /math MI ${MI} << 16
  735. !define /redef /math MA ${MA} & 0xffff
  736. !define /redef /math MA ${MI} | ${MA}
  737. SendMessage ${CONTROL} ${UDM_SETRANGE} 0 ${MA}
  738. !macroend
  739. ### HotKey ###
  740. !define NSD_HK_GetHotKey `${__NSD_MkCtlCmd_RV} HKM_GETHOTKEY 0 0 ` ; RV(WORD):MAKEWORD(VK,HOTKEYF)
  741. !define NSD_HK_SetHotKey `${__NSD_MkCtlCmd_WP} HKM_SETHOTKEY 0 `
  742. !define NSD_HK_SetRules `${__NSD_MkCtlCmd_WPLP} HKM_SETRULES `
  743. ### IP Address ###
  744. !define NSD_IPAddress_Clear `${__NSD_MkCtlCmd} IPM_CLEARADDRESS 0 0 `
  745. !define NSD_IPAddress_SetPackedIPv4 `${__NSD_MkCtlCmd_LP} IPM_SETADDRESS 0 `
  746. !define NSD_IPAddress_IsBlank `${__NSD_MkCtlCmd_RV} IPM_ISBLANK 0 0 `
  747. !define NSD_IPAddress_GetPackedIPv4 `!insertmacro __NSD_IPAddress_GetPackedIPv4 `
  748. !macro __NSD_IPAddress_GetPackedIPv4 CONTROL VAR
  749. System::Call 'USER32::SendMessage(p${CONTROL},i${IPM_GETADDRESS},p0,*i0s)'
  750. Pop ${VAR}
  751. !macroend
  752. ### Date ###
  753. !define NSD_Date_GetDateFields `!insertmacro __NSD_Date_GetDateFields `
  754. !macro __NSD_Date_GetDateFields CONTROL
  755. Push $0
  756. System::Call 'USER32::SendMessage(p${CONTROL},i${DTM_GETSYSTEMTIME},p0,@r0)'
  757. System::Call '*$0(&i2.s,&i2.s,&i2,&i2.s)'
  758. Exch 3
  759. Pop $0
  760. !macroend
  761. !define NSD_Time_GetTimeFields `!insertmacro __NSD_Time_GetTimeFields `
  762. !macro __NSD_Time_GetTimeFields CONTROL
  763. Push $0
  764. System::Call 'USER32::SendMessage(p${CONTROL},i${DTM_GETSYSTEMTIME},p0,@r0)'
  765. System::Call '*$0(&i2,&i2,&i2,&i2,&i2.s,&i2.s,&i2.s)'
  766. Exch 3
  767. Pop $0
  768. Exch
  769. !macroend
  770. ### Static ###
  771. !macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
  772. !if "${_LIHINSTMODE}" == "exeresource"
  773. LoadAndSetImage /EXERESOURCE /STRINGID "${CONTROL}" ${_IMGTYPE} ${_LIFLAGS} "${IMAGE}" ${HANDLE}
  774. !else #if "${_LIHINSTMODE}" == "file"
  775. LoadAndSetImage /STRINGID "${CONTROL}" ${_IMGTYPE} ${_LIFLAGS} "${IMAGE}" ${HANDLE}
  776. !endif
  777. !macroend
  778. !macro __NSD_SetIconFromExeResource CONTROL IMAGE HANDLE
  779. LoadAndSetImage /EXERESOURCE /STRINGID "${CONTROL}" ${IMAGE_ICON} ${LR_DEFAULTSIZE} "${IMAGE}" ${HANDLE}
  780. !macroend
  781. !macro __NSD_SetIconFromInstaller CONTROL HANDLE
  782. LoadAndSetImage /EXERESOURCE "${CONTROL}" ${IMAGE_ICON} ${LR_DEFAULTSIZE} 103 ${HANDLE}
  783. !macroend
  784. !define NSD_SetImage `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_BITMAP} 0 "${LR_LOADFROMFILE}" `
  785. !define NSD_SetBitmap `${NSD_SetImage} `
  786. !define NSD_SetIcon `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_ICON} 0 "${LR_LOADFROMFILE}|${LR_DEFAULTSIZE}" `
  787. !define NSD_SetIconFromExeResource `!insertmacro __NSD_SetIconFromExeResource `
  788. !define NSD_SetIconFromInstaller `!insertmacro __NSD_SetIconFromInstaller `
  789. !define NSD_SetStretchedImage `!insertmacro __NSD_SetStretchedImage `
  790. !define NSD_SetStretchedBitmap `!insertmacro __NSD_SetStretchedImage `
  791. !macro __NSD_SetStretchedImage CONTROL IMAGE HANDLE
  792. LoadAndSetImage /STRINGID /RESIZETOFIT "${CONTROL}" ${IMAGE_BITMAP} ${LR_LOADFROMFILE} "${IMAGE}" ${HANDLE}
  793. !macroend
  794. !define NSD_FreeImage `!insertmacro __NSD_FreeImage `
  795. !define NSD_FreeBitmap `${NSD_FreeImage} `
  796. !macro __NSD_FreeImage IMAGE
  797. ${If} ${IMAGE} P<> 0
  798. System::Call gdi32::DeleteObject(ps) ${IMAGE}
  799. ${EndIf}
  800. !macroend
  801. !define NSD_FreeIcon `!insertmacro __NSD_FreeIcon `
  802. !macro __NSD_FreeIcon IMAGE
  803. System::Call user32::DestroyIcon(ps) ${IMAGE}
  804. !macroend
  805. !define NSD_ClearImage `!insertmacro __NSD_ClearImage ${IMAGE_BITMAP} `
  806. !define NSD_ClearBitmap `${NSD_ClearImage} `
  807. !define NSD_ClearIcon `!insertmacro __NSD_ClearImage ${IMAGE_ICON } `
  808. !macro __NSD_ClearImage _IMGTYPE CONTROL
  809. SendMessage ${CONTROL} ${STM_SETIMAGE} ${_IMGTYPE} 0
  810. !macroend
  811. ### INI ###
  812. !define /IfNDef NSD_Debug `System::Call kernel32::OutputDebugString(ts)`
  813. !macro __NSD_ControlCase TYPE
  814. ${Case} ${TYPE}
  815. ${NSD_Create${TYPE}} $R3u $R4u $R5u $R6u $R7
  816. Pop $R9
  817. ${Break}
  818. !macroend
  819. !macro __NSD_ControlCaseEx TYPE
  820. ${Case} ${TYPE}
  821. Call ${TYPE}
  822. ${Break}
  823. !macroend
  824. !macro NSD_FUNCTION_INIFILE
  825. !insertmacro NSD_INIFILE ""
  826. !macroend
  827. !macro NSD_UNFUNCTION_INIFILE
  828. !insertmacro NSD_INIFILE un.
  829. !macroend
  830. !macro NSD_INIFILE UNINSTALLER_FUNCPREFIX
  831. ;Functions to create dialogs based on old InstallOptions INI files
  832. Function ${UNINSTALLER_FUNCPREFIX}CreateDialogFromINI
  833. # $0 = ini
  834. ReadINIStr $R0 $0 Settings RECT
  835. ${If} $R0 == ""
  836. StrCpy $R0 1018
  837. ${EndIf}
  838. nsDialogs::Create $R0
  839. Pop $R9
  840. ReadINIStr $R0 $0 Settings RTL
  841. nsDialogs::SetRTL $R0
  842. ReadINIStr $R0 $0 Settings NumFields
  843. ${NSD_Debug} "NumFields = $R0"
  844. ${For} $R1 1 $R0
  845. ${NSD_Debug} "Creating field $R1"
  846. ReadINIStr $R2 $0 "Field $R1" Type
  847. ${NSD_Debug} " Type = $R2"
  848. ReadINIStr $R3 $0 "Field $R1" Left
  849. ${NSD_Debug} " Left = $R3"
  850. ReadINIStr $R4 $0 "Field $R1" Top
  851. ${NSD_Debug} " Top = $R4"
  852. ReadINIStr $R5 $0 "Field $R1" Right
  853. ${NSD_Debug} " Right = $R5"
  854. ReadINIStr $R6 $0 "Field $R1" Bottom
  855. ${NSD_Debug} " Bottom = $R6"
  856. IntOp $R5 $R5 - $R3
  857. ${NSD_Debug} " Width = $R5"
  858. IntOp $R6 $R6 - $R4
  859. ${NSD_Debug} " Height = $R6"
  860. ReadINIStr $R7 $0 "Field $R1" Text
  861. ${NSD_Debug} " Text = $R7"
  862. ${Switch} $R2
  863. !insertmacro __NSD_ControlCase HLine
  864. !insertmacro __NSD_ControlCase VLine
  865. !insertmacro __NSD_ControlCase Label
  866. !insertmacro __NSD_ControlCase Icon
  867. !insertmacro __NSD_ControlCase Bitmap
  868. !insertmacro __NSD_ControlCaseEx Link
  869. !insertmacro __NSD_ControlCase Button
  870. !insertmacro __NSD_ControlCase GroupBox
  871. !insertmacro __NSD_ControlCase CheckBox
  872. !insertmacro __NSD_ControlCase RadioButton
  873. !insertmacro __NSD_ControlCase Text
  874. !insertmacro __NSD_ControlCase Password
  875. !insertmacro __NSD_ControlCaseEx FileRequest
  876. !insertmacro __NSD_ControlCaseEx DirRequest
  877. !insertmacro __NSD_ControlCase ComboBox
  878. !insertmacro __NSD_ControlCase DropList
  879. !insertmacro __NSD_ControlCase ListBox
  880. ${EndSwitch}
  881. WriteINIStr $0 "Field $R1" HWND $R9
  882. ${Next}
  883. nsDialogs::Show
  884. FunctionEnd
  885. Function ${UNINSTALLER_FUNCPREFIX}UpdateINIState
  886. ${NSD_Debug} "Updating INI state"
  887. ReadINIStr $R0 $0 Settings NumFields
  888. ${NSD_Debug} "NumField = $R0"
  889. ${For} $R1 1 $R0
  890. ReadINIStr $R2 $0 "Field $R1" HWND
  891. ReadINIStr $R3 $0 "Field $R1" "Type"
  892. ${Switch} $R3
  893. ${Case} "CheckBox"
  894. ${Case} "RadioButton"
  895. ${NSD_Debug} " HWND = $R2"
  896. ${NSD_GetState} $R2 $R2
  897. ${NSD_Debug} " Window selection = $R2"
  898. ${Break}
  899. ${CaseElse}
  900. ${NSD_Debug} " HWND = $R2"
  901. ${NSD_GetText} $R2 $R2
  902. ${NSD_Debug} " Window text = $R2"
  903. ${Break}
  904. ${EndSwitch}
  905. WriteINIStr $0 "Field $R1" STATE $R2
  906. ${Next}
  907. FunctionEnd
  908. Function ${UNINSTALLER_FUNCPREFIX}FileRequest
  909. IntOp $R5 $R5 - 15
  910. IntOp $R8 $R3 + $R5
  911. ${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...
  912. Pop $R8
  913. nsDialogs::SetUserData $R8 $R1 # remember field id
  914. WriteINIStr $0 "Field $R1" HWND2 $R8
  915. ${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton
  916. ReadINIStr $R9 $0 "Field $R1" State
  917. ${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9
  918. Pop $R9
  919. FunctionEnd
  920. Function ${UNINSTALLER_FUNCPREFIX}DirRequest
  921. IntOp $R5 $R5 - 15
  922. IntOp $R8 $R3 + $R5
  923. ${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...
  924. Pop $R8
  925. nsDialogs::SetUserData $R8 $R1 # remember field id
  926. WriteINIStr $0 "Field $R1" HWND2 $R8
  927. ${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton
  928. ReadINIStr $R9 $0 "Field $R1" State
  929. ${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9
  930. Pop $R9
  931. FunctionEnd
  932. Function ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton
  933. Pop $R0
  934. nsDialogs::GetUserData $R0
  935. Pop $R1
  936. ReadINIStr $R2 $0 "Field $R1" HWND
  937. ReadINIStr $R4 $0 "Field $R1" Filter
  938. ${NSD_GetText} $R2 $R3
  939. nsDialogs::SelectFileDialog save $R3 $R4
  940. Pop $R3
  941. ${If} $R3 != ""
  942. SendMessage $R2 ${WM_SETTEXT} 0 STR:$R3
  943. ${EndIf}
  944. FunctionEnd
  945. Function ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton
  946. Pop $R0
  947. nsDialogs::GetUserData $R0
  948. Pop $R1
  949. ReadINIStr $R2 $0 "Field $R1" HWND
  950. ReadINIStr $R3 $0 "Field $R1" Text
  951. ${NSD_GetText} $R2 $R4
  952. nsDialogs::SelectFolderDialog $R3 $R4
  953. Pop $R3
  954. ${If} $R3 != error
  955. SendMessage $R2 ${WM_SETTEXT} 0 STR:$R3
  956. ${EndIf}
  957. FunctionEnd
  958. Function ${UNINSTALLER_FUNCPREFIX}Link
  959. ${NSD_CreateLink} $R3u $R4u $R5u $R6u $R7
  960. Pop $R9
  961. nsDialogs::SetUserData $R9 $R1 # remember field id
  962. ${NSD_OnClick} $R9 ${UNINSTALLER_FUNCPREFIX}OnLink
  963. FunctionEnd
  964. Function ${UNINSTALLER_FUNCPREFIX}OnLink
  965. Pop $R0
  966. nsDialogs::GetUserData $R0
  967. Pop $R1
  968. ReadINIStr $R1 $0 "Field $R1" STATE
  969. ExecShell "" $R1
  970. FunctionEnd
  971. !macroend
  972. !verbose pop
  973. !endif