本文整理汇总了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();
}
示例2: WorldGenerator
static WorldGenerator()
{
squaresHitboxesList = new List<Hitbox>();
squaresHitboxesPool = new ObjectPool<Hitbox>(CreateSquareHitbox, RecycleSquareHitbox, RABBIT_BOX_POOL_SIZE);
getVisiblesWindowsAsSquaresHitboxes = new EnumWindowsProc(GetVisiblesWindowsAsSquaresHitboxes_EnumWindowsProc);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例9: EnumDesktopWindows
public static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumWindowsProc lpfn, IntPtr lParam);
示例10: EnumWindows
internal static extern bool EnumWindows(EnumWindowsProc callback, IntPtr extraData);
示例11: EnumWindows
static extern bool EnumWindows(EnumWindowsProc callback, int i);
示例12: EnumChildWindows
static extern bool EnumChildWindows(
IntPtr window, EnumWindowsProc callback, int i);
示例13: EnumWindows
public static extern int EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
示例14: EnumChildWindows
static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc
lpEnumFunc, IntPtr lParam);
示例15: EnumWindows
private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref SearchData data);