home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 635.lha / hold_1.43b / misc.c < prev   
C/C++ Source or Header  |  1992-01-18  |  785b  |  35 lines

  1. /*
  2.  * misc.c - miscellaneous support functions for Hold
  3.  *
  4.  * Bruno Costa - 16 Sep 89 - 18 Jan 91
  5.  *
  6.  */
  7.  
  8. #include <exec/types.h>
  9. #include <devices/timer.h>
  10. #include <intuition/intuitionbase.h>
  11. #include <intuition/intuition.h>
  12. #include <proto/exec.h>
  13. #include <proto/intuition.h>
  14. #include <proto/layers.h>
  15. #include "hold.h"
  16.  
  17. extern struct Library *LayersBase;
  18. extern struct IntuitionBase *IntuitionBase;
  19.  
  20. /*
  21.  *  Should be called between a Forbid() + Permit() or
  22.  * LockIBase() + UnlockIBase() pair.
  23.  */
  24. struct Window *WhichWindow (void)
  25. {
  26.  struct Layer *layer;
  27.  struct Screen *scr;
  28.  
  29.  for (scr = IntuitionBase->FirstScreen; scr; scr = scr->NextScreen)
  30.    if (layer = WhichLayer (&scr->LayerInfo, scr->MouseX, scr->MouseY))
  31.      return (struct Window *)layer->Window;
  32.  
  33.  return (NULL);
  34. }
  35.