var bx = scene.getBoxById("myBox"); if (bx) { var wnd = bx.windowHandle; Foo(wnd); // custom processing would go here. }