[Closed] Close a dialog/rollout without destroydialog?
Hi,
Is that possible to close an opened rollout/dialog without using destroydialog?Normally we can close a dialog with destroydialog function,but for some reason,I need to another way to close it,like this example:
rollout test_close "For a test"
(
label lb_01 "123"
)
createDialog test_close 400 150 style:#(#style_minimizebox)
--try(destroydialog test_close) catch() -- Any other way to close it?
it’s “hide”… you can send a hide message to window’s parent or use setwindowpos
Hi denis,thanks,I just trying use below codes to do it,but need more help
(
local children = windows.getChildrenHWND (windows.getDesktopHWND())
for child in children do
(
if (child[5] == "For a test") do
(
--windows.sendMessage ??
)
)
)
I found the solution myself:
(
local children = windows.getChildrenHWND (windows.getDesktopHWND())
for child in children do
(
if (child[5] == "For a test") do
(
UIAccessor.CloseDialog child[1]
)
)
)
UIAccessor.CloseDialog uses CloseWindow api method. Whether dialog will be destroyed or hidden depends on how it was created
I’ve just checked… the UIAccessor.CloseDialog closes dialog with destroy. It doesn’t hide it.
here is the way to show windows for early versions:
http://forums.cgsociety.org/showpost.php?p=7187365&postcount=11
a dialog (rollout) has its own hwnd property — <rollout>.hwnd