protected override void WndProc(ref Message m) { if (m.Msg == AppBar.appBarCallback) { switch ((int)m.WParam) { case ABN_FULLSCREENAPP: Debug.Print("ABN_FULLSCREENAPP: " + m.ToString()); if ((int)m.LParam != 0) { Debug.Print("ALERT: m.LParam = " + ((int)m.LParam)); } TopMost = false; SendToBack(); break; case ABN_POSCHANGED: // Debug.Print("ABN_POSCHANGED: " + m.ToString()); break; case ABN_STATECHANGE: /*TODO: respond to StateChanged message */; Debug.Print("ABN_STATECHANGE: " + m.ToString()); break; case ABN_WINDOWARRANGE: Debug.Print("ABN_WINDOWARRANGE: " + m.ToString()); break; default: Debug.Print("UNKNOWN: " + m.ToString()); break; } } else if (m.Msg == (int)WindowsMessages.WM_ACTIVATE) { // Debug.Print(m.ToString()); AppBar.ActivateAppBar(this.Handle); } else if (m.Msg == (int)WindowsMessages.WM_ACTIVATEAPP) { // Debug.Print(m.ToString()); AppBar.ActivateAppBar(this.Handle); } else if (m.Msg == (int)WindowsMessages.WM_WINDOWPOSCHANGED) { WINDOWPOS pos = (WINDOWPOS)Marshal.PtrToStructure(m.LParam, typeof(WINDOWPOS)); WindowPosChanged(this.Handle); } base.WndProc(ref m); }
protected override void OnClosing(CancelEventArgs e) { AppBar.UnregisterAppBar(this.Handle); base.OnClosing(e); }
public void UnregisterAppBar() { AppBar.UnregisterAppBar(this.Handle); this.isAppBarRegistered = false; }
public void RegisterAppBar() { AppBar.RegisterAppBar(this.Handle, AppBar.appBarCallback); this.isAppBarRegistered = true; }