home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 465.lha / ParM_v2.5r / End.c < prev    next >
C/C++ Source or Header  |  1991-01-05  |  1KB  |  45 lines

  1. /*
  2.  *    End.c - Copyright © 1990 by Devil's child.
  3.  *
  4.  *    Created:    08 Oct 1990  20:51:16
  5.  *    Modified:    09 Nov 1990  17:36:30
  6.  *
  7.  *    Make>> cc -qf -ps -m0b -wp -wd -wu -so -hi ram:ParM.syms <file>.c
  8.  *    Make>> ln <file>.o
  9.  *    Make>> Protect <file> +p
  10.  */
  11.  
  12.  
  13. void main(void)
  14. {
  15.     struct ExecBase *SysBase = *((struct ExecBase **)4L);
  16.     struct ArpBase *ArpBase;
  17.     struct Process *MyProcess;
  18.     struct InfoData *infodata;
  19.     long args[8];
  20.     struct Window *W;
  21.     struct MsgPort *ReplyPort;
  22.     struct IntuiMessage Msg;
  23.  
  24.     if (!(ArpBase = (struct ArpBase *)OpenLibrary("arp.library", 39L))) return;
  25.  
  26.     MyProcess = (struct Process *)SysBase->ThisTask;
  27.     infodata = ArpAlloc(sizeof(struct InfoData));
  28.     args[0] = (long)infodata >> 2;
  29.     SendPacket(ACTION_DISK_INFO, args, (struct MsgPort *)MyProcess->pr_ConsoleTask);
  30.     W = (struct Window *)infodata->id_VolumeNode;
  31.     if ( (W->IDCMPFlags & MENUPICK) && (ReplyPort = CreatePort(NULL, NULL)) ) {
  32.         Msg.Class = CLOSEWINDOW;
  33.         Msg.ExecMessage.mn_Node.ln_Type = NT_MESSAGE;
  34.         Msg.ExecMessage.mn_Length = sizeof( struct IntuiMessage );
  35.         Msg.ExecMessage.mn_ReplyPort = ReplyPort;      
  36.         PutMsg(W->UserPort, (struct Message *)&Msg);
  37.         WaitPort(ReplyPort);
  38.         GetMsg(ReplyPort);
  39.         DeletePort(ReplyPort);
  40.     }
  41.     SyncRun("EndCLI", NULL, NULL, NULL);
  42.     CloseLibrary(ArpBase);
  43. }
  44.  
  45.