home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1997 #3 / amigamamagazinepolishissue03-1 / ma_1995 / 08 / ami031a.txt < prev    next >
Text File  |  1997-04-07  |  1KB  |  91 lines

  1. /* Listing #6 */
  2.  
  3.  
  4.  
  5. #include <intuition/intuition.h>
  6.  
  7.  
  8.  
  9. #include <proto/dos.h>
  10.  
  11. #include <proto/exec.h>
  12.  
  13. #include <proto/intuition.h>
  14.  
  15.  
  16.  
  17. #include <stdio.h>
  18.  
  19.  
  20.  
  21. struct IntuitionBase *IntuitionBase;
  22.  
  23.  
  24.  
  25. char *pubscrname=0;
  26.  
  27. struct Screen *pubscreen;
  28.  
  29. struct Window *okno;
  30.  
  31.  
  32.  
  33. int main(int argc, char *argv[])
  34.  
  35. {
  36.  
  37.     check_os(OS_20);
  38.  
  39.     if (!(IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 37)))
  40.  
  41.         return 20;
  42.  
  43.     if (argc>1)
  44.  
  45.         pubscrname=argv[1];
  46.  
  47.     if (pubscreen=LockPubScreen(pubscrname))
  48.  
  49.     {
  50.  
  51.         if (okno=OpenWindowTags(0,
  52.  
  53.         WA_Top, pubscreen->BarHeight+1,
  54.  
  55.         WA_Height, pubscreen->Height-pubscreen->BarHeight-1,
  56.  
  57.         WA_Title, "Okienko",
  58.  
  59.         WA_Flags, WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_ACTIVATE,
  60.  
  61.         WA_PubScreen, pubscreen,
  62.  
  63.         TAG_DONE))
  64.  
  65.         {
  66.  
  67.             Delay(200);
  68.  
  69.             CloseWindow(okno);
  70.  
  71.         }
  72.  
  73.         else
  74.  
  75.             printf("Nie mogë otworzyê okna!\n");
  76.  
  77.         UnlockPubScreen(0, pubscreen);
  78.  
  79.     }
  80.  
  81.     else
  82.  
  83.         printf("Ekran publiczny \"%s\" nie istnieje!\n", pubscrname);
  84.  
  85.     CloseLibrary((struct Library*)IntuitionBase);
  86.  
  87.     return 0;
  88.  
  89. }
  90.  
  91.