public void AppbarNew(AppBarEdges Edge) { if (!m_IsAppbarDocked) { if (m_CallbackMessageID == 0) { throw new Exception("CallbackMessageID is 0"); } m_Edge = Edge; m_OriginalSize = this.Size; m_OriginalLocation = this.Location; m_PrevBorderStyle = this.FormBorderStyle; this.FormBorderStyle = FormBorderStyle.None; // prepare data structure of message NM.APPBARDATA msgData = new NM.APPBARDATA(); msgData.cbSize = (UInt32)Marshal.SizeOf(msgData); msgData.hWnd = this.Handle; msgData.uCallbackMessage = m_CallbackMessageID; // install new appbar UIntPtr Return = NM.SHAppBarMessage(NM.AppBarMessages.New, ref msgData); if (Return == UIntPtr.Zero) { throw new Exception("Failed to add AppBar"); } m_IsAppbarDocked = true; SizeAppBar(); } }
public static IntPtr SHAppBarGetAutoHideBar(AppBarEdges uEdge) { var data = new APPBARDATA() { cbSize = Marshal.SizeOf(typeof(APPBARDATA)), uEdge = uEdge, }; return(SHAppBarMessage(AppBarMessages.ABM_GETAUTOHIDEBAR, ref data)); }
private IntPtr AppbarGetAutoHideBar(AppBarEdges edge) { // prepare data structure of message ShellApi.APPBARDATA msgData = new ShellApi.APPBARDATA(); msgData.cbSize = (UInt32)Marshal.SizeOf(msgData); msgData.uEdge = (UInt32)edge; // get auto hide IntPtr retVal = (IntPtr)ShellApi.SHAppBarMessage((UInt32)AppBarMessages.GetAutoHideBar, ref msgData); return(retVal); }
private IntPtr AppbarGetAutoHideBar(AppBarEdges edge) { APPBARDATA msgData = new APPBARDATA(); msgData.cbSize = (UInt32)Marshal.SizeOf(msgData); msgData.uEdge = (UInt32)edge; IntPtr retVal = (IntPtr)NativeMethod.SHAppBarMessage((UInt32)AppBarMessages.GetAutoHideBar, ref msgData); return(retVal); }
private IntPtr AppbarGetAutoHideBar(AppBarEdges edge) { ShellApi.APPBARDATA msgData = new ShellApi.APPBARDATA(); msgData.cbSize = (UInt32)Marshal.SizeOf(msgData); msgData.uEdge = (UInt32)edge; IntPtr retVal = (IntPtr)ShellApi.SHAppBarMessage((UInt32)AppBarMessages.GetAutoHideBar, ref msgData); return retVal; }
private IntPtr AppbarGetAutoHideBar(AppBarEdges edge) { // prepare data structure of message APPBARDATA msgData = new APPBARDATA(); msgData.cbSize = (UInt32)Marshal.SizeOf(msgData); msgData.uEdge = (UInt32)edge; // get auto hide IntPtr retVal = (IntPtr)SHAppBarMessage((UInt32)AppBarMessages.GetAutoHideBar, ref msgData); return retVal; }
protected override void OnMove(EventArgs e) { if (!internalResizing) { Point mousePos = Control.MousePosition; Screen screen = Screen.FromPoint(mousePos); targetScreen = screen; if (mousePos.X >= screen.Bounds.X && mousePos.X < screen.Bounds.X + 15) Edge = AppBarEdges.Left; else if (mousePos.Y >= screen.Bounds.Y && mousePos.Y < screen.Bounds.Y + 15) Edge = AppBarEdges.Top; else if (mousePos.X <= screen.Bounds.Right && mousePos.X > screen.Bounds.Right - 15) Edge = AppBarEdges.Right; else if (mousePos.Y <= screen.Bounds.Bottom && mousePos.Y > screen.Bounds.Bottom - 15) Edge = AppBarEdges.Bottom; else Edge = AppBarEdges.Float; } if (IsAppbarMode && !internalResizing) { internalResizing = true; Location = viewLocation; internalResizing = false; } else { base.OnMove(e); } }
public static bool HasAutoHideAppBar(RECT area, AppBarEdges targetEdge) { var appbar = Shell32.SHAppBarGetAutoHideBarEx(targetEdge, area); return(User32.IsWindow(appbar)); }