This is an unfortunate result of this feature (off the help file):

Variables
If you specify a %variable name in a dialog item definition, the %variable will be set with the contents of that item when the dialog is closed.

edit "", 2, 10 10 100 20, autohs %result


There is no bug, as mirc does what it's supposed to: fills %icon with the contents of the icon control (ie $did(x,3), which returns "0 path to\mirc.exe") when the dialog is closed. The problem comes from the (imo cumbersome) way mirc handles variables in dialog tables, combined with the inconsistent way it handles icon filenames and indexes (the dialog table requires the "filename, index" format but $did() and /did use the "index filename" format).