File: Readme.html

package info (click to toggle)
nsis 3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,496 kB
  • sloc: cpp: 39,326; ansic: 27,284; python: 1,386; asm: 712; xml: 409; pascal: 231; makefile: 225; javascript: 67
file content (880 lines) | stat: -rwxr-xr-x 39,832 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>nsDialogs</title>
<style type="text/css">
:root { color-scheme: light dark; }
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }
html { font-size: 0.85em; }
body { font-size: 1em; font-size: 1rem; }
blockquote { margin: 0.75em; } .faq blockquote { margin-left: 0; }
pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }
span.inlcod i { padding: 0px 0.2em; color: #444444; font-size:95%; }
code { margin-left: 1.2em; padding: 0.5em; background-color: #f0f0f0; display:inline-block; }
blockquote pre { background-color: #fafafa; padding:0.5em; overflow: auto; }
blockquote pre > b { color: #bb0000; }
abbr { font-variant: none; cursor: help; }

@media (prefers-color-scheme: dark) {
html, body { color: #eeeeee; background-color: #161616; }
span.inlcod i { color: #bbbbbb; }
code { background-color: #202020; }
blockquote pre { background-color: #222222; }
blockquote pre > b { color: #eebbbb; }
}
</style>
</head>
<body>

<h1>NSIS nsDialogs Plug-in</h1>
<p><i>Next generation of user interface design</i></p>

<h2>Table of Contents</h2>

<ul>
<li><a href="#intro">Introduction</a></li>
<li>
<a href="#step">Step-by-Step Tutorial</a>
<ul>
<li><a href="#step-page">Custom Page</a></li>
<li><a href="#step-add">Adding Controls</a></li>
<li><a href="#step-state">Control State</a></li>
<li><a href="#step-notify">Real-time Notification</a></li>
<li><a href="#step-memory">Memory</a></li>
</ul>
</li>
<li>
<a href="#ref">Function Reference</a>
<ul>
<li><a href="#ref-create">Create</a></li>
<li><a href="#ref-createcontrol">CreateControl</a></li>
<li><a href="#ref-show">Show</a></li>
<li><a href="#ref-selectfiledialog">SelectFileDialog</a></li>
<li><a href="#ref-selectfolderdialog">SelectFolderDialog</a></li>
<li><a href="#ref-setrtl">SetRTL</a></li>
<li><a href="#ref-getuserdata">GetUserData</a></li>
<li><a href="#ref-setuserdata">SetUserData</a></li>
<li><a href="#ref-onback">OnBack</a></li>
<li><a href="#ref-onchange">OnChange</a></li>
<li><a href="#ref-onclick">OnClick</a></li>
<li><a href="#ref-onnotify">OnNotify</a></li>
<li><a href="#ref-createtimer">CreateTimer</a></li>
<li><a href="#ref-killtimer">KillTimer</a></li>
</ul>
</li>
<li>
<a href="#mref">Macro Reference</a>
<ul>
<li><a href="#mref-create">NSD_Create*</a></li>
<li><a href="#mref-onback">NSD_OnBack</a>, <a href="#mref-onchange">NSD_OnChange</a>, <a href="#mref-onclick">NSD_OnClick</a>, <a href="#mref-onnotify">NSD_OnNotify</a></li>
<li><a href="#mref-setfocus">NSD_SetFocus</a></li>
<li><a href="#mref-createtimer">NSD_CreateTimer</a>, <a href="#mref-killtimer">NSD_KillTimer</a></li>
<li><a href="#mref-addstyle">NSD_AddStyle</a>, <a href="#mref-addexstyle">NSD_AddExStyle</a>, <a href="#mref-removestyle">NSD_RemoveStyle</a>, <a href="#mref-removeexstyle">NSD_RemoveExStyle</a></li>
<li><a href="#mref-gettext">NSD_GetText</a>, <a href="#mref-settext">NSD_SetText</a></li>
<li>Text, Password &amp; Number: 
<a href="#mref-settextlimit">NSD_Edit_SetTextLimit</a>, 
<a href="#mref-edsetro">NSD_Edit_SetReadOnly</a>,
<a href="#mref-edsetcuebanner">NSD_Edit_SetCueBannerText</a>
</li>
<li>RichEdit: 
<a href="#mref-richsettextlimit">NSD_RichEd_SetTextLimit</a>, 
<a href="#mref-richseteventmask">NSD_RichEd_SetEventMask</a>, 
<a href="#mref-richsetbkclr">NSD_RichEd_SetCustomBackgroundColor</a>
</li>
<li>CheckBox &amp; RadioButton: 
<a href="#mref-getstate">NSD_GetState</a>, 
<a href="#mref-setstate">NSD_SetState</a>, 
<a href="#mref-check">NSD_Check</a>, 
<a href="#mref-uncheck">NSD_Uncheck</a>
</li>
<li>ComboBox &amp; DropList: 
<a href="#mref-cbaddstring">NSD_CB_AddString</a>, 
<a href="#mref-cbinsstring">NSD_CB_PrependString, NSD_CB_AppendString, NSD_CB_InsertString</a>, 
NSD_CB_DelString, 
NSD_CB_DelItem, 
NSD_CB_Clear, 
<a href="#mref-cbgetcount">NSD_CB_GetCount</a>, 
<a href="#mref-cbselectstring">NSD_CB_SelectString</a>, NSD_CB_SelectStringExact, NSD_CB_FindStringExact
</li>
<li>ListBox: 
<a href="#mref-lbaddstring">NSD_LB_AddString</a>, 
<a href="#mref-lbinsstring">NSD_LB_PrependString, NSD_LB_AppendString, NSD_LB_InsertString</a>, 
<a href="#mref-lbdelstring">NSD_LB_DelString</a>, 
<a href="#mref-lbdelitem">NSD_LB_DelItem</a>, 
<a href="#mref-lbclear">NSD_LB_Clear</a>, 
<a href="#mref-lbgetcount">NSD_LB_GetCount</a>, 
<a href="#mref-lbselectstring">NSD_LB_SelectString</a>, 
<a href="#mref-lbgetselection">NSD_LB_GetSelection</a>
</li>
<li>Animation: 
<a href="#mref-animopenfile">NSD_Anim_OpenFile</a>, 
<a href="#mref-animplay">NSD_Anim_Play</a>, 
<a href="#mref-animstop">NSD_Anim_Stop</a>
</li>
<li>HTrackBar &amp; VTrackBar: 
<a href="#mref-trackgetpos">NSD_TrackBar_GetPos</a>, 
<a href="#mref-tracksetpos">NSD_TrackBar_SetPos</a>, 
<a href="#mref-tracksetrmin">NSD_TrackBar_SetRangeMin</a>, 
<a href="#mref-tracksetrmax">NSD_TrackBar_SetRangeMax</a>, 
<a href="#mref-tracksetticfr">NSD_TrackBar_SetTicFreq</a>
</li>
<li>UpDown: 
<a href="#mref-udsetbuddy">NSD_UD_SetBuddy</a>, 
<a href="#mref-udgetpos">NSD_UD_GetPos</a>, 
<a href="#mref-udsetpos">NSD_UD_SetPos</a>,
<a href="#mref-udsetpackedrange">NSD_UD_SetPackedRange</a>
</li>
<li>HotKey: 
<a href="#mref-hkgethk">NSD_HK_GetHotKey</a>, <a href="#mref-hksethk">NSD_HK_SetHotKey</a>
</li>
<li>DatePicker: 
<a href="#mref-dategetdatefields">NSD_Date_GetDateFields</a>
</li>
<li>Bitmap: 
<a href="#mref-setbitmap">NSD_SetBitmap</a>, 
<a href="#mref-setsbitmap">NSD_SetStretchedBitmap</a>, 
<a href="#mref-clearbitmap">NSD_ClearBitmap</a>, 
<a href="#mref-freebitmap">NSD_FreeBitmap</a>
</li>
<li>Icon: 
<a href="#mref-seticon">NSD_SetIcon</a>, 
<a href="#mref-seticonfrominstaller">NSD_SetIconFromInstaller</a>, 
<a href="#mref-clearicon">NSD_ClearIcon</a>, 
<a href="#mref-freeicon">NSD_FreeIcon</a>
</li>
</ul>
</li>
<li><a href="#faq">FAQ</a></li>
</ul>

<h2><a name="intro"></a>Introduction</h2>

<p>nsDialogs allows creation of custom pages in the installer. On top of the built-in pages, nsDialogs can create pages with any type of controls in any order and arrangement. It can create everything from a simple page with one label to form which reacts to user's actions. <a href="../Modern%20UI%202/Readme.html">Modern UI 2</a>, for example, uses nsDialogs to create the welcome and finish pages.</p>

<p>nsDialogs is a NSIS plug-in, introduced in version 2.29 as a replacement for <a href="../InstallOptions/Readme.html">InstallOptions</a>. nsDialogs doesn't use INI files, so it's way faster than InstallOptions. Integration with the script is tighter and more natural - creating controls is done using plug-in functions and notification is done by directly calling a function in the script. Unlike InstallOptions, there isn't a predefined set of available control type and by providing a lower level access to Windows API, every type of control can be created and pages can be more customizable.</p>

<p>The same thing that makes nsDialogs more flexible can also make it more complicated for users with no knowledge of Win32 API. This is solved by creating a library of predefined functions, defined in script, that allow creation and handling of controls. This way, novices get easy access to the flexibility, while advanced users still get access to the <a href="http://msdn.microsoft.com/en-us/library/bb773169">core functionality</a> by modifying the library or simply avoid using it.</p>

<h2><a name="step"></a>Step-by-Step Tutorial</h2>

<h3><a name="step-page"></a>Custom Page</h3>

<p>Before you can start adding controls you need to create a nsDialogs custom page. nsDialogs pages can only be created in a custom page's creator function, not in sections nor regular functions. Lets create a basic script with a empty nsDialogs page as our skeleton:</p>

<blockquote><pre><b>!include LogicLib.nsh</b>

Name nsDialogs
OutFile nsDialogs.exe
XPStyle on

<b>
Var Dialog

Page custom nsDialogsPage</b>
Page instfiles

<b>Function nsDialogsPage
	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}

	nsDialogs::Show
FunctionEnd</b>

Section
SectionEnd</pre></blockquote>
<span class="inlcod">
<p>The first call must always be to <i>nsDialogs::Create</i>. It will create a new dialog in the page and return its <i>HWND</i> on the stack. The result must be popped from the stack to prevent stack corruption. If the result is <i>error</i>, the dialog couldn't be created and the page must be aborted!</p>
<p><i>nsDialogs::Create</i> accepts one parameter. It has a very specific function, but to keep things simple for this tutorial, it must always be 1018.</p>
<p><i>HWND</i> is a number that uniquely identifies the dialog and can be used with <i>SendMessage</i>, <i>SetCtlColors</i> and Win32 API functions.</p>
<p>The dialog is not fully constructed at this point and you can make modifications to it before it is displayed. To finalize and display the dialog you must call <i>nsDialogs::Show</i>. This function will not return until the user clicks Next, Back or Cancel.</p>
</span>


<h3><a name="step-add"></a>Adding Controls</h3>

<span class="inlcod">
<p>Compiling the last script and running it results in an empty page which is not very useful. So now we'll add some controls to it to. To do so, we'll use <a href="#mref-create">${NSD_Create*}</a> macros from nsDialogs.nsh. Each of those macros takes 5 parameters - x, y, width, height and text. Each macro also returns one value on the stack, which is the new control's <i>HWND</i>. Like the dialogs <i>HWND</i>, it must be popped from the stack and saved.</p>

<p>Each of the measurements that the macros take can use one of three unit types - pixels, dialog units or percentage of the dialog's size. It can also be negative to indicate it should be measured from the end. To use dialog units, the measurement must be suffixed with the letter <i>u</i>. To use percentage, the measurement must be suffixed with the percentage sign - <i>%</i>. Any other suffix, or no suffix, means pixels.</p>

<p>Dialog units allow creation of dialogs that scale well when different fonts or <abbr title="Dots per Inch">DPI</abbr> is used. Its size in pixels is determined at runtime based on the font and the DPI. For example, standard pages in the classic NSIS user interface are 266 dialog units wide and 130 dialog units high. Pages in Modern UI are 300 dialogs units wide and 140 dialog units high. In different resolutions, using different fonts or DPI settings, the dialogs will always have the same size in dialog units, but different size in pixels.</p>
</span>
<blockquote><pre><b>!include nsDialogs.nsh</b>
!include LogicLib.nsh

Name nsDialogs
OutFile nsDialogs.exe
XPStyle on

Var Dialog
<b>Var Label
Var Text</b>

Page custom nsDialogsPage
Page instfiles

Function nsDialogsPage

	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}
<b>
	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
	Pop $Label

	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
	Pop $Text
</b>
	nsDialogs::Show

FunctionEnd

Section
SectionEnd</pre></blockquote>

<p>Available control types that can be created with <a href="#mref-create">${NSD_Create*}</a> are: 
HLine, 
VLine, 
Label, 
Icon, 
Bitmap, 
BrowseButton, 
Link, 
Button, 
GroupBox, 
CheckBox, 
RadioButton (FirstRadioButton and AdditionalRadioButton), 
Text, 
MLText, 
Password, 
Number, 
FileRequest, 
DirRequest, 
RichEdit, 
ComboBox, 
DropList, 
ListBox, 
SortedListBox, 
ProgressBar, 
Animation, 
HTrackBar, 
VTrackBar, 
UpDown, 
HotKey, 
DatePicker, 
IPAddress, 
NetAddress.
</p>

<h3><a name="step-state"></a>Control State</h3>

<span class="inlcod">
<p>Now that we have some controls that the user can interact with, it's time to see what the user actually does with them. For that, we'll first add a "leave callback function" to our page. In that function, we'll query the state of the text control we've created and display it to the user. To do so, we'll use the <a href="#mref-gettext">${NSD_GetText}</a> macro. Use the <a href="#mref-getstate">${NSD_GetState}</a> macro for RadioButton and CheckBox controls.</p>

<p>Note that not all controls support <a href="#mref-gettext">${NSD_GetText}</a> and some require special handling with specific messages defined in WinMessages.nsh. For example, the ListBox control requires usage of <i>LB_GETCURSEL</i> and <i>LB_GETTEXT</i>. With time, the library of macros in nsDialogs.nsh will fill with more and more macros that'll handle more cases like this.</p>
</span>
<blockquote><pre>!include nsDialogs.nsh
!include LogicLib.nsh

Name nsDialogs
OutFile nsDialogs.exe
XPStyle on

Var Dialog
Var Label
Var Text

Page custom nsDialogsPage <b>nsDialogsPageLeave</b>
Page instfiles

Function nsDialogsPage

	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}

	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
	Pop $Label

	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
	Pop $Text

	nsDialogs::Show

FunctionEnd

<b>Function nsDialogsPageLeave

	${NSD_GetText} $Text $0
	MessageBox MB_OK "You typed:$\n$\n$0"

FunctionEnd</b>

Section
SectionEnd</pre></blockquote>

<h3><a name="step-notify"></a>Real-time Notification</h3>

<span class="inlcod">
<p>One of the more exciting new features of nsDialogs is callback function notification of changes to the dialog. nsDialogs can call a function defined in a script in response to a user action such as changing of a text field or click of a button. To make nsDialogs notify us of events, we'll use <a href="#mref-onclick">${NSD_OnClick}</a> and <a href="#mref-onchange">${NSD_OnChange}</a>. Not every control supports both of the events. For example, there is nothing to notify about label changes, only clicks.</p>

<p>When the callback function is called, the control's <i>HWND</i> will be waiting on the stack and must be popped to prevent stack corruption. In this simple example, this is not so useful. But in case of a bigger script where several controls are associated with the same callback function, the <i>HWND</i> can shed some light on which control originated the event.</p>

<p>The new example will respond to the user typing "hello" in the text box.</p>
</span>
<blockquote><pre>!include nsDialogs.nsh
!include LogicLib.nsh

Name nsDialogs
OutFile nsDialogs.exe
XPStyle on

Var Dialog
Var Label
Var Text

Page custom nsDialogsPage nsDialogsPageLeave
Page instfiles

Function nsDialogsPage

	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}

	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
	Pop $Label

	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
	Pop $Text
	<b>${NSD_OnChange} $Text nsDialogsPageTextChange</b>

	nsDialogs::Show

FunctionEnd

Function nsDialogsPageLeave

	${NSD_GetText} $Text $0
	MessageBox MB_OK "You typed:$\n$\n$0"

FunctionEnd

<b>Function nsDialogsPageTextChange

	Pop $1 # $1 == $ Text

	${NSD_GetText} $Text $0

	${If} $0 == "hello"

		MessageBox MB_OK "right back at ya!"

	${EndIf}

FunctionEnd</b>

Section
SectionEnd</pre></blockquote>

<h3><a name="step-memory"></a>Memory</h3>

<p>So far we have a page that has some basic input controls. But what happens when the user goes to the next page and comes back? With the current code, the user's input will not be remembered. To remember, we'll use the already present leave callback function to store the user's choice in variables and pass these values when creating the controls the next time. For a better example, we'll also add a checkbox to the page and use <a href="#mref-getstate">${NSD_GetState}</a> and <a href="#mref-setstate">${NSD_SetState}</a> to get and set its state.</p>

<p>For clarity, we'll remove some of the notifications from the previous step.</p>

<blockquote><pre>!include nsDialogs.nsh
!include LogicLib.nsh

Name nsDialogs
OutFile nsDialogs.exe
XPStyle on

Var Dialog
Var Label
Var Text
<b>Var Text_State
Var Checkbox
Var Checkbox_State</b>

Page custom nsDialogsPage nsDialogsPageLeave
<b>Page license</b>
Page instfiles

<b>Function .onInit

	StrCpy $Text_State "Type something here..."

FunctionEnd</b>

Function nsDialogsPage

	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}

	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
	Pop $Label

	${NSD_CreateText} 0 13u 100% <b>12u $Text_State</b>
	Pop $Text

	<b>${NSD_CreateCheckbox} 0 30u 100% 10u "&amp;Something"
	Pop $Checkbox

	${If} $Checkbox_State == ${BST_CHECKED}
		${NSD_Check} $Checkbox
	${EndIf}

	# alternative for the above ${If}:
	#${NSD_SetState} $Checkbox_State</b>

	nsDialogs::Show

FunctionEnd

Function nsDialogsPageLeave

	${NSD_GetText} $Text <b>$Text_State</b>
	<b>${NSD_GetState} $Checkbox $Checkbox_State</b>

FunctionEnd

Section
SectionEnd</pre></blockquote>

<h2><a name="ref"></a>Function Reference</h2>

<h3><a name="ref-create"></a>Create</h3>
<p><code>nsDialogs::Create <i>rect</i></code></p>
<p>Creates a new dialog. <i>rect</i> specific the identifier of the control whose location will be mimiced. This should usually be 1018, which is control mimiced for creation of built-in pages. The Modern UI also has control 1044 for the welcome and the finish page.</p>
<p>Returns the new dialog's HWND on the stack or <i>error</i>.</p>

<h3><a name="ref-createcontrol"></a>CreateControl</h3>
<p><code>nsDialogs::CreateControl <i>class</i> <i>style</i> <i>extended_style</i> <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>
<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>
<p>Returns the new control's HWND on the stack or <i>error</i>.</p>

<h3><a name="ref-show"></a>Show</h3>
<p><code>nsDialogs::Show</code></p>
<p>Displays the page. Call this once finished with nsDialogs::Create, nsDialogs::CreateControl and the rest.</p>
<p>Returns nothing.</p>

<h3><a name="ref-selectfiledialog"></a>SelectFileDialog</h3>
<p><code>nsDialogs::SelectFileDialog <i>mode</i> <i>initial_selection</i> <i>filter</i></code></p>
<p>Displays a file selection dialog to the user. If <i>mode</i> is set to <i>save</i>, displays a file save dialog. If <i>mode</i> is set to <i>open</i>, displays a file open dialog.
<p><i>initial_selection</i> can be used to provide the user with a default file to look for and/or a default folder to look in. If <i>initial_selection</i> is empty no default filename will be provided for the user and the dialog will start in the current working directory. If <i>initial_selection</i> specifies just a filename, for example "test.exe", the dialog will be set up to look for a file called test.exe in the current working directory. If <i>initial_selection</i> specifies just a directory, for example "C:\Program Files", the dialog starts in the provided directory with no file name provided. If <i>initial_selection</i> specifies a directory and a filename, for example "C:\Windows\System32\calc.exe", the dialog will be set up to look for a file called calc.exe in the directory C:\Windows\System32.</p>
<p><i>filter</i> is a list of available file filter pairs separated by pipes. A filter pair consists of a display string and a <a href="https://blogs.msdn.microsoft.com/jeremykuhne/2017/06/04/wildcards-in-windows/">DOS-style wildcard pattern</a>. If an empty string is passed, the default is used (<i>"All Files|*.*"</i>).</p>
<p>Returns the selected file on the stack or an empty string if the user canceled the operation.</p>
<blockquote><pre>
nsDialogs::SelectFileDialog open "$DOCUMENTS\Config.ini" ".ini files|*.ini|All Files|*.*"
Pop $0
StrCmp $0 "" ...
</pre></blockquote>

<h3><a name="ref-selectfolderdialog"></a>SelectFolderDialog</h3>
<p><code>nsDialogs::SelectFolderDialog <i>title</i> <i>initial_selection</i></code></p>
<p>Displays a directory selection dialog to the user.</p>
<p>Returns the selected directory on the stack or "error" in case the user canceled the operation or an error occurred.</p>

<h3><a name="ref-setrtl"></a>SetRTL</h3>
<p><code>nsDialogs::SetRTL <i>rtl_setting</i></code></p>
<p>Sets right-to-left mode on or off. If <i>rtl_setting</i> is 0, it's set to off. If <i>rtl_setting</i> is 1, it's set to on. This function must be called before any calls to nsDialogs::CreateControl.</p>
<p>Returns nothing.</p>

<h3><a name="ref-getuserdata"></a>GetUserData</h3>
<p><code>nsDialogs::GetUserData <i>control_HWND</i></code></p>
<p>Returns user data associated with the control on the stack.  Use nsDialogs::SetUserData to set this data.</p>

<h3><a name="ref-setuserdata"></a>SetUserData</h3>
<p><code>nsDialogs::SetUserData <i>control_HWND</i> <i>data</i></code></p>
<p>Associates <i>data</i> with the control. Use nsDialogs::GetUserData to get this data.</p>
<p>Returns nothing.</p>

<h3><a name="ref-onback"></a>OnBack</h3>
<p><code>nsDialogs::OnBack <i>function_address</i></code></p>
<p>Sets the callback function for the Back button. This function will be called when the user clicks the back button. Call Abort in this function to prevent the user from going back to the last page.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h3><a name="ref-onchange"></a>OnChange</h3>
<p><code>nsDialogs::OnChange <i>control_HWND</i> <i>function_address</i></code></p>
<p>Sets a change notification callback function for the given control. Whenever the control changes, the function will be called and the control's HWND will be waiting on its stack.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h3><a name="ref-onclick"></a>OnClick</h3>
<p><code>nsDialogs::OnClick <i>control_HWND</i> <i>function_address</i></code></p>
<p>Sets a click notification callback function for the given control. Whenever the control is clicked, the function will be called and the control's HWND will be waiting on its stack.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h3><a name="ref-onnotify"></a>OnNotify</h3>
<p><code>nsDialogs::OnNotify <i>control_HWND</i> <i>function_address</i></code></p>
<p>Sets a notification callback function for the given control. Whenever the control receives the WM_NOTIFY message, the function will be called and the control's HWND, notification code and a pointer to the NMHDR structure will be waiting on its stack. Use ${NSD_Return} to return a value.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h3><a name="ref-createtimer"></a>CreateTimer</h3>
<p><code>nsDialogs::CreateTimer <i>function_address</i> <i>timer_interval</i></code></p>
<p>Sets a timer that'd call the callback function for the given control every in a constant interval. Interval times are specified in milliseconds.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h3><a name="ref-killtimer"></a>KillTimer</h3>
<p><code>nsDialogs::KillTimer <i>function_address</i></code></p>
<p>Kills a previously set timer.</p>
<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
<p>Returns nothing.</p>

<h2><a name="mref"></a>Macro Reference</h2>
<p>nsDialogs.nsh contains a lot of macros that can make nsDialogs usage a lot easier. Below is a description of each of those macros including purpose, syntax, input and output.</p>

<h3><a name="mref-create"></a>NSD_Create*</h3>
<p><code>${NSD_Create*} <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>
<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>
<p>Available variants:</p>
<ul>
<li>${NSD_CreateHLine}</li>
<li>${NSD_CreateVLine}</li>
<li>${NSD_CreateLabel}</li>
<li>${NSD_CreateIcon}</li>
<li>${NSD_CreateBitmap}</li>
<li>${NSD_CreateBrowseButton}</li>
<li>${NSD_CreateLink}</li>
<li>${NSD_CreateButton}</li>
<li>${NSD_CreateGroupBox}</li>
<li>${NSD_CreateCheckBox}</li>
<li>${NSD_CreateRadioButton} <small>(${NSD_CreateFirstRadioButton} and ${NSD_CreateAdditionalRadioButton})</small></li>
<li>${NSD_CreateText}</li>
<li>${NSD_CreateMLText}</li>
<li>${NSD_CreatePassword}</li>
<li>${NSD_CreateNumber}</li>
<li>${NSD_CreateFileRequest}</li>
<li>${NSD_CreateDirRequest}</li>
<li>${NSD_CreateRichEdit}</li>
<li>${NSD_CreateComboBox}</li>
<li>${NSD_CreateDropList}</li>
<li>${NSD_CreateListBox}</li>
<li>${NSD_CreateSortedListBox}</li>
<li>${NSD_CreateProgressBar}</li>
<li>${NSD_CreateAnimation}</li>
<li>${NSD_CreateHTrackBar}</li>
<li>${NSD_CreateVTrackBar}</li>
<li>${NSD_CreateUpDown}</li>
<li>${NSD_CreateHotKey}</li>
<li>${NSD_CreateDatePicker} <small>(Requires <abbr title="Internet Explorer">IE</abbr> 3.1 and <span class="inlcod"><i>${NSD_InitCommonControlsEx}</i></span>)</small></li>
<li>${NSD_CreateIPAddress} <small>(Requires <abbr title="Internet Explorer">IE</abbr> 4 and <span class="inlcod"><i>${NSD_InitCommonControl_IPAddress}</i></span>)</small></li>
<li>${NSD_CreateNetAddress} <small>(Requires Vista and <span class="inlcod"><i>${NSD_InitCommonControl_NetAddress}</i></span>)</small></li>
</ul>
<p>Returns the new control's HWND on the stack or <i>error</i></p>

<h3><a name="mref-onback"></a>NSD_OnBack</h3>
<p><code>${NSD_OnBack} <i>function_name</i></code></p>
<p>See <a href="#ref-onback">OnBack</a> for more details.</p>

<h3><a name="mref-onchange"></a>NSD_OnChange</h3>
<p><code>${NSD_OnChange} <i>control_HWND</i> <i>function_name</i></code></p>
<p>See <a href="#ref-onchange">OnChange</a> for more details.</p>
<p>See <a href="#step-notify">Real-time Notification</a> for usage example.</p>

<h3><a name="mref-onclick"></a>NSD_OnClick</h3>
<p><code>${NSD_OnClick} <i>control_HWND</i> <i>function_name</i></code></p>
<p>See <a href="#ref-onclick">OnClick</a> for more details.</p>

<h3><a name="mref-onnotify"></a>NSD_OnNotify</h3>
<p><code>${NSD_OnNotify} <i>control_HWND</i> <i>function_name</i></code></p>
<p>See <a href="#ref-onnotify">OnNotify</a> for more details.</p>

<h3><a name="mref-return"></a>NSD_Return</h3>
<p><code>${NSD_Return} <i>value</i></code></p>
<p>Used to return a value back to Windows from a OnNotify callback.</p>

<h3><a name="mref-setfocus"></a>NSD_SetFocus</h3>
<p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>
<p>Sets focus to a control.</p>

<h3><a name="mref-createtimer"></a>NSD_CreateTimer</h3>
<p><code>${NSD_CreateTimer} <i>function_name</i> <i>timer_interval</i></code></p>
<p>See <a href="#ref-createtimer">CreateTimer</a> for more details.</p>

<h3><a name="mref-killtimer"></a>NSD_KillTimer</h3>
<p><code>${NSD_KillTimer} <i>function_name</i></code></p>
<p>See <a href="#ref-killtimer">KillTimer</a> for more details.</p>

<h3><a name="mref-addstyle"></a>NSD_AddStyle</h3>
<p><code>${NSD_AddStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Adds one or more window styles to a control. Multiple styles should be separated with pipes `|'.</p>
<p>See MSDN for shared and per-control style descriptions.</p>

<h3><a name="mref-addexstyle"></a>NSD_AddExStyle</h3>
<p><code>${NSD_AddExStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Adds one or more extended window styles to a control. Multiple styles should be separated with pipes `|'.</p>
<p>See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543">MSDN</a> for style descriptions.</p>

<h3><a name="mref-removestyle"></a>NSD_RemoveStyle</h3>
<p><code>${NSD_RemoveStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Removes one or more window styles from a control.</p>

<h3><a name="mref-removeexstyle"></a>NSD_RemoveExStyle</h3>
<p><code>${NSD_RemoveExStyle} <i>control_HWND</i> <i>style</i></code></p>
<p>Removes one or more extended window styles from a control.</p>

<h3><a name="mref-gettext"></a>NSD_GetText</h3>
<p><code>${NSD_GetText} <i>control_HWND</i> <i>$output_variable</i></code></p>
<p>Retrieves the text of a control and stores it into <i>output_variable</i>. Especially useful for textual controls.</p>
<p>See <a href="#step-state">Control State</a> for usage example.</p>

<h3><a name="mref-settext"></a>NSD_SetText</h3>
<p><code>${NSD_SetText} <i>control_HWND</i> <i>text</i></code></p>
<p>Sets the text of a control.</p>

<h3><a name="mref-settextlimit"></a>NSD_Edit_SetTextLimit</h3>
<p><code>${NSD_Edit_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
<p>Sets the input length limit for a text control.</p>

<h3><a name="mref-edsetro"></a>NSD_Edit_SetReadOnly</h3>
<p><code>${NSD_Edit_SetReadOnly} <i>control_HWND</i> <i>readonly</i></code></p>
<p>1 to make the text control read-only or 0 to allow the user to input data.</p>

<h3><a name="mref-edsetcuebanner"></a>NSD_Edit_SetCueBannerText</h3>
<p><code>${NSD_Edit_SetCueBannerText} <i>control_HWND</i> <i>displaywhenfocused</i> <i>text</i></code></p>
<p>Set a text hint displayed when the control is empty. The text is only visible on WinXP and later. Requires <i>XPStyle on</i>.</p>

<h3><a name="mref-richsettextlimit"></a>NSD_RichEd_SetTextLimit</h3>
<p><code>${NSD_RichEd_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
<p>Sets the input length limit.</p>

<h3><a name="mref-richseteventmask"></a>NSD_RichEd_SetEventMask</h3>
<p><code>${NSD_RichEd_SetEventMask} <i>control_HWND</i> <i>eventmask</i></code></p>

<h3><a name="mref-richsetbkclr"></a>NSD_RichEd_SetCustomBackgroundColor</h3>
<p><code>${NSD_RichEd_SetCustomBackgroundColor} <i>control_HWND</i> <i>COLORREF</i></code></p>

<h3><a name="mref-getstate"></a>NSD_GetState</h3>
<p><code>${NSD_GetState} <i>control_HWND</i> <i>$output_variable</i></code></p>
<p>Retrieves the state of a check box or a radio button control. Possible outputs are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>
<p>See <a href="#step-memory">Memory</a> for usage example.</p>

<h3><a name="mref-setstate"></a>NSD_SetState</h3>
<p><code>${NSD_SetState} <i>control_HWND</i> <i>state</i></code></p>
<p>Sets the state of a check box or a radio button control. Possible values for <i>state</i> are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>
<p>See <a href="#step-memory">Memory</a> for usage example.</p>

<h3><a name="mref-check"></a>NSD_Check</h3>
<p><code>${NSD_Check} <i>control_HWND</i></code></p>
<p>Checks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_CHECKED}.</p>

<h3><a name="mref-uncheck"></a>NSD_Uncheck</h3>
<p><code>${NSD_Uncheck} <i>control_HWND</i></code></p>
<p>Unchecks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_UNCHECKED}.</p>
<p>See <a href="#step-memory">Memory</a> for usage example.</p>

<h3><a name="mref-cbaddstring"></a>NSD_CB_AddString</h3>
<p><code>${NSD_CB_AddString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Adds a string to a combo box.</p>

<h3><a name="mref-cbinsstring"></a>NSD_CB_InsertString</h3>
<p><code>${NSD_CB_InsertString} <i>combo_HWND</i> <i>index</i> <i>string</i></code></p>
<p><code>${NSD_CB_PrependString} <i>combo_HWND</i> <i>string</i></code></p>
<p><code>${NSD_CB_AppendString} <i>combo_HWND</i> <i>string</i></code></p>
<p>Insert a string in a specified position in a combo box.</p>

<h3><a name="mref-cbselectstring"></a>NSD_CB_SelectString</h3>
<p><code>${NSD_CB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>
<span class="inlcod">
<p>Selects an item that begins with the characters in the string. Use <i>NSD_CB_SelectStringExact</i> to match the complete string.</p>
</span>

<h3><a name="mref-cbgetcount">NSD_CB_GetCount</a></h3>
<p><code>${NSD_CB_GetCount} <i>combo_HWND</i> <i>$output_variable</i></code></p>

<h3><a name="mref-lbaddstring"></a>NSD_LB_AddString</h3>
<p><code>${NSD_LB_AddString} <i>listbox_HWND</i> <i>string</i></code></p>
<p>Adds a string to a list box.</p>

<h3><a name="mref-lbinsstring"></a>NSD_LB_InsertString</h3>
<p><code>${NSD_LB_InsertString} <i>listbox_HWND</i> <i>index</i> <i>string</i></code></p>
<p><code>${NSD_LB_PrependString} <i>listbox_HWND</i> <i>string</i></code></p>
<p><code>${NSD_LB_AppendString} <i>listbox_HWND</i> <i>string</i></code></p>
<p>Insert a string in a specified position in a list box.</p>

<h3><a name="mref-lbdelstring"></a>NSD_LB_DelString</h3>
<p><code>${NSD_LB_DelString} <i>listbox_HWND</i> <i>string</i></code></p>
<p>Deletes a string from a list box.</p>

<h3><a name="mref-lbdelitem"></a>NSD_LB_DelItem</h3>
<p><code>${NSD_LB_DelItem} <i>listbox_HWND</i> <i>itemindex</i></code></p>
<p>Deletes a string from a list box.</p>

<h3><a name="mref-lbclear">NSD_LB_Clear</a></h3>
<p><code>${NSD_LB_Clear} <i>listbox_HWND</i></code></p>
<p>Deletes all strings from a list box.</p>

<h3><a name="mref-lbgetcount">NSD_LB_GetCount</a></h3>
<p><code>${NSD_LB_GetCount} <i>listbox_HWND</i> <i>$output_variable</i></code></p>
<p>Retrieves the number of strings from a list box.</p>

<h3><a name="mref-lbselectstring"></a>NSD_LB_SelectString</h3>
<p><code>${NSD_LB_SelectString} <i>listbox_HWND</i> <i>string</i></code></p>
<p>Selects a string in a list box.</p>

<h3><a name="mref-lbgetselection">NSD_LB_GetSelection</a></h3>
<p><code>${NSD_LB_GetSelection} <i>listbox_HWND</i> <i>$output_variable</i></code></p>
<p>Retrieves the selected string from a list box. Returns an empty string if no string is selected.</p>

<h3><a name="mref-animopenfile">NSD_Anim_OpenFile</a></h3>
<p><code>${NSD_Anim_OpenFile} <i>anim_HWND</i> <i>avi_path</i></code></p>
<p>Opens the specified (silent) .AVI movie clip.</p>

<h3><a name="mref-animplay">NSD_Anim_Play</a></h3>
<p><code>${NSD_Anim_Play} <i>anim_HWND</i></code></p>
<p>Plays the movie clip repeatedly.</p>

<h3><a name="mref-animstop">NSD_Anim_Stop</a></h3>
<p><code>${NSD_Anim_Stop} <i>anim_HWND</i></code></p>
<p>Stops playback.</p>

<h3><a name="mref-trackgetpos">NSD_TrackBar_GetPos</a></h3>
<p><code>${NSD_TrackBar_GetPos} <i>track_HWND</i> <i>$output</i></code></p>

<h3><a name="mref-tracksetpos">NSD_TrackBar_SetPos</a></h3>
<p><code>${NSD_TrackBar_SetPos} <i>track_HWND</i> <i>pos</i></code></p>

<h3><a name="mref-tracksetrmin">NSD_TrackBar_SetRangeMin</a></h3>
<p><code>${NSD_TrackBar_SetRangeMin} <i>track_HWND</i> <i>minpos</i></code></p>

<h3><a name="mref-tracksetrmax">NSD_TrackBar_SetRangeMax</a></h3>
<p><code>${NSD_TrackBar_SetRangeMax} <i>track_HWND</i> <i>maxpos</i></code></p>

<h3><a name="mref-tracksetticfr">NSD_TrackBar_SetTicFreq</a></h3>
<p><code>${NSD_TrackBar_SetTicFreq} <i>track_HWND</i> <i>frequency</i></code></p>
<p>Sets the interval frequency for tick marks.</p>

<h3><a name="mref-udsetbuddy">NSD_UD_SetBuddy</a></h3>
<p><code>${NSD_UD_SetBuddy} <i>ud_HWND</i> <i>buddy_HWND</i></code></p>

<h3><a name="mref-udgetpos">NSD_UD_GetPos</a></h3>
<p><code>${NSD_UD_GetPos} <i>ud_HWND</i> <i>$output</i></code></p>

<h3><a name="mref-udsetpos">NSD_UD_SetPos</a></h3>
<p><code>${NSD_UD_SetPos} <i>ud_HWND</i> <i>pos</i></code></p>

<h3><a name="mref-udsetpackedrange">NSD_UD_SetPackedRange</a></h3>
<p><code>${NSD_UD_SetPackedRange} <i>ud_HWND</i> <i>packedrange</i></code></p>
<p>Sets the min-max range. Two signed 16-bit numbers packed into 32-bits.</p>

<h3><a name="mref-hkgethk">NSD_HK_GetHotKey</a></h3>
<p><code>${NSD_HK_GetHotKey} <i>hk_HWND</i> <i>$output</i></code></p>
<p>Bits 0..7 specify the virtual key code and bits 8..15 specify the HOTKEYF modifier flags.</p>

<h3><a name="mref-hksethk">NSD_HK_SetHotKey</a></h3>
<p><code>${NSD_HK_SetHotKey} <i>hk_HWND</i> <i>packedhotkey</i></code></p>

<h3><a name="mref-dategetdatefields">NSD_Date_GetDateFields</a></h3>
<p><code>${NSD_Date_GetDateFields} <i>HWND</i></code></p>
<p>Returns the month, day and year on the stack.</p>

<h3><a name="mref-setbitmap"></a><a name="mref-setimage"></a>NSD_SetBitmap</h3>
<p><code>${NSD_SetBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
<p>Loads a bitmap from <i>image_path</i> and displays it on <i>control_HWND</i> created by <a href="#mref-create">${NSD_CreateBitmap}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freebitmap">${NSD_FreeBitmap}</a> once no longer necessary.</p>
<p>The image must be extracted to the user's computer prior to calling this macro. A good place to extract images is $PLUGINSDIR.</p>
<blockquote><pre>!include nsDialogs.nsh

Name nsDialogs
OutFile nsDialogs.exe

Page custom nsDialogsImage
Page instfiles

Var Dialog
Var ImageCtrl
Var BmpHandle

Function .onInit
	InitPluginsDir
	File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis-r.bmp"
FunctionEnd

Function nsDialogsImage
	nsDialogs::Create 1018
	Pop $Dialog

	${If} $Dialog == error
		Abort
	${EndIf}

	${NSD_CreateBitmap} 0 0 100% 100% ""
	Pop $ImageCtrl
	${NSD_SetBitmap} $ImageCtrl $PLUGINSDIR\image.bmp $BmpHandle

	nsDialogs::Show

	${NSD_FreeBitmap} $BmpHandle
FunctionEnd

Section
SectionEnd</pre></blockquote>

<h3><a name="mref-setsbitmap"></a><a name="mref-setsimage"></a>NSD_SetStretchedBitmap</h3>
<p><code>${NSD_SetStretchedBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
<p>Loads and displays a bitmap just like <a href="#mref-setbitmap">${NSD_SetImage}</a> but stretches the image to fit the control.</p>

<h3><a name="mref-clearbitmap"></a><a name="mref-clearimage"></a>NSD_ClearBitmap</h3>
<p><code>${NSD_ClearBitmap} <i>control_HWND</i></code></p>
<p>Clears a bitmap from a image control.</p>

<h3><a name="mref-freebitmap"></a><a name="mref-freeimage"></a>NSD_FreeBitmap</h3>
<p><code>${NSD_FreeImage} <i>image_handle</i></code></p>
<p>Frees an image handle previously loaded with <a href="#mref-setbitmap">${NSD_SetImage}</a> or <a href="#mref-setsbitmap">${NSD_SetStretchedBitmap}</a>.</p>

<h3><a name="mref-seticon"></a>NSD_SetIcon</h3>
<p><code>${NSD_SetIcon} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
<p>Same as <a href="#mref-setimage">${NSD_SetImage}</a>, but used for loading and setting an icon in a control created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>

<h3><a name="mref-seticonfrominstaller"></a>NSD_SetIconFromInstaller</h3>
<p><code>${NSD_SetIconFromInstaller} <i>control_HWND</i> <i>$output_variable</i></code></p>
<p>Loads the icon used in the installer and displays it on <i>control_HWND</i> created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>

<h3><a name="mref-clearicon"></a>NSD_ClearIcon</h3>
<p><code>${NSD_ClearIcon} <i>control_HWND</i></code></p>
<p>Clears an icon from a control.</p>

<h3><a name="mref-freeicon"></a>NSD_FreeIcon</h3>
<p><code>${NSD_FreeIcon} <i>icon_handle</i></code></p>
<p>Frees an icon handle previously loaded with <a href="#mref-seticon">${NSD_SetIcon}</a> or <a href="#mref-seticonfrominstaller">${NSD_SetIconFromInstaller}</a>.</p>


<h2><a name="faq"></a>FAQ</h2>
<div class="faq">
<ul>
<li>
<b>Q:</b> Can nsDialogs handle InstallOptions INI files?
<blockquote>
<p><b>A:</b> nsDialogs.nsh contains a function called <i>CreateDialogFromINI</i> that can create nsDialogs' dialog from an INI file. It can handle every type of control InstallOptions supports, but doesn't handle the flags or notifications. <i>Examples\nsDialogs\InstallOptions.nsi</i> shows a usage example of this function.</p>
</blockquote>
</li>
</ul>
</div>

</body>
</html>