home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / WMFIND.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  525 b   |  24 lines

  1. /* wmfind.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <stdlib.h>
  4. #include <sys/winmgr.h>
  5. #include "winmgr2.h"
  6.  
  7. wm_handle wm_find (int x, int y)
  8. {
  9.   int i;
  10.   wm_handle wh;
  11.  
  12.   for (i = 0; i < _wm_count; ++i)
  13.     {
  14.       wh = _wm_idx[i];
  15.       if (wh->open && x >= wh->bx0 && y >= wh->by0
  16.           && x <= wh->bx1 && y <= wh->by1)
  17.         if (wh->visible)
  18.           return (wh);
  19.         else if (MASK (wh, x-wh->bx0, y-wh->by0))
  20.           return (wh);
  21.     }
  22.   return (NULL);
  23. }
  24.