Debian Codegraph @

Contrib/nsDialogs/nsDialogs.nsh

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