internal static StatusBarGrip Create(IntPtr hwnd, ProxyHwnd parent, int item) { if (HasGrip(hwnd)) { return(new StatusBarGrip(hwnd, parent, item)); } return(null); }
// ------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsContainer (IntPtr hwnd, ProxyHwnd parent, int item) : base( hwnd, parent, item) { string className = Misc.ProxyGetClassName(hwnd); if (!string.IsNullOrEmpty(className)) { if (className.Equals("#32770")) { _sType = ST.Get(STID.LocalizedControlTypeDialog); } else if (className.IndexOf("AfxControlBar", StringComparison.Ordinal) != -1) { _sType = ST.Get(STID.LocalizedControlTypeContainer); } } _fIsContent = IsTopLevelWindow(); _fIsKeyboardFocusable = true; }
// ------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsContainer(IntPtr hwnd, ProxyHwnd parent, int item) : base(hwnd, parent, item) { string className = Misc.ProxyGetClassName(hwnd); if (!string.IsNullOrEmpty(className)) { if (className.Equals("#32770")) { _sType = SR.Get(SRID.LocalizedControlTypeDialog); } else if (className.IndexOf("AfxControlBar", StringComparison.Ordinal) != -1) { _sType = SR.Get(SRID.LocalizedControlTypeContainer); } } _fIsContent = IsTopLevelWindow(); _fIsKeyboardFocusable = true; }
internal ProxyHwnd CreateNonClientMenu() { // child windows don't have menus int style = WindowStyle; if (!Misc.IsBitSet(style, NativeMethods.WS_CHILD)) { ProxyHwnd menuProxy = null; if (WindowsMenu.IsInSystemMenuMode()) { // Since in system menu mode try to find point on the SystemMenu WindowsTitleBar titleBar = (WindowsTitleBar)CreateNonClientChild(NonClientItem.TitleBar); if (titleBar != null) { menuProxy = (ProxyHwnd)titleBar.CreateTitleBarChild(WindowsTitleBar._systemMenu); } } else { IntPtr menu = UnsafeNativeMethods.GetMenu(_hwnd); if (menu != IntPtr.Zero) { menuProxy = new WindowsMenu(_hwnd, this, menu, WindowsMenu.MenuType.Toplevel, (int)NonClientItem.Menu); } } if (menuProxy != null) { // if this menu is not visible its really not there if (menuProxy.BoundingRectangle.Width != 0 && menuProxy.BoundingRectangle.Height != 0) { return(menuProxy); } } } return(null); }
internal override void AdviseEventRemoved(AutomationEvent eventId, AutomationProperty [] aidProps) { // we need to create the menu proxy so that the global event for menu will be listened for. // This proxy will get advise of events needed for menus ProxyHwnd menuProxy = CreateNonClientMenu(); if (menuProxy == null) { // If the window does not have a menu, it at least has a system menu. WindowsTitleBar titleBar = (WindowsTitleBar)CreateNonClientChild(NonClientItem.TitleBar); if (titleBar != null) { menuProxy = (ProxyHwnd)titleBar.CreateTitleBarChild(WindowsTitleBar._systemMenu); } } if (menuProxy != null) { menuProxy.AdviseEventRemoved(eventId, aidProps); } base.AdviseEventRemoved(eventId, aidProps); }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsStartMenu(IntPtr hwnd, ProxyHwnd parent, int item) : base(hwnd, parent, item) { _sAutomationId = "StartMenu"; }
// ------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsGrip (IntPtr hwnd, ProxyHwnd parent, int item) : base( hwnd, parent, item) { _sType = ST.Get(STID.LocalizedControlTypeGrip); _sAutomationId = "Window.Grip"; // This string is a non-localizable string }
// ------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsGrip(IntPtr hwnd, ProxyHwnd parent, int item) : base(hwnd, parent, item) { _sType = SR.Get(SRID.LocalizedControlTypeGrip); _sAutomationId = "Window.Grip"; // This string is a non-localizable string }
// ------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public StatusBarGrip(IntPtr hwnd, ProxyHwnd parent, int item) : base(hwnd, parent, item) { _sType = ST.Get(STID.LocalizedControlTypeGrip); _sAutomationId = "StatusBar.Grip"; // This string is a non-localizable string }
internal static StatusBarGrip Create(IntPtr hwnd, ProxyHwnd parent, int item) { if(HasGrip(hwnd)) { return new StatusBarGrip(hwnd, parent, item); } return null; }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors public WindowsStartMenu(IntPtr hwnd, ProxyHwnd parent, int item) : base( hwnd, parent, item) { _sAutomationId = "StartMenu"; }