Con-handler window option

Have a question about our Software Developer Kit? Ask them here.
User avatar
gdridi
Posts: 42
Joined: Sat Aug 11, 2012 10:17 am

Re: Con-handler window option

Post by gdridi »

thomasrapp wrote: Fri Aug 27, 2021 5: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
User avatar
polluks
Posts: 43
Joined: Tue May 19, 2015 6:30 pm
Location: Germany
Contact:

Re: Con-handler window option

Post by polluks »

Last edited by polluks on Tue Sep 14, 2021 5:08 pm, edited 1 time in total.
User avatar
gdridi
Posts: 42
Joined: Sat Aug 11, 2012 10:17 am

Re: Con-handler window option

Post by gdridi »

Hello,
polluks wrote: Thu Sep 09, 2021 8: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
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 199
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: Con-handler window option

Post 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.
User avatar
gdridi
Posts: 42
Joined: Sat Aug 11, 2012 10:17 am

Re: Con-handler window option

Post by gdridi »

Thank a lot
colinw wrote: Fri Sep 10, 2021 11:46 pm 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
Post Reply