ScriptSpot

Forum topic · General Scripting

Check if the Listener Window is open

By 3dwannab · 2021-09-12

Description

I've tried with UIAccessor but couldn't find a way to check if the Listener Window was open or not. I want to check its status and if it's not open before the execution of the script then upon closing the script it will close it again. I can close the dialog fine with the code below but it's checking if it's open where the problem is.

UIAccessor.CloseDialog (windows.getchildhwnd 0 "MAXScript Listener")[1]
Comments (3)

.

3dwannab · 2021-09-14

Cool answer Swordslayer. Thanks a lot!

That

IsWindowVisible

will come in handy a lot along with many other things that this stuff is capable of.

.

jahman · 2021-09-14


user32 = (python.import "ctypes").windll.user32


no more c# libs compiled on the fly

Swordslayer · 2021-09-14

iGlobal = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
user32 = (python.import "ctypes").windll.user32
user32.IsWindowVisible iGlobal.TheListenerWindow != 0