When placed in the Home Stack Script (it needs to always be in the inheritance path) somewhere in an "on idle" handler, it will automatically detect the fact that HyperCard is not the current application and hide all the visible windows. When you return to HyperCard, all the windows will reappear.
Be sure to add the container (variable) named resumeStackList to the global list at the beginning of the "on idle" handler.
on idle
global resumeStackList
.
.
.
if the suspended then
if resumeStackList is empty then
put the windows into rSL
repeat with z=1 to the number of lines in rSL
if the visible of window (line z of rSL) then
put line z of rSL & return after resumeStackList
hide window (line z of rSL)
end if
end repeat
end if
else
if resumeStackList is not empty then
repeat with z=1 to the number of lines in resumeStackList
show window (line z of resumeStackList)
end repeat
put empty into resumeStackList
end if
end if
pass idle
end idle
This article is adapted from the Claris Tech Info database.
Support Information Services