Window option followed by address : how it works ?

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Window option followed by address : how it works ?

Post by gdridi »

Hello,

Hope you the best.

Can someone try to open a console in an already opened window ?

This is documented in SDK autodocs con-handler file entry.

I m doing :
Newshell WINDOW "CON://///WINDOW 0x502c34ab"

The hex at the end is the address of an (another) already open window.

Is this correct ? I try under AOSFEu0 without success.

Best regards,
DGILLES
Steady
Posts: 25
Joined: Tue Aug 30, 2011 3:23 am
Location: Melbourne, Australia
Contact:

Re: Window option followed by address : how it works ?

Post by Steady »

I think the documentation is a little bit confusing there.

The "WINDOW" argument is actually referring to the "CON:////" argument. There is no argument that actually SAYS window. There is a SCREEN argument that takes a screen address, though.
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Window option followed by address : how it works ?

Post by gdridi »

Steady wrote: Thu Aug 26, 2021 6:39 am I think the documentation is a little bit confusing there.

The "WINDOW" argument is actually referring to the "CON:////" argument. There is no argument that actually SAYS window. There is a SCREEN argument that takes a screen address, though.
The documentation (in the SDK for con-handler) is clear.

I try and try without success…

Can someone try this feature ?

Regards
DGILLES
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Window option followed by address : how it works ?

Post by gdridi »

Some tools:

Twin.c:

Code: Select all

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

struct Library		*SysBase;   /*	EXEC library base			*/
struct ExecIFace	*IExec;

struct Library		*GraphicsBase;
struct GraphicsIFace	*IGraphics;

int main() {
	SysBase = *(struct Library **)4;
	IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface;

	GraphicsBase = IExec->OpenLibrary("graphics.library", 0L);
	IGraphics = (struct GraphicsIFace *)
		IExec->GetInterface(GraphicsBase, "main", 1, NULL);
	struct Window * win = (struct Window *)0x5c05c170;
	IGraphics->Move(win->RPort, 100, 100);
	IGraphics->Text(win->RPort, "ABC", 3);
}
- - - - - -

Mwin.c:

Code: Select all

#include <stdio.h>

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

struct Library		*SysBase;   /*	EXEC library base			*/
struct ExecIFace	*IExec;

struct Library		*GraphicsBase;
struct GraphicsIFace	*IGraphics;

struct Library		*IntuitionBase;
struct IntuitionIFace	*IIntuition;

int main() {
	SysBase = *(struct Library **)4;
	IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface;
struct Window * win = NULL;

	GraphicsBase = IExec->OpenLibrary("graphics.library", 0L);
	IGraphics = (struct GraphicsIFace *)
		IExec->GetInterface(GraphicsBase, "main", 1, NULL);

	IntuitionBase = IExec->OpenLibrary("intuition.library", 0L);
	IIntuition = (struct IntuitionIFace *)
		IExec->GetInterface(IntuitionBase, "main", 1, NULL);

 win = IIntuition->OpenWindowTags(NULL, 
//    WA_PubScreen, my_screen,
//    WA_RMBTrap, TRUE,
//	WA_NoCareRefresh, TRUE, Mettre SMART_REFRESH avec pour éviter un bug avec la < 40.1
	WA_Flags, /*WFLG_BACKDROP|WFLG_BORDERLESS|*/WFLG_ACTIVATE,	// virer borderless pour regler la position de la fenetre
//	WA_IDCMP, IDCMP_VANILLAKEY|IDCMP_RAWKEY,
	WA_Top,	100,
//	WA_Left, 0,
	WA_Height, 200,
//	WA_Width, 3 * my_tf->tf_XSize,
//	WA_Width, 19 * my_tf->tf_XSize,
    //WA_CustomScreen, my_screen,
    TAG_END);
	

	printf("%lx\n", (long)win);
//	struct Window * win = (struct Window *)0x5c05c170;
//	IGraphics->Move(win->RPort, 100, 100);
//	IGraphics->Text(win->RPort, "ABC", 3);
}
- - -
Regards
DGILLES
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Window option followed by address : how it works ?

Post by tonyw »

I answered your question in viewtopic.php?f=27&t=4718
cheers
tony
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Window option followed by address : how it works ?

Post by gdridi »

Hello,

Solution at viewtopic.php?f=27&t=4718

DGILLES
Post Reply