Notifications
Clear all

[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?

10 Replies

it’s “hide”… you can send a hide message to window’s parent or use setwindowpos

4 Replies
(@momo2012)
Joined: 11 months ago

Posts: 0

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 ??
      )
      
   )
)
(@momo2012)
Joined: 11 months ago

Posts: 0

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]
      )      
   )
)
(@denist)
Joined: 11 months ago

Posts: 0

UIAccessor.CloseDialog uses CloseWindow api method. Whether dialog will be destroyed or hidden depends on how it was created

(@denist)
Joined: 11 months ago

Posts: 0

I’ve just checked… the UIAccessor.CloseDialog closes dialog with destroy. It doesn’t hide it.

[b]showDialog [/b]<rollout> <boolean>
3 Replies
(@denist)
Joined: 11 months ago

Posts: 0

showdialog is a new method. maybe 2017+

(@serejah)
Joined: 11 months ago

Posts: 0

yep, I was mistaken that it was just not documented

(@polytools3d)
Joined: 11 months ago

Posts: 0

It’s been there at least since Max 2014.

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