🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #566

Re: Noticing when Shutdown is activated

#566
From: Tom Hughes
Date: Fri, 20 Nov 1992 09:25
50 lines
3154 bytes
In article <1992Nov20.020639.10146@infodev.cam.ac.uk> crj10@phx.cam.ac.uk (Clive Jones) writes:
>In article <BxytAB.8KB@newcastle.ac.uk>, unregistered@newcastle.ac.uk (Jason O'Broin) writes:
>> In addition to this, I need to be able to distinguish between this and Exiting
>> the desktop (ie. closing down the desktop is not the same as starting the
>> shutdown procedure). Does anyone know the actual operations performed by
>> shutdown. Ideally, I'd like to replace it completely.
>
>I believe the mechanism is almost identical between RiscOS3.1 and previous
>versions, in terms of its external interface. The difference between the
>shutdown dbox and merely leaving the desktop is slight.
>
>Basically, all tasks are first sent a PreQuit message (number 8). If none of
>them respond, they're all sent Quit (0) messages. So - the former should be
>handled if you want the opportunity to object to the shutdown, or the latter
>can be handled if you just want to do something.
>
>Under RiscOS3, the PreQuit message *may* have a flag word at address 20 in
>the message block (if the block is large enough). The bottom bit of this is set
>if it's your application being quit, or clear if a shutdown is happening.

Right. I looked this up in the RiscOS 3 PRMs last night, and whilst
the above info is correct, there are some new calls.

Firstly, there is a new messagem, Message_Shutdown (message 14) which
I think is only issued on the portable when an enforced shutdown
occurs (due to battery failure). I suspect this replaces the
Message_PreQuit/Quit sequence, as applciations should try to save and
exit gracefully when they receive it (accoring to the manuals).

Secondly, there are two service calls. These are Service_Shutdown
(&7E) which is issued before a shutdown, and may be claimed to block
the shutdown, and Service_ShutdownComplete (&80) which is issued after
a shutdown is completed.

One other clever (?) way of replacing the shutdown sequence that I
thought of is to install a post-filter on the task manager, watch for
Shutdown/Exit being selected from the menu of ctrl-shift-F12 being
pressed, and then mask these out from the task manager and do your own
thing. This is however truly sick.

Tom.

============================================================================
Tom Hughes, CS3

thughes@uk.ac.warwick.dcs            57 Shakleton Road
csugk@uk.ac.warwick.csv              Earlsdon
                                     Coventry
(0203) 673584                        CV5 6HT
============================================================================
Technical Details
Message-ID: <1992Nov20.092549.4209@dcs.warwick.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!dcs.warwick.ac.uk!thughes
References: <BxytAB.8KB@newcastle.ac.uk> <1992Nov20.020639.10146@infodev.cam.ac.uk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.acorn.tech
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!dcs.warwick.ac.uk!thughes
From: thughes@dcs.warwick.ac.uk (Tom Hughes)
Subject: Re: Noticing when Shutdown is activated
Message-ID: <1992Nov20.092549.4209@dcs.warwick.ac.uk>
Sender: news@dcs.warwick.ac.uk (Network News)
Nntp-Posting-Host: stone
Organization: Department of Computer Science, Warwick University, England
References: <BxytAB.8KB@newcastle.ac.uk> <1992Nov20.020639.10146@infodev.cam.ac.uk>
Date: Fri, 20 Nov 1992 09:25:49 GMT
Lines: 50