Esempio n. 1
0
        private void Notify()
        {
            if (IconImage == null)
            {
                iconBox.Visible = false;
            }

            SetLayout();

            Rectangle rScreen = Screen.PrimaryScreen.WorkingArea;

            sysLoc = FindSystemTray(rScreen);

            if (sysLoc == SystemTrayLocation.BottomRight)
            {
                Top  = rScreen.Bottom - Height;
                Left = rScreen.Right - Width;
                MakeRoom();
                SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(false, false);
            }
            else if (sysLoc == SystemTrayLocation.TopRight)
            {
                Top  = rScreen.Top;
                Left = rScreen.Right - Width;
                MakeRoom();
                SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(true, false);
            }
            else if (sysLoc == SystemTrayLocation.BottomLeft)
            {
                Top  = rScreen.Bottom - Height;
                Left = rScreen.Left;
                MakeRoom();
                SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(false, false);
            }

            lock (openPopups)
            {
                openPopups.Add(this);
            }

            if (WaitTime > 0)
            {
                displayTimer.Interval = WaitTime;
                displayTimer.Start();
            }
        }
Esempio n. 2
0
        private void Notify()
        {
            if(IconImage == null)
                iconBox.Visible = false;

            SetLayout();

            Rectangle rScreen = Screen.PrimaryScreen.WorkingArea;

            sysLoc = FindSystemTray(rScreen);

            if(sysLoc == SystemTrayLocation.BottomRight)
            {
                Top = rScreen.Bottom - Height;
                Left = rScreen.Right - Width;
                MakeRoom();
                SetWindowPos (Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(false, false);
            }
            else if(sysLoc == SystemTrayLocation.TopRight)
            {
                Top = rScreen.Top;
                Left = rScreen.Right - Width;
                MakeRoom();
                SetWindowPos (Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(true, false);
            }
            else if(sysLoc == SystemTrayLocation.BottomLeft)
            {
                Top = rScreen.Bottom - Height;
                Left = rScreen.Left;
                MakeRoom();
                SetWindowPos (Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE);
                AnimateWindow(false, false);
            }

            lock(openPopups)
            {
                openPopups.Add(this);
            }

            displayTimer.Interval = WaitTime;
            displayTimer.Start();
        }