Archive: Add icons by using nsdialog


Add icons by using nsdialog
Hi everyone,

I try to add the icon by using ${NSD_CreateIcon} but I don't know how to set/load the icon that can show in the dialog. I see the nsdialog has the NSD_SetImage but not for Icon. Here is sample code

nsDialogs::Create /NOUNLOAD 1018

${NSD_CreateLabel} 0 0 100% 24u $R1
Pop $R1

${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
Pop $R2
${NSD_OnClick} $R2 function_check_leave

${NSD_CreateIcon} 5u 60u 100% 100% $Icon
Pop $Icon
${NSD_SetImage} $Icon $PLUGINSDIR\Contrib\Graphics\Icon\nisi1-uninstall.ico $IconHandle

Thank you!


I am not sure what should NSD_CreateIcon do...:confused:


I'm too. I see the nsdialog manual let us create the icon by using ${NSD_CreateIcon}. It does not mention how to load the icon, but the ${NSD_CreateImage} does. Has Anyone have any way to display the icon before radiobutton? Thank you!
Below is the part of the manual about NSD_Create*


NSD_Create*
${NSD_Create*} x y width height text

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.

Available variants:

${NSD_CreateHLine}
${NSD_CreateVLine}
${NSD_CreateLabel}
${NSD_CreateIcon}
${NSD_CreateBitmap}
${NSD_CreateBrowseButton}
${NSD_CreateLink}
${NSD_CreateButton}
${NSD_CreateGroupBox}
${NSD_CreateCheckBox}
${NSD_CreateRadioButton}
${NSD_CreateText}
${NSD_CreatePassword}
${NSD_CreateNumber}
${NSD_CreateFileRequest}
${NSD_CreateDirRequest}
${NSD_CreateComboBox}
${NSD_CreateDropList}
${NSD_CreateListBox}
Returns the new dialog's HWND on the stack or error.


I couldn't find any example of NSD_CreateIcon, however, if you want to display a small graphics before radiobutton, you could use NSD_CreateBitmap.