Exemplo n.º 1
0
        private NativeClass()
        {
            this.LoadIcon();

            this.windowProcedure = new WindowProcedure(this.Callback);
            var windowProcedurePtr = Marshal.GetFunctionPointerForDelegate(this.windowProcedure);

            ClassInfoEx windowClass = new ClassInfoEx(
                ClassStyles.HorizontalRedraw | ClassStyles.VerticalRedraw,
                windowProcedurePtr,
                IntPtr.Zero,
                icon != null ? icon.Handle : NativeMethods.LoadIcon(IntPtr.Zero, new IntPtr(32512)),
                NativeMethods.LoadCursor(IntPtr.Zero, new IntPtr(32512)),
                IntPtr.Zero,
                null,
                typeof(NativeClass).FullName,
                IntPtr.Zero);

            ushort atom = NativeMethods.RegisterClassEx(ref windowClass);

            this.atom = new IntPtr(atom);
        }
Exemplo n.º 2
0
 public static extern ushort RegisterClassEx(ref ClassInfoEx windowClass);