当前位置: 首页>>代码示例>>C#>>正文


C# EnumWindowsProc类代码示例

本文整理汇总了C#中EnumWindowsProc的典型用法代码示例。如果您正苦于以下问题:C# EnumWindowsProc类的具体用法?C# EnumWindowsProc怎么用?C# EnumWindowsProc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EnumWindowsProc类属于命名空间,在下文中一共展示了EnumWindowsProc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 static void Main(string[] args)
 {
     Enumerator en = new Enumerator();
     EnumWindowsProc ewc = new EnumWindowsProc(en.VisitWindow);
     WindowsAPIWrapper.EnumWindows(ewc, (IntPtr)0);
     Console.ReadKey();
 }
开发者ID:BigBearGCU,项目名称:FNDEV-Week7-Interop,代码行数:7,代码来源:Program.cs

示例2: WorldGenerator

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

            getVisiblesWindowsAsSquaresHitboxes = new EnumWindowsProc(GetVisiblesWindowsAsSquaresHitboxes_EnumWindowsProc);
        }
开发者ID:kagmole,项目名称:GrumpyRabbit,代码行数:7,代码来源:WorldGenerator.cs

示例3: FindWindowAtPos

 /// <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;
 }
开发者ID:alexryassky,项目名称:actionlogger,代码行数:16,代码来源:cEnumerator.cs

示例4: EnumWindows

        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;
        }
开发者ID:CarverLab,项目名称:Oyster,代码行数:11,代码来源:Win32Wrapper.cs

示例5: Run

 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;
 }
开发者ID:9001,项目名称:Loopstream,代码行数:13,代码来源:Z.cs

示例6: GetWindows

 /// <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;
 }
开发者ID:AlexanderGurinov,项目名称:Config1COk,代码行数:21,代码来源:Analyzer1C.cs

示例7: GetFlashObjectHandle

 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;
 }
开发者ID:doskir,项目名称:BejeweledBlitzBot,代码行数:17,代码来源:GameInterfacer.cs

示例8: FindWindows

        /// <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;
        }
开发者ID:honomoa,项目名称:Win32API,代码行数:23,代码来源:W32Helper.cs

示例9: EnumDesktopWindows

 public static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumWindowsProc lpfn, IntPtr lParam);
开发者ID:burstas,项目名称:rmps,代码行数:1,代码来源:User32API.cs

示例10: EnumWindows

 internal static extern bool EnumWindows(EnumWindowsProc callback, IntPtr extraData);
开发者ID:antgraf,项目名称:BA,代码行数:1,代码来源:WinAPI.cs

示例11: EnumWindows

 static extern bool EnumWindows(EnumWindowsProc callback, int i);
开发者ID:itsbth,项目名称:GLuaR,代码行数:1,代码来源:Win32Window.cs

示例12: EnumChildWindows

 static extern bool EnumChildWindows(
     IntPtr window, EnumWindowsProc callback, int i);
开发者ID:itsbth,项目名称:GLuaR,代码行数:2,代码来源:Win32Window.cs

示例13: EnumWindows

 public static extern int EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
开发者ID:oneminot,项目名称:greenshot,代码行数:1,代码来源:User32.cs

示例14: EnumChildWindows

        static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc
			lpEnumFunc, IntPtr lParam);
开发者ID:CarverLab,项目名称:Oyster,代码行数:2,代码来源:Win32Wrapper.cs

示例15: EnumWindows

 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref SearchData data);
开发者ID:Choochet,项目名称:TDR7K,代码行数:1,代码来源:WndSearcher.cs


注:本文中的EnumWindowsProc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。