Have a question about our Software Developer Kit? Ask them here.
gdridi
Posts: 64 Joined: Sat Aug 11, 2012 10:17 am
Post
by gdridi » Mon Sep 06, 2021 7:01 pm
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
polluks
Posts: 55 Joined: Tue May 19, 2015 6:30 pm
Location: Germany
Contact:
Post
by polluks » Thu Sep 09, 2021 8:27 pm
Last edited by
polluks on Tue Sep 14, 2021 5:08 pm, edited 1 time in total.
gdridi
Posts: 64 Joined: Sat Aug 11, 2012 10:17 am
Post
by gdridi » Fri Sep 10, 2021 5:51 pm
Hello,
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
colinw
AmigaOS Core Developer
Posts: 207 Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.
Post
by colinw » 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.
gdridi
Posts: 64 Joined: Sat Aug 11, 2012 10:17 am
Post
by gdridi » Sat Sep 11, 2021 4:28 pm
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