Page 2 of 2

Re: Con-handler window option

Posted: Mon Sep 06, 2021 8:01 pm
by gdridi
thomasrapp wrote: Fri Aug 27, 2021 6:03 pm You are right, it does not work on OS4.

The following code works on OS3. On OS4 apparently the WINDOW part is completely ignored and it opens a new window on the Workbench screen.

Code: Select all

/* Open a shell on a custom screen */


#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>

#include <stdio.h>


int main (void)

{
struct Screen *scr;

if ((scr = OpenScreenTags (NULL,
		SA_LikeWorkbench,TRUE,
		TAG_END)))
	{
	struct Window *win;

	if ((win = OpenWindowTags (NULL,
			WA_CustomScreen,scr,
			WA_Flags, WFLG_ACTIVATE | WFLG_BORDERLESS | WFLG_NOCAREREFRESH,
			TAG_END)))
		{
		char conname[50];
		BPTR con;

		sprintf (conname,"CON://///WINDOW %lx",win);

		if ((con = Open (conname,MODE_READWRITE)))
			{
			Execute ("",con,(BPTR)0);
			Close (con);
			}

		if (scr->FirstWindow == win)
			CloseWindow (win);
		}

	CloseScreen (scr);
	}

return (RETURN_OK);
}
Is there an OS4.1FE manner to do this with SystemTags, because Execute() DOS call is deprecated…

Thank you
DGILLES

Re: Con-handler window option

Posted: Thu Sep 09, 2021 9:27 pm
by polluks

Re: Con-handler window option

Posted: Fri Sep 10, 2021 6:51 pm
by gdridi
Hello,
polluks wrote: Thu Sep 09, 2021 9:27 pm SystemTagList()
https://wiki.amigaos.net/amiga/autodocs/dos.doc.txt
Example of running a custom shell in a screen, window for OS4.1(FE) welcomes ?

Can find a custom shell source program in the RKMs litterature ?

Thomasrapp example page 1 of this thread, uses Execute("", bptr, bptr) but it is deprecated.

Sincerely

DGILLES

Re: Con-handler window option

Posted: Sat Sep 11, 2021 12:46 am
by colinw
As Polluks indicated above.
The SystemTags() call is what you are after, to do what the old Execute() function is doing.
See the SYS_ExecuteInputStream and SYS_Input tags.

Re: Con-handler window option

Posted: Sat Sep 11, 2021 5:28 pm
by gdridi
Thank a lot
colinw wrote: Sat Sep 11, 2021 12:46 am As Polluks indicated above.
The SystemTags() call is what you are after, to do what the old Execute() function is doing.
See the SYS_ExecuteInputStream and SYS_Input tags.
This is new to me v53.45

It answers my questions and I think furthermore that I must provide a console descriptor for the input file handle (SYS_Input).

BEST REGARDS,
DGILLES