Exemplo n.º 1
0
        public static bool GetClassInfoEx(IntPtr hInstance, string lpClassName,
                                          out WindowClassEx classInfo)
        {
            WindowClassExBlittable classExBlittable;

            if (User32Methods.GetClassInfoEx(hInstance, lpClassName, out classExBlittable))
            {
                classInfo = new WindowClassEx
                {
                    Size = classExBlittable.Size,
                    BackgroundBrushHandle = classExBlittable.BackgroundBrushHandle,
                    ClassExtraBytes       = classExBlittable.ClassExtraBytes,
                    CursorHandle          = classExBlittable.CursorHandle,
                    InstanceHandle        = classExBlittable.InstanceHandle,
                    Styles           = classExBlittable.Styles,
                    IconHandle       = classExBlittable.IconHandle,
                    SmallIconHandle  = classExBlittable.SmallIconHandle,
                    WindowExtraBytes = classExBlittable.WindowExtraBytes,
                    WindowProc       = Marshal.GetDelegateForFunctionPointer <WindowProc>(classExBlittable.WindowProc),
                    ClassName        = Marshal.SystemDefaultCharSize == 1
                        ? Marshal.PtrToStringAnsi(classExBlittable.ClassName)
                        : Marshal.PtrToStringUni(classExBlittable.ClassName)
                                       // Menu name left out, since GetClassInfo doesn't return it
                };
                return(true);
            }
            classInfo = new WindowClassEx();
            return(false);
        }
Exemplo n.º 2
0
 public static extern ushort RegisterClassEx([In] ref WindowClassEx lpwcx);