(Short program to illustrate getting the Pinboard to reopen windows follows. Note that this program is provided to demonstrate a specific point, rather than advocate any specific programming style.)
REM >PinOpener
:
message_iconize =&400CA :REM These are the correct Message values message_windowinfo =&400CC :REM that appear in the Risc OS 3 message_windowclosed=&400CB :REM PRM's.:
DIM bk% &100 :REM Scrap memory for Wimp, and building messages armed%=0 :REM Arming Sequence Counter shutdown%=FALSE :REM TRUE if task is shutting down:
CASE reason% OF
WHEN 0: :REM Null CASE armed% OF WHEN 20: :REM Arming Sequence, 10 seconds until broadcast bk%!0=24 :REM >24 are assumed to be from pinboard itself bk%!12=0 bk%!16=message_windowinfo bk%!20=0:bk%!24=0 SYS "Wimp_SendMessage",17,bk%,0:REM Send Message Block armed%+=1 VDU7
WHEN 30: :REM Kill ourselves after 20 seconds shutdown%=TRUE armed%+=1 VDU7
OTHERWISE armed%+=1 :REM Increase Arming Sequence ENDCASE
WHEN 17: :REM User_Message IF bk%!&10=0 THEN :REM Received a Message_CloseDown shutdown%=TRUE :REM Yes, shutdown flags set ENDIF
ENDCASE
UNTIL shutdown% :REM Have we been asked to shutdown?:
SYS "Wimp_CloseDown" :REM Closedown this task.END