I've founded an .dll that can disable the X button from the dialogs you can get
this dll and use this code in order to work. (of course cwnd.dll is much better)
dialog test {
size -1 -1 200 200
}
ON *:DIALOG:test:*:*: {
if ($devent == init) { dll hstylus.dll x_desabilitar $dialog($dname).hwnd }
}