示例#1
0
        internal void StylesToProperty()
        {
            StyleToProperty();

            foreach (StyleInfo si in styles)
            {
                if (si.Extended)
                {
                    WindowExStyles e;
                    if (!Enum.TryParse <WindowExStyles>(si.Name, out e))
                    {
                        Diagnostic.WriteLine("WARNING! Unknown style name: " + si.Name);
                        continue;
                    }

                    ExStyle |= e;
                }
                else
                {
                    WindowStyles e;
                    if (!Enum.TryParse <WindowStyles>(si.Name, out e))
                    {
                        Diagnostic.WriteLine("WARNING! Unknown style name: " + si.Name);
                        continue;
                    }
                    Style |= e;
                }
#if DEBUG
                Diagnostic.WriteLine(string.Concat("WARNING: residual style ", si.Name, " for control ", Id));
#endif
            }
        }
示例#2
0
        protected override bool InspectWindow(WindowHandle handle)
        {
            //Reject empty titles
            if (string.IsNullOrEmpty(handle.Title))
            {
                return(true);
            }

            //Accept windows that
            // - are visible
            // - do not have a parent
            // - have no owner and are not Tool windows OR
            // - have an owner and are App windows
            if ((long)Win32.GetParent(handle.Handle) == 0)
            {
                bool           hasOwner = (long)Win32.GetWindow(handle.Handle, GetWindowMode.GW_OWNER) != 0;
                WindowExStyles exStyle  = (WindowExStyles)Win32.GetWindowLong(handle.Handle, WindowLong.ExStyle);

                if (((exStyle & WindowExStyles.ToolWindow) == 0 && !hasOwner) || //unowned non-tool window
                    ((exStyle & WindowExStyles.AppWindow) == WindowExStyles.AppWindow && hasOwner))
                {                                                                //owned application window
                    _list.Add(handle);
                }
            }
            return(true);
        }
示例#3
0
        /// <summary>
        /// The get window styles.
        /// </summary>
        /// <param name="state">
        /// The state.
        /// </param>
        /// <returns>
        /// The <see cref="Tuple"/>.
        /// </returns>
        private Tuple <WindowStyles, WindowExStyles, ShowWindowCommands> GetWindowStyles(WindowState state)
        {
            WindowStyles   styles   = WindowStyles.WS_OVERLAPPEDWINDOW | WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS;
            WindowExStyles exStyles = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_WINDOWEDGE;

            switch (state)
            {
            case WindowState.Normal:
                return(new Tuple <WindowStyles, WindowExStyles, ShowWindowCommands>(styles, exStyles, ShowWindowCommands.SW_SHOWNORMAL));

            case WindowState.Maximize:
            {
                styles   = WindowStyles.WS_OVERLAPPEDWINDOW | WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_MAXIMIZE;
                exStyles = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_WINDOWEDGE;
                return(new Tuple <WindowStyles, WindowExStyles, ShowWindowCommands>(styles, exStyles, ShowWindowCommands.SW_SHOWMAXIMIZED));
            }

            case WindowState.Fullscreen:
            {
                styles   = WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_MAXIMIZE;
                exStyles = WindowExStyles.WS_EX_TOOLWINDOW;
                return(new Tuple <WindowStyles, WindowExStyles, ShowWindowCommands>(styles, exStyles, ShowWindowCommands.SW_SHOWMAXIMIZED));
            }
            }

            return(new Tuple <WindowStyles, WindowExStyles, ShowWindowCommands>(styles, exStyles, ShowWindowCommands.SW_SHOWNORMAL));
        }
示例#4
0
        private TWindow CreateWindowCoreFromInstance <TWindow>(TWindow win, string text, WindowStyles styles,
                                                               WindowExStyles exStyles, int x, int y,
                                                               int width, int height, IntPtr hParent, IntPtr hMenu, uint controlStyles)
            where TWindow : WindowCore
        {
            VerifyWindowInstanceNotInitialized(win);
            ((INativeConnectable)win).SetFactory(this);

            var winGcHandle = GCHandle.Alloc(win);
            var extraParam  = GCHandle.ToIntPtr(winGcHandle);

            var hwnd = IntPtr.Zero;

            try
            {
                hwnd = User32Methods.CreateWindowEx(exStyles, this.ClassName, text,
                                                    styles | (WindowStyles)controlStyles, x, y, width, height, hParent, hMenu, this.InstanceHandle,
                                                    extraParam);
            }
            finally
            {
                winGcHandle.Free();
                if (hwnd == IntPtr.Zero)
                {
                    win.Dispose();
                    ThrowWindowCreationFailed();
                }
            }
            return(win);
        }
示例#5
0
 public MonoView(XplatUICocoa driver, CGRect frameRect, WindowStyles style, WindowExStyles exStyle) : base(frameRect)
 {
     this.driver         = driver;
     this.Style          = style;
     this.ExStyle        = exStyle;
     this.eventResponder = new WindowsEventResponder(driver, this);
     base.NextResponder  = eventResponder;
 }
示例#6
0
 public TWindow CreateWindowCore <TWindow>(Func <TWindow> instanceCreator, string text, WindowStyles styles,
                                           WindowExStyles exStyles, int x, int y,
                                           int width, int height, IntPtr hParent, IntPtr hMenu, uint controlStyles)
     where TWindow : WindowCore
 {
     return(this.CreateWindowCoreFromInstance(instanceCreator(), text, styles, exStyles, x, y, width, height,
                                              hParent,
                                              hMenu, controlStyles));
 }
示例#7
0
        public static bool InverseAdjustWindowRectEx(
            ref Rectangle lpRect, WindowStyles dwStyle, bool hasMenu,
            WindowExStyles dwExStyle)
        {
            var rc  = new Rectangle();
            var res = User32Methods.AdjustWindowRectEx(ref rc, dwStyle, hasMenu, dwExStyle);

            if (res)
                Subtract(ref lpRect, ref rc); }
示例#8
0
 public static void GetFullWindowRect(WindowStyles style, WindowExStyles styleEx, uint dpi, ref Rect rect)
 {
     if (IsWindows10AnniversaryUpdateOrGreaterWin32)
     {
         User32.AdjustWindowRectExForDpi(ref rect, style, false, styleEx, dpi);
     }
     else
     {
         User32.AdjustWindowRectEx(ref rect, style, false, styleEx);
     }
 }
示例#9
0
        protected TWindow CreateWindow <TWindow>(Func <TWindow> func, string title) where TWindow : WindowCore
        {
            var            constructionParams = new FrameWindowConstructionParams();
            WindowExStyles exStyles           = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_NOREDIRECTIONBITMAP;

            TWindow window =
                windowFactory.CreateWindow(func, title, constructionParams: constructionParams, exStyles: exStyles);

            windows.Add(window);

            return(window);
        }
示例#10
0
 public static extern IntPtr CreateWindowEx(
     WindowExStyles dwExStyle,
     string lpClassName,
     string lpWindowName,
     WindowStyles dwStyle,
     int x,
     int y,
     int nWidth,
     int nHeight,
     IntPtr hwndParent,
     IntPtr hMenu,
     IntPtr hInstance,
     IntPtr lpParam);
示例#11
0
        public void PrintStyle(Control control, WindowExStyles s)
        {
            CreateParams cp = (CreateParams)control.GetType().GetProperty("CreateParams", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(control, null);

            if ((cp.Style & (int)s) == (int)s)
            {
                Console.WriteLine("=>Style: {0}:{1}", PlanStyle(s), (int)s);
            }
            if ((cp.ExStyle & (int)s) == (int)s)
            {
                Console.WriteLine("=>ExStyle: {0}:{1}", PlanStyle(s), (int)s);
            }
        }
示例#12
0
        public static NativeWindow CreateExternalWindowCore(string className, string text,
                                                            WindowStyles styles, WindowExStyles exStyles, int x, int y, int width, int height, IntPtr hParent,
                                                            IntPtr hMenu, IntPtr hInstance,
                                                            IntPtr extraParams, uint controlStyles)
        {
            var hwnd = User32Methods.CreateWindowEx(exStyles, className, text,
                                                    styles | (WindowStyles)controlStyles, x, y, width, height, hParent, hMenu, hInstance, extraParams);

            if (hwnd == IntPtr.Zero)
            {
                ThrowWindowCreationFailed();
            }
            return(CreateWindowFromHandle(hwnd));
        }
示例#13
0
        private void AdjustWindowStyle(IntPtr handle)
        {
            uint         lStyle         = Methods.GetWindowLong(handle, (int)WindowLongParam.GWL_STYLE);
            WindowStyles flagsToDisable = ~(WindowStyles.WS_CAPTION | WindowStyles.WS_THICKFRAME | WindowStyles.WS_MINIMIZE | WindowStyles.WS_MAXIMIZE | WindowStyles.WS_SYSMENU);

            lStyle &= (uint)flagsToDisable;
            Methods.SetWindowLong(handle, (int)WindowLongParam.GWL_STYLE, lStyle);

            uint           lExStyle         = Methods.GetWindowLong(handle, (int)WindowLongParam.GWL_EXSTYLE);
            WindowExStyles flagsToDisableEx = ~(WindowExStyles.WS_EX_DLGMODALFRAME | WindowExStyles.WS_EX_CLIENTEDGE | WindowExStyles.WS_EX_STATICEDGE);

            lExStyle &= (uint)flagsToDisableEx;
            Methods.SetWindowLong(handle, (int)WindowLongParam.GWL_EXSTYLE, lExStyle);
        }
        public static void ToTransparentWindow(this Window x)
        {
            x.SourceInitialized +=
                delegate
            {
                // Get this window's handle
                IntPtr hwnd = new WindowInteropHelper(x).Handle;

                // Change the extended window style to include WS_EX_TRANSPARENT
                WindowExStyles extendedStyle = (WindowExStyles)GetWindowLong(hwnd, GWL_EXSTYLE);

                SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WindowExStyles.WS_EX_TRANSPARENT | WindowExStyles.WS_EX_NOACTIVATE);
            };
        }
        public static void MakeInteractive(this System.Windows.Window w, bool value = true)
        {
            IntPtr hwnd = new WindowInteropHelper(w).Handle;

            // Change the extended window style to include WS_EX_TRANSPARENT
            WindowExStyles extendedStyle = (WindowExStyles)GetWindowLong(hwnd, DesktopWindowManager.GWL_EXSTYLE);

            if (value)
            {
                extendedStyle &= ~(WindowExStyles.WS_EX_TRANSPARENT | WindowExStyles.WS_EX_NOACTIVATE);
            }
            else
            {
                extendedStyle |= WindowExStyles.WS_EX_TRANSPARENT | WindowExStyles.WS_EX_NOACTIVATE;
            }
            SetWindowLong(hwnd, DesktopWindowManager.GWL_EXSTYLE, extendedStyle);
        }
示例#16
0
        public static TWindow CreateExternalWindowCore <TWindow>(Func <TWindow> instanceCreator, bool takeOwnership,
                                                                 string className, string text,
                                                                 WindowStyles styles,
                                                                 WindowExStyles exStyles,
                                                                 int x, int y, int width, int height, IntPtr hParent, IntPtr hMenu, IntPtr hInstance,
                                                                 IntPtr extraParams, uint controlStyles)
            where TWindow : WindowCore
        {
            var hwnd = User32Methods.CreateWindowEx(exStyles, className, text,
                                                    styles | (WindowStyles)controlStyles, x, y, width, height, hParent, hMenu, hInstance, extraParams);

            if (hwnd == IntPtr.Zero)
            {
                ThrowWindowCreationFailed();
            }
            return(CreateWindowFromHandle(instanceCreator, hwnd, takeOwnership));
        }
示例#17
0
        private void ToggleFullScreen()
        {
            if (!isFullScreen)
            {
                isMaximized = User32Methods.IsZoomed(Handle);

                //if (isMaximized)
                //    SetState(ShowWindowCommands.SW_RESTORE);

                windowStyles   = GetStyles();
                windowExStyles = GetExStyles();
                GetWindowRect(out windowRect);

                SetStyle(windowStyles & ~(WindowStyles.WS_CAPTION | WindowStyles.WS_THICKFRAME));
                SetExStyles(windowExStyles & ~(WindowExStyles.WS_EX_DLGMODALFRAME | WindowExStyles.WS_EX_WINDOWEDGE
                                               | WindowExStyles.WS_EX_CLIENTEDGE
                                               | WindowExStyles.WS_EX_STATICEDGE));

                IntPtr monitor = User32Methods.MonitorFromWindow(Handle, MonitorFlag.MONITOR_DEFAULTTONEAREST);

                User32Helpers.GetMonitorInfo(monitor, out MonitorInfo monitorInfo);

                SetPosition(monitorInfo.MonitorRect,
                            WindowPositionFlags.SWP_NOZORDER | WindowPositionFlags.SWP_NOACTIVATE
                            | WindowPositionFlags.SWP_FRAMECHANGED);
            }
            else
            {
                SetStyle(windowStyles);
                SetExStyles(windowExStyles);

                SetPosition(windowRect,
                            WindowPositionFlags.SWP_NOZORDER | WindowPositionFlags.SWP_NOACTIVATE
                            | WindowPositionFlags.SWP_FRAMECHANGED);

                if (isMaximized)
                {
                    SetState(ShowWindowCommands.SW_MAXIMIZE);
                }
            }

            isFullScreen = !isFullScreen;
            ResetTransformation();
        }
示例#18
0
        public static int DecodeExStyle(this string strings)
        {
            string[]       tokens = strings.Split('|');
            WindowExStyles ws     = 0;

            foreach (string s in tokens)
            {
                bool   not;
                string val;
                if (!AdjustValue(s, out not, out val))
                {
                    continue;
                }
                if (not)
                {
                    ws &= ~(WindowExStyles)Enum.Parse(typeof(WindowExStyles), val);
                }
                else
                {
                    ws |= (WindowExStyles)Enum.Parse(typeof(WindowExStyles), val);
                }
            }
            return((int)ws);
        }
示例#19
0
 public static extern bool AdjustWindowRectEx(ref RECT lpRect, WindowStyles dwStyle, bool bMenu, WindowExStyles dwExStyle);
示例#20
0
		internal static bool IsSet (WindowExStyles ExStyle, WindowExStyles Option) {
			return (Option & ExStyle) == Option;
		}
示例#21
0
		internal bool IsSet (WindowExStyles ExStyle) {
			return (this.ex_style & (int) ExStyle) == (int) ExStyle;
		}
示例#22
0
 public static WindowExStyles SetWindowLongEx(IntPtr hWnd, WindowExStyles dwNewLong)
 {
     return (WindowExStyles)SetWindowLong(hWnd, (int)WindowLongFlags.GWL_EXSTYLE, (int)dwNewLong);
 }
示例#23
0
 public static extern int SetWindowLongA(IntPtr hWnd, SetWindowLongType nIndex, WindowExStyles dwNewLong);
示例#24
0
		internal extern static IntPtr Win32CreateWindow(WindowExStyles dwExStyle, string lpClassName, string lpWindowName, WindowStyles dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lParam);
 public static extern int SetWindowLong(IntPtr hwnd, int index, WindowExStyles newStyle);
示例#26
0
 public static extern bool AdjustWindowRectEx([In][Out] ref Rect lpRect, WindowStyles dwStyle, bool bMenu, WindowExStyles exStyle);
示例#27
0
        private void CreateWindowInternal()
        {
            var            x         = 0;
            var            y         = 0;
            WindowStyles   style     = 0;
            WindowExStyles styleEx   = 0;
            const bool     resizable = true;

            // Setup the screen settings depending on whether it is running in full screen or in windowed mode.
            //if (fullscreen)
            //{
            //style = User32.WindowStyles.WS_POPUP | User32.WindowStyles.WS_VISIBLE;
            //styleEx = User32.WindowStyles.WS_EX_APPWINDOW;

            //width = screenWidth;
            //height = screenHeight;
            //}
            //else
            {
                if (Width > 0 && Height > 0)
                {
                    var screenWidth  = User32.GetSystemMetrics(SystemMetrics.SM_CXSCREEN);
                    var screenHeight = User32.GetSystemMetrics(SystemMetrics.SM_CYSCREEN);

                    // Place the window in the middle of the screen.WS_EX_APPWINDOW
                    x = (screenWidth - Width) / 2;
                    y = (screenHeight - Height) / 2;
                }

                if (resizable)
                {
                    style = WindowStyles.WS_OVERLAPPEDWINDOW;
                }
                else
                {
                    style = WindowStyles.WS_POPUP | WindowStyles.WS_BORDER | WindowStyles.WS_CAPTION | WindowStyles.WS_SYSMENU;
                }

                styleEx = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_WINDOWEDGE;
            }
            style |= WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS;

            int windowWidth;
            int windowHeight;

            if (Width > 0 && Height > 0)
            {
                var rect = new Rect(0, 0, Width, Height);

                // Adjust according to window styles
                User32.AdjustWindowRectEx(
                    ref rect,
                    style,
                    false,
                    styleEx);

                windowWidth  = rect.Right - rect.Left;
                windowHeight = rect.Bottom - rect.Top;
            }
            else
            {
                x = y = windowWidth = windowHeight = CW_USEDEFAULT;
            }

            var hwnd = User32.CreateWindowEx(
                (int)styleEx,
                Application.WndClassName,
                Title,
                (int)style,
                x,
                y,
                windowWidth,
                windowHeight,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero);

            if (hwnd == IntPtr.Zero)
            {
                return;
            }

            User32.ShowWindow(hwnd, ShowWindowCommand.Normal);
            Handle = hwnd;
            Width  = windowWidth;
            Height = windowHeight;
        }
示例#28
0
        public Win32Window(WindowsApplicationHost host, string title, int width, int height)
            : base(title)
        {
            _title = title;
            _host  = host;
            //const bool fullscreen = false;
            var resizable = true;

            var            x       = 0;
            var            y       = 0;
            WindowStyles   style   = 0;
            WindowExStyles styleEx = 0;

            // Setup the screen settings depending on whether it is running in full screen or in windowed mode.
            //if (fullscreen)
            //{
            //style = User32.WindowStyles.WS_POPUP | User32.WindowStyles.WS_VISIBLE;
            //styleEx = User32.WindowStyles.WS_EX_APPWINDOW;

            //width = screenWidth;
            //height = screenHeight;
            //}
            //else
            {
                if (width > 0 && height > 0)
                {
                    var screenWidth  = GetSystemMetrics(SystemMetrics.SM_CXSCREEN);
                    var screenHeight = GetSystemMetrics(SystemMetrics.SM_CYSCREEN);

                    // Place the window in the middle of the screen.WS_EX_APPWINDOW
                    x = (screenWidth - width) / 2;
                    y = (screenHeight - height) / 2;
                }

                if (resizable)
                {
                    style = WindowStyles.WS_OVERLAPPEDWINDOW;
                }
                else
                {
                    style = WindowStyles.WS_POPUP | WindowStyles.WS_BORDER | WindowStyles.WS_CAPTION | WindowStyles.WS_SYSMENU;
                }

                styleEx = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_WINDOWEDGE;
            }
            style |= WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS;

            int windowWidth;
            int windowHeight;

            if (width > 0 && height > 0)
            {
                var rect = new Rect(0, 0, (int)(width * ContentScale), (int)(height * ContentScale));

                // Adjust according to window styles
                AdjustWindowRectEx(
                    ref rect,
                    style,
                    false,
                    styleEx);

                windowWidth  = rect.Right - rect.Left;
                windowHeight = rect.Bottom - rect.Top;
            }
            else
            {
                x = y = windowWidth = windowHeight = CW_USEDEFAULT;
            }

            _hwnd = CreateWindowEx(
                (int)styleEx,
                WindowsApplicationHost.WndClassName,
                title,
                (int)style,
                x,
                y,
                windowWidth,
                windowHeight,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero);

            if (_hwnd == IntPtr.Zero)
            {
                //Log.Error("[Win32] - Failed to create window");
                return;
            }

            _host.RegisterWindow(this);

            ShowWindow(_hwnd, ShowWindowCommand.Normal);

            // Rase and set handle.
            OnHandleCreated(SwapChainHandle.CreateWin32(host.HInstance, _hwnd));
        }
示例#29
0
        private unsafe void PlatformConstruct()
        {
            int            x         = 0;
            int            y         = 0;
            WindowStyles   style     = 0;
            WindowExStyles styleEx   = 0;
            const bool     resizable = true;

            // Setup the screen settings depending on whether it is running in full screen or in windowed mode.
            //if (fullscreen)
            //{
            //style = User32.WindowStyles.WS_POPUP | User32.WindowStyles.WS_VISIBLE;
            //styleEx = User32.WindowStyles.WS_EX_APPWINDOW;

            //width = screenWidth;
            //height = screenHeight;
            //}
            //else
            {
                if (ClientSize.Width > 0 && ClientSize.Height > 0)
                {
                    int screenWidth  = GetSystemMetrics(SystemMetrics.SM_CXSCREEN);
                    int screenHeight = GetSystemMetrics(SystemMetrics.SM_CYSCREEN);

                    // Place the window in the middle of the screen.WS_EX_APPWINDOW
                    x = (screenWidth - ClientSize.Width) / 2;
                    y = (screenHeight - ClientSize.Height) / 2;
                }

                if (resizable)
                {
                    style = WindowStyles.WS_OVERLAPPEDWINDOW;
                }
                else
                {
                    style = WindowStyles.WS_POPUP | WindowStyles.WS_BORDER | WindowStyles.WS_CAPTION | WindowStyles.WS_SYSMENU;
                }

                styleEx = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_WINDOWEDGE;
            }
            style |= WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS;

            int windowWidth;
            int windowHeight;

            if (ClientSize.Width > 0 && ClientSize.Height > 0)
            {
                var rect = new RawRect(0, 0, ClientSize.Width, ClientSize.Height);

                // Adjust according to window styles
                AdjustWindowRectEx(&rect, (uint)style, 0, (uint)styleEx);

                windowWidth  = rect.Right - rect.Left;
                windowHeight = rect.Bottom - rect.Top;
            }
            else
            {
                x = y = windowWidth = windowHeight = CW_USEDEFAULT;
            }

            fixed(char *lpszClassName = Application.WindowClassName)
            {
                fixed(char *lpWindowName = Title)
                {
                    Handle = CreateWindowExW(
                        (uint)styleEx,
                        (ushort *)lpszClassName,
                        (ushort *)lpWindowName,
                        (uint)style,
                        x,
                        y,
                        windowWidth,
                        windowHeight,
                        IntPtr.Zero,
                        IntPtr.Zero,
                        IntPtr.Zero,
                        null
                        );

                    if (Handle == IntPtr.Zero)
                    {
                        return;
                    }
                }
            }

            ShowWindow(Handle, (int)ShowWindowCommand.Normal);
            ClientSize = new Size(windowWidth, windowHeight);
        }
示例#30
0
		bool ExStyleSet (int ex, WindowExStyles exws)
		{
			return (ex & (int)exws) == (int)exws;
		}
示例#31
0
 internal bool IsSet(WindowExStyles ExStyle)
 {
     return((this.ex_style & (int)ExStyle) == (int)ExStyle);
 }
示例#32
0
 public static extern bool AdjustWindowRectEx([In][Out] ref Rectangle lpRect, WindowStyles dwStyle, bool hasMenu,
                                              WindowExStyles dwExStyle);
示例#33
0
 internal static bool IsSet(WindowExStyles ExStyle, WindowExStyles Option)
 {
     return((Option & ExStyle) == Option);
 }
示例#34
0
		private string PlanStyle (WindowExStyles style) {
			return style.ToString ().Replace ("WS_EX_LEFT, WS_EX_RIGHTSCROLLBAR, ", "");
		}		
示例#35
0
		public static bool IsExStyleSet (Control control, WindowExStyles style) {
			CreateParams cp = GetCreateParams (control);
			return ((cp.ExStyle & (int) style) == (int) style);
		}
示例#36
0
 public static extern int SetWindowLong(IntPtr hwnd, int index, WindowExStyles newStyle);
示例#37
0
		public void PrintStyle (Control control, WindowExStyles s)
		{
			CreateParams cp = (CreateParams) control.GetType().GetProperty("CreateParams", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(control, null);
			if ((cp.Style & (int) s) == (int) s) {
				Console.WriteLine ("=>Style: {0}:{1}", PlanStyle(s), (int)s);
			}
			if ((cp.ExStyle & (int) s) == (int) s) {
				Console.WriteLine ("=>ExStyle: {0}:{1}", PlanStyle(s), (int)s);
			}
		}
示例#38
0
        public static bool IsExStyleSet(Control control, WindowExStyles style)
        {
            CreateParams cp = GetCreateParams(control);

            return((cp.ExStyle & (int)style) == (int)style);
        }
示例#39
0
 private bool ExStyleSet(int ex, WindowExStyles exws)
 {
     return((ex & (int)exws) == (int)exws);
 }