Esempio n. 1
1
        static WorldGenerator()
        {
            squaresHitboxesList = new List<Hitbox>();
            squaresHitboxesPool = new ObjectPool<Hitbox>(CreateSquareHitbox, RecycleSquareHitbox, RABBIT_BOX_POOL_SIZE);

            getVisiblesWindowsAsSquaresHitboxes = new EnumWindowsProc(GetVisiblesWindowsAsSquaresHitboxes_EnumWindowsProc);
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     Enumerator en = new Enumerator();
     EnumWindowsProc ewc = new EnumWindowsProc(en.VisitWindow);
     WindowsAPIWrapper.EnumWindows(ewc, (IntPtr)0);
     Console.ReadKey();
 }
Esempio n. 3
0
 /// <summary>
 /// Функция находит дочернее окно в данной точке.
 /// </summary>
 /// <param name="pt">Точка в абсолютных координатах</param>
 /// <returns>Возвращает дескриптор окна</returns>
 public IntPtr FindWindowAtPos(System.Drawing.Point pt)
 {
     FindedHandle = IntPtr.Zero;
       POINT APIpt = new POINT();
       APIpt.X = pt.X;
       APIpt.Y = pt.Y;
       GCHandle GCPoint = GCHandle.Alloc(APIpt);
       EnumWindowsProc cbFinder = new EnumWindowsProc(FindNextLevelWindowAtPos);
       EnumChildWindows(ParentHandle,FindNextLevelWindowAtPos, GCHandle.ToIntPtr(GCPoint));
       return FindedHandle;
 }
Esempio n. 4
0
        public bool EnumWindows(System.Object ReturnObject)
        {
            System.Runtime.InteropServices.GCHandle gch = System.Runtime.InteropServices.GCHandle.Alloc(new CarverLabUtility.Win32Wrapper.InternalCallbackParams(this,ReturnObject));
            EnumWindowsProc cewp = new EnumWindowsProc(CaptureEnumWindowsProc);

            // Platform invoke prevents the delegate from being garbage
            // collected before the call ends.
            bool bReturn = Win32Wrapper.EnumWindows(cewp, (IntPtr)gch);
            gch.Free();
            return bReturn;
        }
Esempio n. 5
0
File: Z.cs Progetto: 9001/Loopstream
 public static int[] Run()
 {
     if (blocker) return new int[0];
     blocker = true;
     if (list != null) list.Clear();
     else list = new List<int>();
     EnumWindowsProc enumWindowsProc = new EnumWindowsProc(EnumHandles.Hadd);
     EnumWindows(enumWindowsProc, IntPtr.Zero);
     int[] ret = list.ToArray();
     list.Clear();
     blocker = false;
     return ret;
 }
Esempio n. 6
0
 /// <summary>
 /// Returns a list of child windows
 /// </summary>
 /// <param name="parent">Parent of the windows to return</param>
 /// <returns>List of child windows</returns>
 public static List<IntPtr> GetWindows()
 {
     List<IntPtr> result = new List<IntPtr>();
     GCHandle listHandle = GCHandle.Alloc(result);
     try
     {
         EnumWindowsProc childProc = new EnumWindowsProc(EnumWindow);
         EnumWindows(childProc, GCHandle.ToIntPtr(listHandle));
     }
     finally
     {
         if (listHandle.IsAllocated)
             listHandle.Free();
     }
     return result;
 }
Esempio n. 7
0
 public IntPtr GetFlashObjectHandle(WebBrowser webBrowser)
 {
     List<IntPtr> result = new List<IntPtr>();
     GCHandle listHandle = GCHandle.Alloc(result);
     EnumWindowsProc childProc = new EnumWindowsProc(EnumWindow);
     EnumChildWindows(webBrowser.Handle, childProc, GCHandle.ToIntPtr(listHandle));
     foreach (IntPtr ptr in result)
     {
         //only one of the handles will be correct and its class name will be "Internet Explorer_Server"
         //all other handles will ignore input or at least not forward it to the game
         if (IsIEServerWindow(ptr))
         {
             return ptr;
         }
     }
     return IntPtr.Zero;
 }
Esempio n. 8
0
        /// <summary> Find all windows that match the given filter </summary>
        /// <param name="filter"> A delegate that returns true for windows
        ///    that should be returned and false for windows that should
        ///    not be returned </param>
        public static IEnumerable<IntPtr> FindWindows(EnumWindowsProc filter)
        {
            IntPtr found = IntPtr.Zero;
            List<IntPtr> windows = new List<IntPtr>();

            Extern.EnumWindows(delegate(IntPtr wnd, IntPtr param)
            {
                if (filter(wnd, param))
                {
                    // only add the windows that pass the filter
                    windows.Add(wnd);
                }

                // but return true here so that we iterate all windows
                return true;
            }, IntPtr.Zero);

            return windows;
        }
Esempio n. 9
0
 static extern bool EnumChildWindows(
     IntPtr window, EnumWindowsProc callback, int i);
Esempio n. 10
0
 private static extern int EnumWindows(EnumWindowsProc x, int y);
Esempio n. 11
0
 internal static extern bool EnumChildWindows(IntPtr hWnd, EnumWindowsProc callback, IntPtr i);
Esempio n. 12
0
 public static extern bool EnumChildWindows(IntPtr hWndParent, EnumWindowsProc enumProc, IntPtr lParam);
Esempio n. 13
0
File: WinAPI.cs Progetto: antgraf/BA
 internal static extern bool EnumWindows(EnumWindowsProc callback, IntPtr extraData);
 private static extern bool EnumChildWindows(IntPtr hWndStart, EnumWindowsProc callback, IntPtr lParam);
Esempio n. 15
0
 private static extern bool EnumWindows(EnumWindowsProc callback, IntPtr extraData);
Esempio n. 16
0
 static extern bool EnumWindows(EnumWindowsProc callback, int i);
Esempio n. 17
0
 private static extern bool EnumChildWindows(IntPtr hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 18
0
 private static extern bool EnumThreadWindows(uint dwThreadId, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 19
0
 static extern bool EnumWindows(EnumWindowsProc proc, IntPtr lParam);
Esempio n. 20
0
 static extern bool EnumWindows(EnumWindowsProc callback, int i);
Esempio n. 21
0
 static extern bool EnumThreadWindows(
     int threadId, EnumWindowsProc callback, int i);
Esempio n. 22
0
 public static extern int EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
 protected static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
Esempio n. 24
0
 static extern bool EnumChildWindows(
     IntPtr window, EnumWindowsProc callback, int i);
Esempio n. 25
0
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref SearchData data);
Esempio n. 26
0
 internal static extern int EnumWindows(EnumWindowsProc ewp, int lParam);
 public extern static int EnumWindows(
     EnumWindowsProc lpEnumFunc,
     int lParam);
Esempio n. 28
0
 public static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumWindowsProc lpfn, IntPtr lParam);
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref string windowMark);
Esempio n. 30
0
 private static extern int EnumWindows(EnumWindowsProc x, int y);
Esempio n. 31
0
 private static extern int EnumWindows(
   EnumWindowsProc ewp,
   IntPtr lParam);
 internal static extern bool EnumWindows(EnumWindowsProc numFunc, IntPtr lParam);
Esempio n. 33
0
 public WindowFinder()
 {
     ewp = new EnumWindowsProc(EnumWindowFunction);
 }
Esempio n. 34
0
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref string windowMark);
 public extern static int EnumChildWindows(
     IntPtr hWndParent,
     EnumWindowsProc lpEnumFunc,
     int lParam);
Esempio n. 36
0
        static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc
			lpEnumFunc, IntPtr lParam);
Esempio n. 37
0
 public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, uint lParam);
Esempio n. 38
0
 public static extern bool EnumThreadWindows(uint dwThreadId, EnumWindowsProc lpfn, IntPtr lParam);
 private static extern int EnumWindows(EnumWindowsProc ewp, int lParam);
Esempio n. 40
0
 protected static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
 public static bool EnumWindows(EnumWindowsProc filter)
 {
     return(EnumWindows(filter, IntPtr.Zero));
 }
Esempio n. 42
0
 /// <summary>
 /// Enumerates all windows by calling the supplied delegate for each window.
 /// </summary>
 /// <param name="ewp">Delegate to call for each window.</param>
 /// <param name="lParam">Used to identify this enumeration session.</param>
 /// <returns>Number of windows.</returns>
 public static int EnumerateWindows(EnumWindowsProc ewp, IntPtr lParam)
 {
   return EnumWindows(ewp, lParam);
 }
Esempio n. 43
0
 public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref SearchData data);
 private static extern bool EnumWindows(EnumWindowsProc enumFunc, int callbackVal);
Esempio n. 45
0
 private static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);
Esempio n. 46
0
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 47
0
 public static extern bool EnumThreadWindows(uint dwThreadId, EnumWindowsProc lpfn, IntPtr lParam);
Esempio n. 48
0
 static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);
Esempio n. 49
0
 public static extern bool EnumChildWindows(IntPtr parentHandle, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 50
0
 static extern bool EnumThreadWindows(
     int threadId, EnumWindowsProc callback, int i);
Esempio n. 51
0
 private static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
Esempio n. 52
0
 public static extern int EnumWindows(EnumWindowsProc ewp, int lParam);
Esempio n. 53
0
 public static extern int EnumWindows(EnumWindowsProc lpfn, int lParam);
Esempio n. 54
0
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, int dummy);
Esempio n. 55
0
 public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 57
0
 public static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Esempio n. 58
0
 public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, uint lParam);
Esempio n. 59
0
 internal static extern bool EnumThreadWindows(int threadId, EnumWindowsProc callback, IntPtr lParam);