Macro to hide all type of windows in an experiment

Hello, I am trying to make a macro to hide all type of windows. Following code works good except .ipf, ihf. Any idea why it fails for these two cases.

Macro HideAll()
Variable len,i=0
String list,wn
list=WinList("*", ";","") //fails due to .ipf, .ihf
do
    wn=StringFromList(i, list)
    len = strlen(wn)
    if (len >0)
        DoWindow/HIDE=1 $wn
    endif
    i=i+1
while(len)
End

I have also tried with "SetWindow" but failed. I did try without these extension, still did not work.

Thanks in advance for your interest and help.

Hi,

I think the issue is with DoWindow

In the DoWIndow /Hide=1 $wn work only for certain window types

From the help: windowName  is the name of a top-level graph, table, page layout, notebook, panel, Gizmo, camera, or XOP target window. windowName can not be a subwindow path.

It does not seem to apply to procedure or help windows.  Also when you close a procedure window other than main one manually you are prompted to select hide or kill.

For procedure windows use the HideProcedures
   The HideProcedures operation hides all the procedure windows without closing or killing them.

Andy