Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
56 user(s) are online (49 user(s) are browsing Forums)

Members: 0
Guests: 56

more...
Support us!
Recent OS4 Files
OS4Depot.net





Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2188
Like the subject says, is there any way to stop DOS from opening "Please insert volume" requesters when calling file handling functions like fopen() and stat()? If something's not available, then I want it to simply fail.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5385
@Hans
Back in past on aos3.x i use that kind of code:

#include <stdio.h>
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <dos/dosextens.h>

main()
{

    
struct Process *proc;

    
proc=(struct Process *)FindTask(0);
    
proc->pr_WindowPtr=(APTR)-1;         // hide sys. reqs

    
Execute("dh4:",0,0);
    
printf("huynian");

    
//proc->pr_WindowPtr=(APTR)0;  // show sys.reqs
}


_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2188
@kas1e

Thanks. It's much easier to find documentation once you know how it's done (link).

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Joined:
2006/12/4 23:15
Posts: 2132
@Hans

For Amiga Os 4.x use

Quote:


NAME
SetProcWindow - Set the current process' DOS window pointer. (V50)

SYNOPSIS
APTR oldvalue = SetProcWindow( CONST_APTR newvalue );

FUNCTION
SetProcWindow() changes the current process' pr_WindowPtr to the
value specified by "newvalue".
This is the V50 supported method of setting up pr_WindowPtr in
your process structure, specifically to control where (and if)
DOS error requester windows appear.

A new process created by CreateNewProc() can set this value with
the tag: NP_WindowPtr.

There are three supported modes you can use here:-

(a) A value of NULL will cause all DOS error requester windows
for this process to appear on the Workbench or default
public screen.

(b) A value of (APTR)-1L will prevent all DOS error requester
windows from displaying. This mode will require you to
handle any unexpected errors yourself. ( see IoErr() ).

(c) A pointer to the open intuition window you wish requester
windows to be rendered upon. You will need to cast this
as an APTR.

For semantical reasons, you should restore its original value
before the nominated window is closed.

Do not use random values here, use only the specified values to
ensure future compatibility.

INPUTS
newvalue - NULL, (APTR)-1L, (APTR)windowpointer.

RESULT
oldvalue - The value previously set.

NOTES
This function is NOT callable from a task.

Before V50, you must always restore the previous value before
your process exits, as this could leave a hanging window pointer
that may be accessed after your program returned to DOS.
From V50, pr_WindowPtr will always be restored to the pre-launch
value by the InternalRunCommand() function when your program exits.

The system may not always obey your wishes to suppress or redirect
the requester windows. In some rare cases (catastrophic failure,
etc.) requester windows may still open on the Workbench or
default public screen.

SEE ALSO
Lock(), Open(), NameFromLock()



_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project