void OnAppbarNotification(ref Message msg)
        {
            AppBarStates        state;
            AppBarNotifications msgType = (AppBarNotifications)(Int32)msg.WParam;

            switch (msgType)
            {
            case AppBarNotifications.PosChanged:
                SizeAppBar();
                break;

/*
 *                              case AppBarNotifications.StateChange:
 *                                      state = AppbarGetTaskbarState();
 *                                      if ((state & AppBarStates.AlwaysOnTop) !=0)
 *                                      {
 *                                              TopMost = true;
 *                                              BringToFront();
 *                                      }
 *                                      else
 *                                      {
 *                                              TopMost = false;
 *                                              SendToBack();
 *                                      }
 *                                      break;
 *
 *                              case AppBarNotifications.FullScreenApp:
 *                                      if ((int)msg.LParam !=0)
 *                                      {
 *                                              TopMost = false;
 *                                              SendToBack();
 *                                      }
 *                                      else
 *                                      {
 *                                              state = AppbarGetTaskbarState();
 *                                              if ((state & AppBarStates.AlwaysOnTop) !=0)
 *                                              {
 *                                                      TopMost = true;
 *                                                      BringToFront();
 *                                              }
 *                                              else
 *                                              {
 *                                                      TopMost = false;
 *                                                      SendToBack();
 *                                              }
 *                                      }
 *
 *                                      break;
 *
 *                              case AppBarNotifications.WindowArrange:
 *                                      if ((int)msg.LParam != 0)	// before
 *                                              Visible = false;
 *                                      else						// after
 *                                              Visible = true;
 *
 *                                      break;
 *
 */
            }
        }
Esempio n. 2
0
        private IntPtr OnAppbarNotification(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            //AppBarStates state;
            AppBarNotifications msgType = (AppBarNotifications)wParam;

            switch (msgType)
            {
            case AppBarNotifications.PosChanged:
                SizeAppBar();
                break;

            //case AppBarNotifications.StateChange:
            //	state = AppbarGetTaskbarState();
            //	if ((state & AppBarStates.AlwaysOnTop) != 0)
            //		Topmost = true;
            //	else
            //		Topmost = false;
            //	break;

            case AppBarNotifications.FullScreenApp:
                if ((int)lParam != 0)
                {
                    Topmost = false;
                }
                else
                {
                    Topmost = true;
                    AppbarActivate();
                }

                //if ((int)lParam != 0)
                //	Topmost = false;
                //else
                //{
                //	state = AppbarGetTaskbarState();
                //	if ((state & AppBarStates.AlwaysOnTop) != 0)
                //		Topmost = true;
                //	else
                //		Topmost = false;
                //}

                break;

            case AppBarNotifications.WindowArrange:
                if ((int)lParam != 0)                           // before
                {
                    Visibility = Visibility.Collapsed;
                }
                else                                                                    // after
                {
                    Visibility = Visibility.Visible;
                }

                break;
            }

            return(IntPtr.Zero);
        }
        void OnAppbarNotification(ref Message msg)
        {
            AppBarStates        state;
            AppBarNotifications msgType = (AppBarNotifications)(Int32)msg.WParam;

            switch (msgType)
            {
            case AppBarNotifications.PosChanged:
                SizeAppBar();
                break;

            case AppBarNotifications.StateChange:
                state = AppbarGetTaskbarState();
                if ((state & AppBarStates.AlwaysOnTop) != 0)
                {
                    TopMost = true;
                    BringToFront();
                }
                else
                {
                    TopMost = false;
                    SendToBack();
                }
                break;

            case AppBarNotifications.FullScreenApp:
                if ((int)msg.LParam != 0)
                {
                    TopMost = false;
                    SendToBack();
                }
                else
                {
                    state = AppbarGetTaskbarState();
                    if ((state & AppBarStates.AlwaysOnTop) != 0)
                    {
                        TopMost = true;
                        BringToFront();
                    }
                    else
                    {
                        TopMost = false;
                        SendToBack();
                    }
                }

                break;

            case AppBarNotifications.WindowArrange:
                if ((int)msg.LParam != 0)                               // before
                {
                    Visible = false;
                }
                else                                                                    // after
                {
                    Visible = true;
                }

                break;
            }
        }