private void UpdateLocations(WindowsAPI.WINDOWPOS pos) { _topGlow.SetLocation(pos); _bottomGlow.SetLocation(pos); _rightGlow.SetLocation(pos); _leftGlow.SetLocation(pos); }
internal void SetLocation(WindowsAPI.WINDOWPOS pos) { switch (_side) { case Side.Top: Left = pos.x - SideGlow.SIZE; Top = pos.y - SideGlow.SIZE; break; case Side.Bottom: Left = pos.x - SideGlow.SIZE; Top = pos.y + pos.cy; break; case Side.Left: Left = pos.x - SideGlow.SIZE; Top = pos.y - SideGlow.SIZE; break; case Side.Right: Left = pos.x + pos.cx; Top = pos.y - SideGlow.SIZE; break; } }
private IntPtr ParentWndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg.Is(WindowsMessage.WM_ACTIVATE)) { UpdateZOrder(); } else if (msg.Is(WindowsMessage.WM_WINDOWPOSCHANGED)) { WindowsAPI.WINDOWPOS pos = (WindowsAPI.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WindowsAPI.WINDOWPOS)); UpdateLocations(pos); } else if (msg.Is(WindowsMessage.WM_SIZE)) { if ((int)wParam == 2 || (int)wParam == 1) // maximized/minimized { } else { int width = (int)WindowsAPI.LoWord(lParam); int height = (int)WindowsAPI.HiWord(lParam); UpdateSizes(width, height); } } else if (msg.Is(WindowsMessage.WM_DESTROY)) { } else if (msg.Is(WindowsMessage.WM_SETFOCUS)) { _isFocused = true; UpdateZOrder(); UpdateColor(); } else if (msg.Is(WindowsMessage.WM_KILLFOCUS)) { _isFocused = false; UpdateColor(); } return(IntPtr.Zero); }