[comp.sys.amiga.programmer] Opening a window on Front Screen

taak9@isuvax.iastate.edu (Steve Sheldon) (06/10/91)

 I want to modify a program to open it's window on another tasks screen.
Sort of like the way ClockDJ does it's pop to front, only it just
needs to go there to begin with.
 I've seen this done with other programs.  I am assuming that all I need
is a pointer to the screen I want to open on.  But I just haven't seem to
found how to do this.

 Can anybody tell me how to do this, or perhaps point me in the direction
of some source code for a program that has done this?

Responses to e-mail.
Thanks!

Steve Sheldon               /// | Ne auderis delere orbem rigidum meum!
taak9@ccvax.iastate.edu    ///  | 
Senior, Computer Science \XX/   | Non erravi perniciose!

booth@ccad.uiowa.edu (Michael Booth) (06/11/91)

From article <1991Jun9.175112.4115@news.iastate.edu>, by taak9@isuvax.iastate.edu (Steve Sheldon):
> 
>  I want to modify a program to open it's window on another tasks screen.
> Sort of like the way ClockDJ does it's pop to front, only it just
> needs to go there to begin with.
>  I've seen this done with other programs.  I am assuming that all I need
> is a pointer to the screen I want to open on.  But I just haven't seem to
> found how to do this.
> 
>  Can anybody tell me how to do this, or perhaps point me in the direction
> of some source code for a program that has done this?
> 
> Responses to e-mail.
> Thanks!
> 
> Steve Sheldon               /// | Ne auderis delere orbem rigidum meum!
> taak9@ccvax.iastate.edu    ///  | 
> Senior, Computer Science \XX/   | Non erravi perniciose!

Steve,

	After you open the IntuitionLibrary, use the IntuitionBase pointer
and access IntuitionBase->ActiveScreen.

	This is a pointer to the currently active screen the user is on, and
by other pointer manipulations you can get whatever other data you need.

	For more info, look in the header files, or mail to me.

	Michael S. Booth
	booth@ccad.uiowa.edu

ken@cbmvax.commodore.com (Ken Farinsky - CATS) (06/11/91)

In article <1991Jun11.004504.11094@ccad.uiowa.edu> booth@ccad.uiowa.edu (Michael Booth) writes:
>From article <1991Jun9.175112.4115@news.iastate.edu>, by taak9@isuvax.iastate.edu (Steve Sheldon):
>> 
>>  I want to modify a program to open it's window on another tasks screen.
>> Steve Sheldon >> taak9@ccvax.iastate.edu    ///  | 
>
>	After you open the IntuitionLibrary, use the IntuitionBase pointer
>and access IntuitionBase->ActiveScreen.
>
>	Michael S. Booth > booth@ccad.uiowa.edu

Note that opening a window on someone else's screen without proper locking
is dangerous.  What if the screen is closed by the time you open your window?
What if the screen closes while the window is open?

If you want to use public screens, wait for 2.0 where it is properly
supported.  Then you will have to use calls such as LockPubScreen()
to gain access to another screen.
-- 
Ken Farinsky - CATS - Commodore Business Machines