[comp.sys.amiga] Change a window's task's priority

a275@mindlink.UUCP (Travers Naran) (05/24/90)

Have you ever wanted to have a task's window priority changed when you activate
it? In other words, say you have a back ground task with a window and when that
window is activated, the task's priority jumps. With out modifying the task?
Well, here is an answer I found.
and it
is following Commodore Amiga's Guidelines!
    First off, I had to remember something I read in the ROM Kernal
Manuals: When the WorkBench screen is going to be closed, all tasks with
windows in that screen are alerted to close the window and "die". Well, I
looked at the Window structure and found this:

    struct MsgPort *UserPort, *WindowPort;

    Now, A MsgPort structure looks like this:

    struct MsgPort {
        struct  Node mp_Node;
        UBYTE   mp_Flags;
        UBYTE   mp_SigBit;              /* signal bit number    */
        struct  Task *mp_SigTask;       /* task to be signalled */
        struct  List mp_MsgList;        /* message linked list  */
    };

    Notice, mp_SigTask is the task to signal when a message from
Intuition arrives. This variable is initially set to point at the task
which opened the window. Ah-hah! :-)


So, if the window uses IDCMP, you can change a window's priority, so to
speak.:-)
--
-------------------------------------------------------------------
Travers "T'aran" Naran (I am male)
Simon Fraser University, Computing Science
Whovian, Prober, Treker, Quantum Leaper....
Mailing addresses:
   Usenet  Travers_Naran@mindlink.UUCP
or      uunet!van-bc!rsoft!mindlink!Travers_Naran
------------------------------------------------------------------