Talk:NsDialogs FAQ

From NSIS Wiki
Jump to navigationJump to search

How to delete items in a ComboBox

By extending the nsDialogs header with the following code is it possible to delete a string value from a ComboBox. The code is not safe yet. If a string is not found it will delete the first entry in the ComboBox.

!macro __NSD_CB_DelString CONTROL STRING
 
    SendMessage ${CONTROL} ${CB_FINDSTRING} -1 `STR:${STRING}` $R0
    SendMessage ${CONTROL} ${CB_DELETESTRING} $R0 0
 
!macroend
 
!define NSD_CB_DelString `!insertmacro __NSD_CB_DelString`

JDavelaar 15:19, 6 April 2009 (UTC)