Debian Codegraph @

Contrib/nsDialogs/Readme.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <meta name="color-scheme" content="light dark">
7 <title>nsDialogs</title>
8 <style type="text/css">
9 :root { color-scheme: light dark; }
10 html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }
11 html { font-size: 0.85em; }
12 body { font-size: 1em; font-size: 1rem; }
13 blockquote { margin: 0.75em; } .faq blockquote { margin-left: 0; }
14 pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }
15 span.inlcod i { padding: 0px 0.2em; color: #444444; font-size:95%; }
16 code { margin-left: 1.2em; padding: 0.5em; background-color: #f0f0f0; display:inline-block; }
17 blockquote pre { background-color: #fafafa; padding:0.5em; overflow: auto; }
18 blockquote pre > b { color: #bb0000; }
19 abbr { font-variant: none; cursor: help; }
20
21 @media (prefers-color-scheme: dark) {
22 html, body { color: #eeeeee; background-color: #161616; }
23 span.inlcod i { color: #bbbbbb; }
24 code { background-color: #202020; }
25 blockquote pre { background-color: #222222; }
26 blockquote pre > b { color: #eebbbb; }
27 }
28 </style>
29 </head>
30 <body>
31
32 <h1>NSIS nsDialogs Plug-in</h1>
33 <p><i>Next generation of user interface design</i></p>
34
35 <h2>Table of Contents</h2>
36
37 <ul>
38 <li><a href="#intro">Introduction</a></li>
39 <li>
40 <a href="#step">Step-by-Step Tutorial</a>
41 <ul>
42 <li><a href="#step-page">Custom Page</a></li>
43 <li><a href="#step-add">Adding Controls</a></li>
44 <li><a href="#step-state">Control State</a></li>
45 <li><a href="#step-notify">Real-time Notification</a></li>
46 <li><a href="#step-memory">Memory</a></li>
47 </ul>
48 </li>
49 <li>
50 <a href="#ref">Function Reference</a>
51 <ul>
52 <li><a href="#ref-create">Create</a></li>
53 <li><a href="#ref-createcontrol">CreateControl</a></li>
54 <li><a href="#ref-show">Show</a></li>
55 <li><a href="#ref-selectfiledialog">SelectFileDialog</a></li>
56 <li><a href="#ref-selectfolderdialog">SelectFolderDialog</a></li>
57 <li><a href="#ref-setrtl">SetRTL</a></li>
58 <li><a href="#ref-getuserdata">GetUserData</a></li>
59 <li><a href="#ref-setuserdata">SetUserData</a></li>
60 <li><a href="#ref-onback">OnBack</a></li>
61 <li><a href="#ref-onchange">OnChange</a></li>
62 <li><a href="#ref-onclick">OnClick</a></li>
63 <li><a href="#ref-onnotify">OnNotify</a></li>
64 <li><a href="#ref-createtimer">CreateTimer</a></li>
65 <li><a href="#ref-killtimer">KillTimer</a></li>
66 </ul>
67 </li>
68 <li>
69 <a href="#mref">Macro Reference</a>
70 <ul>
71 <li><a href="#mref-create">NSD_Create*</a></li>
72 <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>
73 <li><a href="#mref-setfocus">NSD_SetFocus</a></li>
74 <li><a href="#mref-createtimer">NSD_CreateTimer</a>, <a href="#mref-killtimer">NSD_KillTimer</a></li>
75 <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>
76 <li><a href="#mref-gettext">NSD_GetText</a>, <a href="#mref-settext">NSD_SetText</a></li>
77 <li>Text, Password &amp; Number:
78 <a href="#mref-settextlimit">NSD_Edit_SetTextLimit</a>,
79 <a href="#mref-edsetro">NSD_Edit_SetReadOnly</a>,
80 <a href="#mref-edsetcuebanner">NSD_Edit_SetCueBannerText</a>
81 </li>
82 <li>RichEdit:
83 <a href="#mref-richsettextlimit">NSD_RichEd_SetTextLimit</a>,
84 <a href="#mref-richseteventmask">NSD_RichEd_SetEventMask</a>,
85 <a href="#mref-richsetbkclr">NSD_RichEd_SetCustomBackgroundColor</a>
86 </li>
87 <li>CheckBox &amp; RadioButton:
88 <a href="#mref-getstate">NSD_GetState</a>,
89 <a href="#mref-setstate">NSD_SetState</a>,
90 <a href="#mref-check">NSD_Check</a>,
91 <a href="#mref-uncheck">NSD_Uncheck</a>
92 </li>
93 <li>ComboBox &amp; DropList:
94 <a href="#mref-cbaddstring">NSD_CB_AddString</a>,
95 <a href="#mref-cbinsstring">NSD_CB_PrependString, NSD_CB_AppendString, NSD_CB_InsertString</a>,
96 NSD_CB_DelString,
97 NSD_CB_DelItem,
98 NSD_CB_Clear,
99 <a href="#mref-cbgetcount">NSD_CB_GetCount</a>,
100 <a href="#mref-cbselectstring">NSD_CB_SelectString</a>, NSD_CB_SelectStringExact, NSD_CB_FindStringExact
101 </li>
102 <li>ListBox:
103 <a href="#mref-lbaddstring">NSD_LB_AddString</a>,
104 <a href="#mref-lbinsstring">NSD_LB_PrependString, NSD_LB_AppendString, NSD_LB_InsertString</a>,
105 <a href="#mref-lbdelstring">NSD_LB_DelString</a>,
106 <a href="#mref-lbdelitem">NSD_LB_DelItem</a>,
107 <a href="#mref-lbclear">NSD_LB_Clear</a>,
108 <a href="#mref-lbgetcount">NSD_LB_GetCount</a>,
109 <a href="#mref-lbselectstring">NSD_LB_SelectString</a>,
110 <a href="#mref-lbgetselection">NSD_LB_GetSelection</a>
111 </li>
112 <li>Animation:
113 <a href="#mref-animopenfile">NSD_Anim_OpenFile</a>,
114 <a href="#mref-animplay">NSD_Anim_Play</a>,
115 <a href="#mref-animstop">NSD_Anim_Stop</a>
116 </li>
117 <li>HTrackBar &amp; VTrackBar:
118 <a href="#mref-trackgetpos">NSD_TrackBar_GetPos</a>,
119 <a href="#mref-tracksetpos">NSD_TrackBar_SetPos</a>,
120 <a href="#mref-tracksetrmin">NSD_TrackBar_SetRangeMin</a>,
121 <a href="#mref-tracksetrmax">NSD_TrackBar_SetRangeMax</a>,
122 <a href="#mref-tracksetticfr">NSD_TrackBar_SetTicFreq</a>
123 </li>
124 <li>UpDown:
125 <a href="#mref-udsetbuddy">NSD_UD_SetBuddy</a>,
126 <a href="#mref-udgetpos">NSD_UD_GetPos</a>,
127 <a href="#mref-udsetpos">NSD_UD_SetPos</a>,
128 <a href="#mref-udsetpackedrange">NSD_UD_SetPackedRange</a>
129 </li>
130 <li>HotKey:
131 <a href="#mref-hkgethk">NSD_HK_GetHotKey</a>, <a href="#mref-hksethk">NSD_HK_SetHotKey</a>
132 </li>
133 <li>DatePicker:
134 <a href="#mref-dategetdatefields">NSD_Date_GetDateFields</a>
135 </li>
136 <li>Bitmap:
137 <a href="#mref-setbitmap">NSD_SetBitmap</a>,
138 <a href="#mref-setsbitmap">NSD_SetStretchedBitmap</a>,
139 <a href="#mref-clearbitmap">NSD_ClearBitmap</a>,
140 <a href="#mref-freebitmap">NSD_FreeBitmap</a>
141 </li>
142 <li>Icon:
143 <a href="#mref-seticon">NSD_SetIcon</a>,
144 <a href="#mref-seticonfrominstaller">NSD_SetIconFromInstaller</a>,
145 <a href="#mref-clearicon">NSD_ClearIcon</a>,
146 <a href="#mref-freeicon">NSD_FreeIcon</a>
147 </li>
148 </ul>
149 </li>
150 <li><a href="#faq">FAQ</a></li>
151 </ul>
152
153 <h2><a name="intro"></a>Introduction</h2>
154
155 <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>
156
157 <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>
158
159 <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>
160
161 <h2><a name="step"></a>Step-by-Step Tutorial</h2>
162
163 <h3><a name="step-page"></a>Custom Page</h3>
164
165 <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>
166
167 <blockquote><pre><b>!include LogicLib.nsh</b>
168
169 Name nsDialogs
170 OutFile nsDialogs.exe
171 XPStyle on
172
173 <b>
174 Var Dialog
175
176 Page custom nsDialogsPage</b>
177 Page instfiles
178
179 <b>Function nsDialogsPage
180 nsDialogs::Create 1018
181 Pop $Dialog
182
183 ${If} $Dialog == error
184 Abort
185 ${EndIf}
186
187 nsDialogs::Show
188 FunctionEnd</b>
189
190 Section
191 SectionEnd</pre></blockquote>
192 <span class="inlcod">
193 <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>
194 <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>
195 <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>
196 <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>
197 </span>
198
199
200 <h3><a name="step-add"></a>Adding Controls</h3>
201
202 <span class="inlcod">
203 <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>
204
205 <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>
206
207 <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>
208 </span>
209 <blockquote><pre><b>!include nsDialogs.nsh</b>
210 !include LogicLib.nsh
211
212 Name nsDialogs
213 OutFile nsDialogs.exe
214 XPStyle on
215
216 Var Dialog
217 <b>Var Label
218 Var Text</b>
219
220 Page custom nsDialogsPage
221 Page instfiles
222
223 Function nsDialogsPage
224
225 nsDialogs::Create 1018
226 Pop $Dialog
227
228 ${If} $Dialog == error
229 Abort
230 ${EndIf}
231 <b>
232 ${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
233 Pop $Label
234
235 ${NSD_CreateText} 0 13u 100% -13u "Type something here..."
236 Pop $Text
237 </b>
238 nsDialogs::Show
239
240 FunctionEnd
241
242 Section
243 SectionEnd</pre></blockquote>
244
245 <p>Available control types that can be created with <a href="#mref-create">${NSD_Create*}</a> are:
246 HLine,
247 VLine,
248 Label,
249 Icon,
250 Bitmap,
251 BrowseButton,
252 Link,
253 Button,
254 GroupBox,
255 CheckBox,
256 RadioButton (FirstRadioButton and AdditionalRadioButton),
257 Text,
258 MLText,
259 Password,
260 Number,
261 FileRequest,
262 DirRequest,
263 RichEdit,
264 ComboBox,
265 DropList,
266 ListBox,
267 SortedListBox,
268 ProgressBar,
269 Animation,
270 HTrackBar,
271 VTrackBar,
272 UpDown,
273 HotKey,
274 DatePicker,
275 IPAddress,
276 NetAddress.
277 </p>
278
279 <h3><a name="step-state"></a>Control State</h3>
280
281 <span class="inlcod">
282 <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>
283
284 <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>
285 </span>
286 <blockquote><pre>!include nsDialogs.nsh
287 !include LogicLib.nsh
288
289 Name nsDialogs
290 OutFile nsDialogs.exe
291 XPStyle on
292
293 Var Dialog
294 Var Label
295 Var Text
296
297 Page custom nsDialogsPage <b>nsDialogsPageLeave</b>
298 Page instfiles
299
300 Function nsDialogsPage
301
302 nsDialogs::Create 1018
303 Pop $Dialog
304
305 ${If} $Dialog == error
306 Abort
307 ${EndIf}
308
309 ${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
310 Pop $Label
311
312 ${NSD_CreateText} 0 13u 100% -13u "Type something here..."
313 Pop $Text
314
315 nsDialogs::Show
316
317 FunctionEnd
318
319 <b>Function nsDialogsPageLeave
320
321 ${NSD_GetText} $Text $0
322 MessageBox MB_OK "You typed:$\n$\n$0"
323
324 FunctionEnd</b>
325
326 Section
327 SectionEnd</pre></blockquote>
328
329 <h3><a name="step-notify"></a>Real-time Notification</h3>
330
331 <span class="inlcod">
332 <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>
333
334 <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>
335
336 <p>The new example will respond to the user typing "hello" in the text box.</p>
337 </span>
338 <blockquote><pre>!include nsDialogs.nsh
339 !include LogicLib.nsh
340
341 Name nsDialogs
342 OutFile nsDialogs.exe
343 XPStyle on
344
345 Var Dialog
346 Var Label
347 Var Text
348
349 Page custom nsDialogsPage nsDialogsPageLeave
350 Page instfiles
351
352 Function nsDialogsPage
353
354 nsDialogs::Create 1018
355 Pop $Dialog
356
357 ${If} $Dialog == error
358 Abort
359 ${EndIf}
360
361 ${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
362 Pop $Label
363
364 ${NSD_CreateText} 0 13u 100% -13u "Type something here..."
365 Pop $Text
366 <b>${NSD_OnChange} $Text nsDialogsPageTextChange</b>
367
368 nsDialogs::Show
369
370 FunctionEnd
371
372 Function nsDialogsPageLeave
373
374 ${NSD_GetText} $Text $0
375 MessageBox MB_OK "You typed:$\n$\n$0"
376
377 FunctionEnd
378
379 <b>Function nsDialogsPageTextChange
380
381 Pop $1 # $1 == $ Text
382
383 ${NSD_GetText} $Text $0
384
385 ${If} $0 == "hello"
386
387 MessageBox MB_OK "right back at ya!"
388
389 ${EndIf}
390
391 FunctionEnd</b>
392
393 Section
394 SectionEnd</pre></blockquote>
395
396 <h3><a name="step-memory"></a>Memory</h3>
397
398 <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>
399
400 <p>For clarity, we'll remove some of the notifications from the previous step.</p>
401
402 <blockquote><pre>!include nsDialogs.nsh
403 !include LogicLib.nsh
404
405 Name nsDialogs
406 OutFile nsDialogs.exe
407 XPStyle on
408
409 Var Dialog
410 Var Label
411 Var Text
412 <b>Var Text_State
413 Var Checkbox
414 Var Checkbox_State</b>
415
416 Page custom nsDialogsPage nsDialogsPageLeave
417 <b>Page license</b>
418 Page instfiles
419
420 <b>Function .onInit
421
422 StrCpy $Text_State "Type something here..."
423
424 FunctionEnd</b>
425
426 Function nsDialogsPage
427
428 nsDialogs::Create 1018
429 Pop $Dialog
430
431 ${If} $Dialog == error
432 Abort
433 ${EndIf}
434
435 ${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
436 Pop $Label
437
438 ${NSD_CreateText} 0 13u 100% <b>12u $Text_State</b>
439 Pop $Text
440
441 <b>${NSD_CreateCheckbox} 0 30u 100% 10u "&amp;Something"
442 Pop $Checkbox
443
444 ${If} $Checkbox_State == ${BST_CHECKED}
445 ${NSD_Check} $Checkbox
446 ${EndIf}
447
448 # alternative for the above ${If}:
449 #${NSD_SetState} $Checkbox_State</b>
450
451 nsDialogs::Show
452
453 FunctionEnd
454
455 Function nsDialogsPageLeave
456
457 ${NSD_GetText} $Text <b>$Text_State</b>
458 <b>${NSD_GetState} $Checkbox $Checkbox_State</b>
459
460 FunctionEnd
461
462 Section
463 SectionEnd</pre></blockquote>
464
465 <h2><a name="ref"></a>Function Reference</h2>
466
467 <h3><a name="ref-create"></a>Create</h3>
468 <p><code>nsDialogs::Create <i>rect</i></code></p>
469 <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>
470 <p>Returns the new dialog's HWND on the stack or <i>error</i>.</p>
471
472 <h3><a name="ref-createcontrol"></a>CreateControl</h3>
473 <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>
474 <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>
475 <p>Returns the new control's HWND on the stack or <i>error</i>.</p>
476
477 <h3><a name="ref-show"></a>Show</h3>
478 <p><code>nsDialogs::Show</code></p>
479 <p>Displays the page. Call this once finished with nsDialogs::Create, nsDialogs::CreateControl and the rest.</p>
480 <p>Returns nothing.</p>
481
482 <h3><a name="ref-selectfiledialog"></a>SelectFileDialog</h3>
483 <p><code>nsDialogs::SelectFileDialog <i>mode</i> <i>initial_selection</i> <i>filter</i></code></p>
484 <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.
485 <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>
486 <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>
487 <p>Returns the selected file on the stack or an empty string if the user canceled the operation.</p>
488 <blockquote><pre>
489 nsDialogs::SelectFileDialog open "$DOCUMENTS\Config.ini" ".ini files|*.ini|All Files|*.*"
490 Pop $0
491 StrCmp $0 "" ...
492 </pre></blockquote>
493
494 <h3><a name="ref-selectfolderdialog"></a>SelectFolderDialog</h3>
495 <p><code>nsDialogs::SelectFolderDialog <i>title</i> <i>initial_selection</i></code></p>
496 <p>Displays a directory selection dialog to the user.</p>
497 <p>Returns the selected directory on the stack or "error" in case the user canceled the operation or an error occurred.</p>
498
499 <h3><a name="ref-setrtl"></a>SetRTL</h3>
500 <p><code>nsDialogs::SetRTL <i>rtl_setting</i></code></p>
501 <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>
502 <p>Returns nothing.</p>
503
504 <h3><a name="ref-getuserdata"></a>GetUserData</h3>
505 <p><code>nsDialogs::GetUserData <i>control_HWND</i></code></p>
506 <p>Returns user data associated with the control on the stack. Use nsDialogs::SetUserData to set this data.</p>
507
508 <h3><a name="ref-setuserdata"></a>SetUserData</h3>
509 <p><code>nsDialogs::SetUserData <i>control_HWND</i> <i>data</i></code></p>
510 <p>Associates <i>data</i> with the control. Use nsDialogs::GetUserData to get this data.</p>
511 <p>Returns nothing.</p>
512
513 <h3><a name="ref-onback"></a>OnBack</h3>
514 <p><code>nsDialogs::OnBack <i>function_address</i></code></p>
515 <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>
516 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
517 <p>Returns nothing.</p>
518
519 <h3><a name="ref-onchange"></a>OnChange</h3>
520 <p><code>nsDialogs::OnChange <i>control_HWND</i> <i>function_address</i></code></p>
521 <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>
522 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
523 <p>Returns nothing.</p>
524
525 <h3><a name="ref-onclick"></a>OnClick</h3>
526 <p><code>nsDialogs::OnClick <i>control_HWND</i> <i>function_address</i></code></p>
527 <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>
528 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
529 <p>Returns nothing.</p>
530
531 <h3><a name="ref-onnotify"></a>OnNotify</h3>
532 <p><code>nsDialogs::OnNotify <i>control_HWND</i> <i>function_address</i></code></p>
533 <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>
534 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
535 <p>Returns nothing.</p>
536
537 <h3><a name="ref-createtimer"></a>CreateTimer</h3>
538 <p><code>nsDialogs::CreateTimer <i>function_address</i> <i>timer_interval</i></code></p>
539 <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>
540 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
541 <p>Returns nothing.</p>
542
543 <h3><a name="ref-killtimer"></a>KillTimer</h3>
544 <p><code>nsDialogs::KillTimer <i>function_address</i></code></p>
545 <p>Kills a previously set timer.</p>
546 <p>Use GetFunctionAddress to get the address of the desired callback function.</p>
547 <p>Returns nothing.</p>
548
549 <h2><a name="mref"></a>Macro Reference</h2>
550 <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>
551
552 <h3><a name="mref-create"></a>NSD_Create*</h3>
553 <p><code>${NSD_Create*} <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>
554 <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>
555 <p>Available variants:</p>
556 <ul>
557 <li>${NSD_CreateHLine}</li>
558 <li>${NSD_CreateVLine}</li>
559 <li>${NSD_CreateLabel}</li>
560 <li>${NSD_CreateIcon}</li>
561 <li>${NSD_CreateBitmap}</li>
562 <li>${NSD_CreateBrowseButton}</li>
563 <li>${NSD_CreateLink}</li>
564 <li>${NSD_CreateButton}</li>
565 <li>${NSD_CreateGroupBox}</li>
566 <li>${NSD_CreateCheckBox}</li>
567 <li>${NSD_CreateRadioButton} <small>(${NSD_CreateFirstRadioButton} and ${NSD_CreateAdditionalRadioButton})</small></li>
568 <li>${NSD_CreateText}</li>
569 <li>${NSD_CreateMLText}</li>
570 <li>${NSD_CreatePassword}</li>
571 <li>${NSD_CreateNumber}</li>
572 <li>${NSD_CreateFileRequest}</li>
573 <li>${NSD_CreateDirRequest}</li>
574 <li>${NSD_CreateRichEdit}</li>
575 <li>${NSD_CreateComboBox}</li>
576 <li>${NSD_CreateDropList}</li>
577 <li>${NSD_CreateListBox}</li>
578 <li>${NSD_CreateSortedListBox}</li>
579 <li>${NSD_CreateProgressBar}</li>
580 <li>${NSD_CreateAnimation}</li>
581 <li>${NSD_CreateHTrackBar}</li>
582 <li>${NSD_CreateVTrackBar}</li>
583 <li>${NSD_CreateUpDown}</li>
584 <li>${NSD_CreateHotKey}</li>
585 <li>${NSD_CreateDatePicker} <small>(Requires <abbr title="Internet Explorer">IE</abbr> 3.1 and <span class="inlcod"><i>${NSD_InitCommonControlsEx}</i></span>)</small></li>
586 <li>${NSD_CreateIPAddress} <small>(Requires <abbr title="Internet Explorer">IE</abbr> 4 and <span class="inlcod"><i>${NSD_InitCommonControl_IPAddress}</i></span>)</small></li>
587 <li>${NSD_CreateNetAddress} <small>(Requires Vista and <span class="inlcod"><i>${NSD_InitCommonControl_NetAddress}</i></span>)</small></li>
588 </ul>
589 <p>Returns the new control's HWND on the stack or <i>error</i></p>
590
591 <h3><a name="mref-onback"></a>NSD_OnBack</h3>
592 <p><code>${NSD_OnBack} <i>function_name</i></code></p>
593 <p>See <a href="#ref-onback">OnBack</a> for more details.</p>
594
595 <h3><a name="mref-onchange"></a>NSD_OnChange</h3>
596 <p><code>${NSD_OnChange} <i>control_HWND</i> <i>function_name</i></code></p>
597 <p>See <a href="#ref-onchange">OnChange</a> for more details.</p>
598 <p>See <a href="#step-notify">Real-time Notification</a> for usage example.</p>
599
600 <h3><a name="mref-onclick"></a>NSD_OnClick</h3>
601 <p><code>${NSD_OnClick} <i>control_HWND</i> <i>function_name</i></code></p>
602 <p>See <a href="#ref-onclick">OnClick</a> for more details.</p>
603
604 <h3><a name="mref-onnotify"></a>NSD_OnNotify</h3>
605 <p><code>${NSD_OnNotify} <i>control_HWND</i> <i>function_name</i></code></p>
606 <p>See <a href="#ref-onnotify">OnNotify</a> for more details.</p>
607
608 <h3><a name="mref-return"></a>NSD_Return</h3>
609 <p><code>${NSD_Return} <i>value</i></code></p>
610 <p>Used to return a value back to Windows from a OnNotify callback.</p>
611
612 <h3><a name="mref-setfocus"></a>NSD_SetFocus</h3>
613 <p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>
614 <p>Sets focus to a control.</p>
615
616 <h3><a name="mref-createtimer"></a>NSD_CreateTimer</h3>
617 <p><code>${NSD_CreateTimer} <i>function_name</i> <i>timer_interval</i></code></p>
618 <p>See <a href="#ref-createtimer">CreateTimer</a> for more details.</p>
619
620 <h3><a name="mref-killtimer"></a>NSD_KillTimer</h3>
621 <p><code>${NSD_KillTimer} <i>function_name</i></code></p>
622 <p>See <a href="#ref-killtimer">KillTimer</a> for more details.</p>
623
624 <h3><a name="mref-addstyle"></a>NSD_AddStyle</h3>
625 <p><code>${NSD_AddStyle} <i>control_HWND</i> <i>style</i></code></p>
626 <p>Adds one or more window styles to a control. Multiple styles should be separated with pipes `|'.</p>
627 <p>See MSDN for shared and per-control style descriptions.</p>
628
629 <h3><a name="mref-addexstyle"></a>NSD_AddExStyle</h3>
630 <p><code>${NSD_AddExStyle} <i>control_HWND</i> <i>style</i></code></p>
631 <p>Adds one or more extended window styles to a control. Multiple styles should be separated with pipes `|'.</p>
632 <p>See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543">MSDN</a> for style descriptions.</p>
633
634 <h3><a name="mref-removestyle"></a>NSD_RemoveStyle</h3>
635 <p><code>${NSD_RemoveStyle} <i>control_HWND</i> <i>style</i></code></p>
636 <p>Removes one or more window styles from a control.</p>
637
638 <h3><a name="mref-removeexstyle"></a>NSD_RemoveExStyle</h3>
639 <p><code>${NSD_RemoveExStyle} <i>control_HWND</i> <i>style</i></code></p>
640 <p>Removes one or more extended window styles from a control.</p>
641
642 <h3><a name="mref-gettext"></a>NSD_GetText</h3>
643 <p><code>${NSD_GetText} <i>control_HWND</i> <i>$output_variable</i></code></p>
644 <p>Retrieves the text of a control and stores it into <i>output_variable</i>. Especially useful for textual controls.</p>
645 <p>See <a href="#step-state">Control State</a> for usage example.</p>
646
647 <h3><a name="mref-settext"></a>NSD_SetText</h3>
648 <p><code>${NSD_SetText} <i>control_HWND</i> <i>text</i></code></p>
649 <p>Sets the text of a control.</p>
650
651 <h3><a name="mref-settextlimit"></a>NSD_Edit_SetTextLimit</h3>
652 <p><code>${NSD_Edit_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
653 <p>Sets the input length limit for a text control.</p>
654
655 <h3><a name="mref-edsetro"></a>NSD_Edit_SetReadOnly</h3>
656 <p><code>${NSD_Edit_SetReadOnly} <i>control_HWND</i> <i>readonly</i></code></p>
657 <p>1 to make the text control read-only or 0 to allow the user to input data.</p>
658
659 <h3><a name="mref-edsetcuebanner"></a>NSD_Edit_SetCueBannerText</h3>
660 <p><code>${NSD_Edit_SetCueBannerText} <i>control_HWND</i> <i>displaywhenfocused</i> <i>text</i></code></p>
661 <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>
662
663 <h3><a name="mref-richsettextlimit"></a>NSD_RichEd_SetTextLimit</h3>
664 <p><code>${NSD_RichEd_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
665 <p>Sets the input length limit.</p>
666
667 <h3><a name="mref-richseteventmask"></a>NSD_RichEd_SetEventMask</h3>
668 <p><code>${NSD_RichEd_SetEventMask} <i>control_HWND</i> <i>eventmask</i></code></p>
669
670 <h3><a name="mref-richsetbkclr"></a>NSD_RichEd_SetCustomBackgroundColor</h3>
671 <p><code>${NSD_RichEd_SetCustomBackgroundColor} <i>control_HWND</i> <i>COLORREF</i></code></p>
672
673 <h3><a name="mref-getstate"></a>NSD_GetState</h3>
674 <p><code>${NSD_GetState} <i>control_HWND</i> <i>$output_variable</i></code></p>
675 <p>Retrieves the state of a check box or a radio button control. Possible outputs are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>
676 <p>See <a href="#step-memory">Memory</a> for usage example.</p>
677
678 <h3><a name="mref-setstate"></a>NSD_SetState</h3>
679 <p><code>${NSD_SetState} <i>control_HWND</i> <i>state</i></code></p>
680 <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>
681 <p>See <a href="#step-memory">Memory</a> for usage example.</p>
682
683 <h3><a name="mref-check"></a>NSD_Check</h3>
684 <p><code>${NSD_Check} <i>control_HWND</i></code></p>
685 <p>Checks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_CHECKED}.</p>
686
687 <h3><a name="mref-uncheck"></a>NSD_Uncheck</h3>
688 <p><code>${NSD_Uncheck} <i>control_HWND</i></code></p>
689 <p>Unchecks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_UNCHECKED}.</p>
690 <p>See <a href="#step-memory">Memory</a> for usage example.</p>
691
692 <h3><a name="mref-cbaddstring"></a>NSD_CB_AddString</h3>
693 <p><code>${NSD_CB_AddString} <i>combo_HWND</i> <i>string</i></code></p>
694 <p>Adds a string to a combo box.</p>
695
696 <h3><a name="mref-cbinsstring"></a>NSD_CB_InsertString</h3>
697 <p><code>${NSD_CB_InsertString} <i>combo_HWND</i> <i>index</i> <i>string</i></code></p>
698 <p><code>${NSD_CB_PrependString} <i>combo_HWND</i> <i>string</i></code></p>
699 <p><code>${NSD_CB_AppendString} <i>combo_HWND</i> <i>string</i></code></p>
700 <p>Insert a string in a specified position in a combo box.</p>
701
702 <h3><a name="mref-cbselectstring"></a>NSD_CB_SelectString</h3>
703 <p><code>${NSD_CB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>
704 <span class="inlcod">
705 <p>Selects an item that begins with the characters in the string. Use <i>NSD_CB_SelectStringExact</i> to match the complete string.</p>
706 </span>
707
708 <h3><a name="mref-cbgetcount">NSD_CB_GetCount</a></h3>
709 <p><code>${NSD_CB_GetCount} <i>combo_HWND</i> <i>$output_variable</i></code></p>
710
711 <h3><a name="mref-lbaddstring"></a>NSD_LB_AddString</h3>
712 <p><code>${NSD_LB_AddString} <i>listbox_HWND</i> <i>string</i></code></p>
713 <p>Adds a string to a list box.</p>
714
715 <h3><a name="mref-lbinsstring"></a>NSD_LB_InsertString</h3>
716 <p><code>${NSD_LB_InsertString} <i>listbox_HWND</i> <i>index</i> <i>string</i></code></p>
717 <p><code>${NSD_LB_PrependString} <i>listbox_HWND</i> <i>string</i></code></p>
718 <p><code>${NSD_LB_AppendString} <i>listbox_HWND</i> <i>string</i></code></p>
719 <p>Insert a string in a specified position in a list box.</p>
720
721 <h3><a name="mref-lbdelstring"></a>NSD_LB_DelString</h3>
722 <p><code>${NSD_LB_DelString} <i>listbox_HWND</i> <i>string</i></code></p>
723 <p>Deletes a string from a list box.</p>
724
725 <h3><a name="mref-lbdelitem"></a>NSD_LB_DelItem</h3>
726 <p><code>${NSD_LB_DelItem} <i>listbox_HWND</i> <i>itemindex</i></code></p>
727 <p>Deletes a string from a list box.</p>
728
729 <h3><a name="mref-lbclear">NSD_LB_Clear</a></h3>
730 <p><code>${NSD_LB_Clear} <i>listbox_HWND</i></code></p>
731 <p>Deletes all strings from a list box.</p>
732
733 <h3><a name="mref-lbgetcount">NSD_LB_GetCount</a></h3>
734 <p><code>${NSD_LB_GetCount} <i>listbox_HWND</i> <i>$output_variable</i></code></p>
735 <p>Retrieves the number of strings from a list box.</p>
736
737 <h3><a name="mref-lbselectstring"></a>NSD_LB_SelectString</h3>
738 <p><code>${NSD_LB_SelectString} <i>listbox_HWND</i> <i>string</i></code></p>
739 <p>Selects a string in a list box.</p>
740
741 <h3><a name="mref-lbgetselection">NSD_LB_GetSelection</a></h3>
742 <p><code>${NSD_LB_GetSelection} <i>listbox_HWND</i> <i>$output_variable</i></code></p>
743 <p>Retrieves the selected string from a list box. Returns an empty string if no string is selected.</p>
744
745 <h3><a name="mref-animopenfile">NSD_Anim_OpenFile</a></h3>
746 <p><code>${NSD_Anim_OpenFile} <i>anim_HWND</i> <i>avi_path</i></code></p>
747 <p>Opens the specified (silent) .AVI movie clip.</p>
748
749 <h3><a name="mref-animplay">NSD_Anim_Play</a></h3>
750 <p><code>${NSD_Anim_Play} <i>anim_HWND</i></code></p>
751 <p>Plays the movie clip repeatedly.</p>
752
753 <h3><a name="mref-animstop">NSD_Anim_Stop</a></h3>
754 <p><code>${NSD_Anim_Stop} <i>anim_HWND</i></code></p>
755 <p>Stops playback.</p>
756
757 <h3><a name="mref-trackgetpos">NSD_TrackBar_GetPos</a></h3>
758 <p><code>${NSD_TrackBar_GetPos} <i>track_HWND</i> <i>$output</i></code></p>
759
760 <h3><a name="mref-tracksetpos">NSD_TrackBar_SetPos</a></h3>
761 <p><code>${NSD_TrackBar_SetPos} <i>track_HWND</i> <i>pos</i></code></p>
762
763 <h3><a name="mref-tracksetrmin">NSD_TrackBar_SetRangeMin</a></h3>
764 <p><code>${NSD_TrackBar_SetRangeMin} <i>track_HWND</i> <i>minpos</i></code></p>
765
766 <h3><a name="mref-tracksetrmax">NSD_TrackBar_SetRangeMax</a></h3>
767 <p><code>${NSD_TrackBar_SetRangeMax} <i>track_HWND</i> <i>maxpos</i></code></p>
768
769 <h3><a name="mref-tracksetticfr">NSD_TrackBar_SetTicFreq</a></h3>
770 <p><code>${NSD_TrackBar_SetTicFreq} <i>track_HWND</i> <i>frequency</i></code></p>
771 <p>Sets the interval frequency for tick marks.</p>
772
773 <h3><a name="mref-udsetbuddy">NSD_UD_SetBuddy</a></h3>
774 <p><code>${NSD_UD_SetBuddy} <i>ud_HWND</i> <i>buddy_HWND</i></code></p>
775
776 <h3><a name="mref-udgetpos">NSD_UD_GetPos</a></h3>
777 <p><code>${NSD_UD_GetPos} <i>ud_HWND</i> <i>$output</i></code></p>
778
779 <h3><a name="mref-udsetpos">NSD_UD_SetPos</a></h3>
780 <p><code>${NSD_UD_SetPos} <i>ud_HWND</i> <i>pos</i></code></p>
781
782 <h3><a name="mref-udsetpackedrange">NSD_UD_SetPackedRange</a></h3>
783 <p><code>${NSD_UD_SetPackedRange} <i>ud_HWND</i> <i>packedrange</i></code></p>
784 <p>Sets the min-max range. Two signed 16-bit numbers packed into 32-bits.</p>
785
786 <h3><a name="mref-hkgethk">NSD_HK_GetHotKey</a></h3>
787 <p><code>${NSD_HK_GetHotKey} <i>hk_HWND</i> <i>$output</i></code></p>
788 <p>Bits 0..7 specify the virtual key code and bits 8..15 specify the HOTKEYF modifier flags.</p>
789
790 <h3><a name="mref-hksethk">NSD_HK_SetHotKey</a></h3>
791 <p><code>${NSD_HK_SetHotKey} <i>hk_HWND</i> <i>packedhotkey</i></code></p>
792
793 <h3><a name="mref-dategetdatefields">NSD_Date_GetDateFields</a></h3>
794 <p><code>${NSD_Date_GetDateFields} <i>HWND</i></code></p>
795 <p>Returns the month, day and year on the stack.</p>
796
797 <h3><a name="mref-setbitmap"></a><a name="mref-setimage"></a>NSD_SetBitmap</h3>
798 <p><code>${NSD_SetBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
799 <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>
800 <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>
801 <blockquote><pre>!include nsDialogs.nsh
802
803 Name nsDialogs
804 OutFile nsDialogs.exe
805
806 Page custom nsDialogsImage
807 Page instfiles
808
809 Var Dialog
810 Var ImageCtrl
811 Var BmpHandle
812
813 Function .onInit
814 InitPluginsDir
815 File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis-r.bmp"
816 FunctionEnd
817
818 Function nsDialogsImage
819 nsDialogs::Create 1018
820 Pop $Dialog
821
822 ${If} $Dialog == error
823 Abort
824 ${EndIf}
825
826 ${NSD_CreateBitmap} 0 0 100% 100% ""
827 Pop $ImageCtrl
828 ${NSD_SetBitmap} $ImageCtrl $PLUGINSDIR\image.bmp $BmpHandle
829
830 nsDialogs::Show
831
832 ${NSD_FreeBitmap} $BmpHandle
833 FunctionEnd
834
835 Section
836 SectionEnd</pre></blockquote>
837
838 <h3><a name="mref-setsbitmap"></a><a name="mref-setsimage"></a>NSD_SetStretchedBitmap</h3>
839 <p><code>${NSD_SetStretchedBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
840 <p>Loads and displays a bitmap just like <a href="#mref-setbitmap">${NSD_SetImage}</a> but stretches the image to fit the control.</p>
841
842 <h3><a name="mref-clearbitmap"></a><a name="mref-clearimage"></a>NSD_ClearBitmap</h3>
843 <p><code>${NSD_ClearBitmap} <i>control_HWND</i></code></p>
844 <p>Clears a bitmap from a image control.</p>
845
846 <h3><a name="mref-freebitmap"></a><a name="mref-freeimage"></a>NSD_FreeBitmap</h3>
847 <p><code>${NSD_FreeImage} <i>image_handle</i></code></p>
848 <p>Frees an image handle previously loaded with <a href="#mref-setbitmap">${NSD_SetImage}</a> or <a href="#mref-setsbitmap">${NSD_SetStretchedBitmap}</a>.</p>
849
850 <h3><a name="mref-seticon"></a>NSD_SetIcon</h3>
851 <p><code>${NSD_SetIcon} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>
852 <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>
853
854 <h3><a name="mref-seticonfrominstaller"></a>NSD_SetIconFromInstaller</h3>
855 <p><code>${NSD_SetIconFromInstaller} <i>control_HWND</i> <i>$output_variable</i></code></p>
856 <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>
857
858 <h3><a name="mref-clearicon"></a>NSD_ClearIcon</h3>
859 <p><code>${NSD_ClearIcon} <i>control_HWND</i></code></p>
860 <p>Clears an icon from a control.</p>
861
862 <h3><a name="mref-freeicon"></a>NSD_FreeIcon</h3>
863 <p><code>${NSD_FreeIcon} <i>icon_handle</i></code></p>
864 <p>Frees an icon handle previously loaded with <a href="#mref-seticon">${NSD_SetIcon}</a> or <a href="#mref-seticonfrominstaller">${NSD_SetIconFromInstaller}</a>.</p>
865
866
867 <h2><a name="faq"></a>FAQ</h2>
868 <div class="faq">
869 <ul>
870 <li>
871 <b>Q:</b> Can nsDialogs handle InstallOptions INI files?
872 <blockquote>
873 <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>
874 </blockquote>
875 </li>
876 </ul>
877 </div>
878
879 </body>
880 </html>