コード例 #1
0
        public static BOOL EnumChildWindows(HandleRef hwndParent, EnumChildWindowsCallback lpEnumFunc)
        {
            BOOL result = EnumChildWindows(hwndParent.Handle, lpEnumFunc);

            GC.KeepAlive(hwndParent.Wrapper);
            return(result);
        }
コード例 #2
0
        public static unsafe BOOL EnumChildWindows(IntPtr hwndParent, EnumChildWindowsCallback lpEnumFunc)
        {
            // We pass a function pointer to the native function and supply the callback as
            // reference data, so that the CLR doesn't need to generate a native code block for
            // each callback delegate instance (for storing the closure pointer).
            var gcHandle = GCHandle.Alloc(lpEnumFunc);

            try
            {
                return(EnumChildWindows(hwndParent, &HandleEnumChildWindowsNativeCallback, (IntPtr)gcHandle));
            }
            finally
            {
                gcHandle.Free();
            }
        }
コード例 #3
0
 public static extern int EnumChildWindows(IntPtr hWnd, EnumChildWindowsCallback callback, int lParam);
コード例 #4
0
ファイル: WINAPI.cs プロジェクト: mlnlover11/IExtendFramework
			public static extern int EnumChildWindows(IntPtr hWnd, EnumChildWindowsCallback callback, int lParam);