Is there any way to hide a custom window that was created using the /dialog command?

I have a custom dialog window that I wish to toggle on/off (using an icon I've created on the toolbar), but can't find any options like the /window -h or /window -r switches, to do this using the /dialog command.

Currently I'm just using moving the window out of view by doing: /dialog -s $dname -1000 -1 -1 -1 to hide it and /dialog -r $dname to return it back to it's original position, this all seems a bit hacked together. Is there a better way to do this, any help appreciated.