home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Computing 57
/
ac057a.adf
/
Demos
/
SysRequestors.bas
< prev
next >
Wrap
BASIC Source File
|
1989-07-04
|
1KB
|
39 lines
' An example showing how to keep system requestors in
' your own screen.
' A system requestor is something like 'Please insert volume xx'
' or 'Volume xx is write procected' etc.
' They normally appear in the Workbench screen but this can be
' a nuisance if your program is using its own screen and the user
' can get very confused when the program (s)he is using disappears.
' This works by attaching the requestors to a particular window
LIBRARY "exec"
DECLARE FUNCTION FindTask&(who&) LIBRARY
SCREEN 1,640,200,2,2
WINDOW 1,"Test Window",(10,100)-(500,150),,1
' attach now
SetSysReq WINDOW(7)
' cause one to appear
PRINT "Causing an error now - select Cancel"
junk%=FEXISTS("Impossible:junk")
' it is important that the system requesters are detached from
' a window before it is closed
SetSysReq 0
WINDOW CLOSE 1
SCREEN CLOSE 1
' pass this either WINDOW(7) to use the current window,
' or 0=Workbench screen, or -1=don't put them anywhere
SUB SetSysReq(VAL w&)
LOCAL me&
me&=FindTask&(0)
POKEL me&+184,w&
END SUB