There are some stuff on dialog, which is probably available on all window widgets, e.g.
You’ll have to store the original size and then restore to it, test
//capture window
var dlg=dijit.byId('mxui_widget_DialogMessage_0')
//originals
var original_w=dlg.domNode.getBoundingClientRect().width;
var original_h=dlg.domNode.getBoundingClientRect().height;
//simulate resize (executed on conditional visibility)
dlg.resize(
{
t:0,
l:0,
w:dlg._getMaximumSize().w,
h:dlg._getMaximumSize().h
}
)
//simulate restore (executed on conditional visibility)
setTimeout(dojo.hitch(this,function(){
dlg.resize(
{
t:0,
l:0,
h:original_h,
w:original_w
}
)
}),1000);