diff --git a/OnTopReplica/Native/Rectangle.cs b/OnTopReplica/Native/Rectangle.cs index c340e55..4934198 100644 --- a/OnTopReplica/Native/Rectangle.cs +++ b/OnTopReplica/Native/Rectangle.cs @@ -40,5 +40,12 @@ namespace OnTopReplica.Native { public System.Drawing.Rectangle ToRectangle() { return new System.Drawing.Rectangle(Left, Top, Right - Left, Bottom - Top); } + + public System.Drawing.Size Size { + get { + return new System.Drawing.Size(Width, Height); + } + } + } } diff --git a/OnTopReplica/Native/WindowMethods.cs b/OnTopReplica/Native/WindowMethods.cs index 5154209..7a34af6 100644 --- a/OnTopReplica/Native/WindowMethods.cs +++ b/OnTopReplica/Native/WindowMethods.cs @@ -9,6 +9,9 @@ namespace OnTopReplica.Native { /// static class WindowMethods { + [DllImport("user32.dll", SetLastError = true)] + public static extern bool GetClientRect(IntPtr handle, out NRectangle rect); + [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder lpString, int nMaxCount); diff --git a/OnTopReplica/NotificationIcon.cs b/OnTopReplica/NotificationIcon.cs index ff35701..ebdce67 100644 --- a/OnTopReplica/NotificationIcon.cs +++ b/OnTopReplica/NotificationIcon.cs @@ -26,7 +26,7 @@ namespace OnTopReplica { new ToolStripMenuItem(Strings.MenuOpen, Resources.icon, TaskIconOpen_click) { ToolTipText = Strings.MenuOpenTT, }, - new ToolStripMenuItem(Strings.MenuWindows, Resources.window16){ + new ToolStripMenuItem(Strings.MenuWindows, Resources.list){ DropDown = Form.MenuWindows, ToolTipText = Strings.MenuWindowsTT }, diff --git a/OnTopReplica/ThumbnailPanel.cs b/OnTopReplica/ThumbnailPanel.cs index 875441c..ab2fa23 100644 --- a/OnTopReplica/ThumbnailPanel.cs +++ b/OnTopReplica/ThumbnailPanel.cs @@ -116,8 +116,12 @@ namespace OnTopReplica { /// public Size ThumbnailOriginalSize { get { - if (_thumbnail != null && !_thumbnail.IsInvalid) - return (_regionEnabled) ? _regionCurrent.Size : _thumbnail.SourceSize; + if (_thumbnail != null && !_thumbnail.IsInvalid) { + if (_regionEnabled) + return _regionCurrent.Size; + + return _thumbnail.SourceSize; + } else throw new Exception(Strings.ErrorNoThumbnail); }