Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
137 user(s) are online (123 user(s) are browsing Forums)

Members: 2
Guests: 135

thellier, NinjaCyborg, more...

Support us!

Headlines

 
  Register To Post  

Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Home away from home


See User information
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

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Home away from home


See User information
@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("huynia\n");

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


Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Home away from home


See User information
@kas1e

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

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Any way to suppress DOS "Please insert volume" requesters from code?
Home away from home
Home away from home


See User information
@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()



Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project