I ran across this while building a set of child windows for %ps. I had intended to use the handle for the %sh that builds the 'tab' to enable or disable the tab using its handle. But, the handles don't seem to be valid.
Specifically, the handles returned when building the %sh is -1, as well as after the %ps has been built and the tabs active.
The code that shows this is:
winapp
program cmain
use mswin
integer:: i,j=2,k=10,l=30
integer,external:: button1
integer:: ps(3)
common/sheet_test/ps
i = winio@('%sh&',ps(1))
i = winio@('%ca[First]%rd',j)
i = winio@('%sh&',ps(2))
i = winio@('%ca[Second]%rd',k)
i = winio@('%sh&',ps(3))
i = winio@('%ca[Third]%rd',l)
print *,ps
i = winio@('%3ps&',ps(1),ps(2),ps(3))
i = winio@('%^bt[print_handles]',button1)
end
INTEGER(KIND=7) FUNCTION BUTTON1()
integer:: ps(3)
common/sheet_test/ps
BUTTON1= -1
print *,'Button_press=',ps
RETURN
END
This prints the handles assigned to the array element (named ps) before the parent window is created, and after the button press. I would have expected that at least the button press would show window handles. Alas, still -1.
My (perhaps faulty) remembrance is that after the %sh has closed the building of the child window, the control associated with the %sh then contains a handle.