Why not use a default icon (possibly hidden) in your dialog declaration, and then change it in your onDIALOG init event? (It may not be possible to change the titlebar icon after loading.)

See the following command in the help file:

/did -g name id [n] filename


-genius_at_work