Mergedown.

This commit is contained in:
Lorenz Cuno Klopfenstein 2010-10-16 18:35:29 +02:00
commit 8ad4e78ac5
50 changed files with 5116 additions and 1163 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<UpdateInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <UpdateInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<latestVersion>3.1.0.0</latestVersion> <latestVersion>3.2.0.0</latestVersion>
<latestVersionRelease>2010-09-09T00:00:00Z</latestVersionRelease> <latestVersionRelease>2010-10-15T00:00:00Z</latestVersionRelease>
<downloadPage>http://www.klopfenstein.net/lorenz.aspx/ontopreplica</downloadPage> <downloadPage>http://www.klopfenstein.net/lorenz.aspx/ontopreplica</downloadPage>
</UpdateInformation> </UpdateInformation>

15
OnTopReplica/Actions.cs Normal file
View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OnTopReplica {
public delegate void Action();
public delegate void Action<T1>(T1 arg1);
public delegate void Action<T1, T2>(T1 arg1, T2 arg2);
public delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View file

@ -7,6 +7,7 @@ namespace OnTopReplica {
public class CloseRequestEventArgs : EventArgs { public class CloseRequestEventArgs : EventArgs {
public WindowHandle LastWindowHandle { get; set; } public WindowHandle LastWindowHandle { get; set; }
public Rectangle? LastRegion { get; set; } public Rectangle? LastRegion { get; set; }
} }

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OnTopReplica {
/// <summary>
/// Extension methods for IEnumerable.
/// </summary>
static class EnumerableExtensions {
/// <summary>
/// Gets the first element of an enumeration of a default value.
/// </summary>
public static T FirstOrDefault<T>(this IEnumerable<T> collection) {
if (collection == null)
throw new ArgumentNullException();
using (var enumerator = collection.GetEnumerator()) {
if (!enumerator.MoveNext())
return default(T);
else
return enumerator.Current;
}
}
}
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace System.Runtime.CompilerServices {
/// <summary>
/// Fake extension attribute that adds extension method support to C# 2 (without System.Core.dll reference).
/// </summary>
class ExtensionAttribute : Attribute {
}
}

View file

@ -52,9 +52,13 @@
this.quarterToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.quarterToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.fullscreenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.fullscreenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.restorePositionAndSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.dockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.disabledToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.topLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.topLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.topRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.topRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.centerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bottomLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.bottomLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bottomRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.bottomRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.chromeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.chromeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -115,6 +119,7 @@
this.menuWindows.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuWindows.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem}); this.noneToolStripMenuItem});
this.menuWindows.Name = "menuWindows"; this.menuWindows.Name = "menuWindows";
this.menuWindows.OwnerItem = this.menuContextWindows;
this.menuWindows.Size = new System.Drawing.Size(118, 26); this.menuWindows.Size = new System.Drawing.Size(118, 26);
this.menuWindows.Opening += new System.ComponentModel.CancelEventHandler(this.Menu_Windows_opening); this.menuWindows.Opening += new System.ComponentModel.CancelEventHandler(this.Menu_Windows_opening);
// //
@ -206,6 +211,7 @@
this.toolStripMenuItem3, this.toolStripMenuItem3,
this.toolStripMenuItem4}); this.toolStripMenuItem4});
this.menuOpacity.Name = "menuOpacity"; this.menuOpacity.Name = "menuOpacity";
this.menuOpacity.OwnerItem = this.fullOpacityToolStripMenuItem;
this.menuOpacity.ShowCheckMargin = true; this.menuOpacity.ShowCheckMargin = true;
this.menuOpacity.ShowImageMargin = false; this.menuOpacity.ShowImageMargin = false;
this.menuOpacity.Size = new System.Drawing.Size(154, 92); this.menuOpacity.Size = new System.Drawing.Size(154, 92);
@ -265,58 +271,75 @@
this.halfToolStripMenuItem1, this.halfToolStripMenuItem1,
this.quarterToolStripMenuItem1, this.quarterToolStripMenuItem1,
this.toolStripSeparator3, this.toolStripSeparator3,
this.fullscreenToolStripMenuItem1}); this.fullscreenToolStripMenuItem1,
this.toolStripSeparator2,
this.restorePositionAndSizeToolStripMenuItem});
this.menuResize.Name = "menuResize"; this.menuResize.Name = "menuResize";
this.menuResize.OwnerItem = this.resizeToolStripMenuItem; this.menuResize.OwnerItem = this.resizeToolStripMenuItem;
this.menuResize.Size = new System.Drawing.Size(165, 120); this.menuResize.Size = new System.Drawing.Size(218, 170);
this.menuResize.Opening += new System.ComponentModel.CancelEventHandler(this.Menu_Resize_opening); this.menuResize.Opening += new System.ComponentModel.CancelEventHandler(this.Menu_Resize_opening);
// //
// doubleToolStripMenuItem1 // doubleToolStripMenuItem1
// //
this.doubleToolStripMenuItem1.Name = "doubleToolStripMenuItem1"; this.doubleToolStripMenuItem1.Name = "doubleToolStripMenuItem1";
this.doubleToolStripMenuItem1.Size = new System.Drawing.Size(164, 22); this.doubleToolStripMenuItem1.Size = new System.Drawing.Size(217, 22);
this.doubleToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitDouble; this.doubleToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitDouble;
this.doubleToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Double); this.doubleToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Double);
// //
// fitToWindowToolStripMenuItem1 // fitToWindowToolStripMenuItem1
// //
this.fitToWindowToolStripMenuItem1.Name = "fitToWindowToolStripMenuItem1"; this.fitToWindowToolStripMenuItem1.Name = "fitToWindowToolStripMenuItem1";
this.fitToWindowToolStripMenuItem1.Size = new System.Drawing.Size(164, 22); this.fitToWindowToolStripMenuItem1.Size = new System.Drawing.Size(217, 22);
this.fitToWindowToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitOriginal; this.fitToWindowToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitOriginal;
this.fitToWindowToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_FitToWindow); this.fitToWindowToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_FitToWindow);
// //
// halfToolStripMenuItem1 // halfToolStripMenuItem1
// //
this.halfToolStripMenuItem1.Name = "halfToolStripMenuItem1"; this.halfToolStripMenuItem1.Name = "halfToolStripMenuItem1";
this.halfToolStripMenuItem1.Size = new System.Drawing.Size(164, 22); this.halfToolStripMenuItem1.Size = new System.Drawing.Size(217, 22);
this.halfToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitHalf; this.halfToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitHalf;
this.halfToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Half); this.halfToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Half);
// //
// quarterToolStripMenuItem1 // quarterToolStripMenuItem1
// //
this.quarterToolStripMenuItem1.Name = "quarterToolStripMenuItem1"; this.quarterToolStripMenuItem1.Name = "quarterToolStripMenuItem1";
this.quarterToolStripMenuItem1.Size = new System.Drawing.Size(164, 22); this.quarterToolStripMenuItem1.Size = new System.Drawing.Size(217, 22);
this.quarterToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitQuarter; this.quarterToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitQuarter;
this.quarterToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Quarter); this.quarterToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Quarter);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(161, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(214, 6);
// //
// fullscreenToolStripMenuItem1 // fullscreenToolStripMenuItem1
// //
this.fullscreenToolStripMenuItem1.Image = global::OnTopReplica.Properties.Resources.fullscreen; this.fullscreenToolStripMenuItem1.Image = global::OnTopReplica.Properties.Resources.fullscreen;
this.fullscreenToolStripMenuItem1.Name = "fullscreenToolStripMenuItem1"; this.fullscreenToolStripMenuItem1.Name = "fullscreenToolStripMenuItem1";
this.fullscreenToolStripMenuItem1.Size = new System.Drawing.Size(164, 22); this.fullscreenToolStripMenuItem1.Size = new System.Drawing.Size(217, 22);
this.fullscreenToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitFullscreen; this.fullscreenToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitFullscreen;
this.fullscreenToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Fullscreen); this.fullscreenToolStripMenuItem1.Click += new System.EventHandler(this.Menu_Resize_Fullscreen);
// //
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(214, 6);
//
// restorePositionAndSizeToolStripMenuItem
//
this.restorePositionAndSizeToolStripMenuItem.Name = "restorePositionAndSizeToolStripMenuItem";
this.restorePositionAndSizeToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
this.restorePositionAndSizeToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuRecall;
this.restorePositionAndSizeToolStripMenuItem.ToolTipText = global::OnTopReplica.Strings.MenuRecallTT;
this.restorePositionAndSizeToolStripMenuItem.Click += new System.EventHandler(this.Menu_Resize_RecallPosition_click);
//
// dockToolStripMenuItem // dockToolStripMenuItem
// //
this.dockToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.dockToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.disabledToolStripMenuItem,
this.topLeftToolStripMenuItem, this.topLeftToolStripMenuItem,
this.topRightToolStripMenuItem, this.topRightToolStripMenuItem,
this.centerToolStripMenuItem,
this.bottomLeftToolStripMenuItem, this.bottomLeftToolStripMenuItem,
this.bottomRightToolStripMenuItem}); this.bottomRightToolStripMenuItem});
this.dockToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.pos_null; this.dockToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.pos_null;
@ -324,6 +347,16 @@
this.dockToolStripMenuItem.Size = new System.Drawing.Size(168, 22); this.dockToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.dockToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosition; this.dockToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosition;
this.dockToolStripMenuItem.ToolTipText = global::OnTopReplica.Strings.MenuPositionTT; this.dockToolStripMenuItem.ToolTipText = global::OnTopReplica.Strings.MenuPositionTT;
this.dockToolStripMenuItem.DropDownOpening += new System.EventHandler(this.Menu_Position_Opening);
//
// disabledToolStripMenuItem
//
this.disabledToolStripMenuItem.Checked = true;
this.disabledToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.disabledToolStripMenuItem.Name = "disabledToolStripMenuItem";
this.disabledToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.disabledToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosDisabled;
this.disabledToolStripMenuItem.Click += new System.EventHandler(this.Menu_Position_Disable);
// //
// topLeftToolStripMenuItem // topLeftToolStripMenuItem
// //
@ -341,6 +374,14 @@
this.topRightToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosTopRight; this.topRightToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosTopRight;
this.topRightToolStripMenuItem.Click += new System.EventHandler(this.Menu_Position_TopRight); this.topRightToolStripMenuItem.Click += new System.EventHandler(this.Menu_Position_TopRight);
// //
// centerToolStripMenuItem
//
this.centerToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.pos_center;
this.centerToolStripMenuItem.Name = "centerToolStripMenuItem";
this.centerToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.centerToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuPosCenter;
this.centerToolStripMenuItem.Click += new System.EventHandler(this.Menu_Position_Center);
//
// bottomLeftToolStripMenuItem // bottomLeftToolStripMenuItem
// //
this.bottomLeftToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.pos_bottomleft; this.bottomLeftToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.pos_bottomleft;
@ -568,6 +609,10 @@
private System.Windows.Forms.ToolStripMenuItem clickThroughToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem clickThroughToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem groupSwitchModeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem groupSwitchModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enableClickthroughToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem enableClickthroughToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem centerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem disabledToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem restorePositionAndSizeToolStripMenuItem;
} }
} }

View file

@ -8,6 +8,8 @@ using VistaControls.TaskDialog;
using System.Collections.Generic; using System.Collections.Generic;
using OnTopReplica.Native; using OnTopReplica.Native;
using OnTopReplica.Update; using OnTopReplica.Update;
using OnTopReplica.StartupOptions;
using OnTopReplica.WindowSeekers;
namespace OnTopReplica { namespace OnTopReplica {
@ -19,18 +21,23 @@ namespace OnTopReplica {
Panel _sidePanelContainer; Panel _sidePanelContainer;
//Managers //Managers
WindowManager _windowManager = new WindowManager(); BaseWindowSeeker _windowSeeker = new TaskWindowSeeker {
SkipNotVisibleWindows = true
};
MessagePumpManager _msgPumpManager = new MessagePumpManager(); MessagePumpManager _msgPumpManager = new MessagePumpManager();
UpdateManager _updateManager = new UpdateManager(); UpdateManager _updateManager = new UpdateManager();
FormBorderStyle _defaultBorderStyle; Options _startupOptions;
public MainForm() { public MainForm(Options startupOptions) {
_startupOptions = startupOptions;
//WinForms init pass
InitializeComponent(); InitializeComponent();
KeepAspectRatio = false; KeepAspectRatio = false;
GlassEnabled = true;
//Store default values //Store default values
_defaultBorderStyle = FormBorderStyle;
_nonClickThroughKey = TransparencyKey; _nonClickThroughKey = TransparencyKey;
//Thumbnail panel //Thumbnail panel
@ -97,18 +104,20 @@ namespace OnTopReplica {
} }
} }
protected override void OnShown(EventArgs e) { protected override void OnHandleCreated(EventArgs e){
base.OnShown(e); base.OnHandleCreated(e);
_windowSeeker.OwnerHandle = this.Handle;
//Platform specific form initialization //Platform specific form initialization
Program.Platform.InitForm(this); Program.Platform.InitForm(this);
//Glassify window
GlassEnabled = true;
} }
protected override void OnHandleCreated(EventArgs e) { protected override void OnShown(EventArgs e) {
base.OnHandleCreated(e); base.OnShown(e);
//Apply startup options
_startupOptions.Apply(this);
//Check for updates //Check for updates
_updateManager.UpdateCheckCompleted += new EventHandler<UpdateCheckCompletedEventArgs>(UpdateManager_CheckCompleted); _updateManager.UpdateCheckCompleted += new EventHandler<UpdateCheckCompletedEventArgs>(UpdateManager_CheckCompleted);
@ -131,10 +140,19 @@ namespace OnTopReplica {
fullMargins; fullMargins;
} }
protected override void OnResizeEnd(EventArgs e) {
base.OnResizeEnd(e);
//If locked in position, move accordingly
if (PositionLock.HasValue) {
this.SetScreenPosition(PositionLock.Value);
}
}
protected override void OnActivated(EventArgs e) { protected override void OnActivated(EventArgs e) {
base.OnActivated(e); base.OnActivated(e);
//Deactivate click-through if reactivated //Deactivate click-through if form is reactivated
if (ClickThroughEnabled) { if (ClickThroughEnabled) {
ClickThroughEnabled = false; ClickThroughEnabled = false;
} }
@ -146,7 +164,7 @@ namespace OnTopReplica {
base.OnDeactivate(e); base.OnDeactivate(e);
//HACK: sometimes, even if TopMost is true, the window loses its "always on top" status. //HACK: sometimes, even if TopMost is true, the window loses its "always on top" status.
// This is an attempt of a fix that probably won't work... // This is a fix attempt that probably won't work...
if (!IsFullscreen) { //fullscreen mode doesn't use TopMost if (!IsFullscreen) { //fullscreen mode doesn't use TopMost
TopMost = false; TopMost = false;
TopMost = true; TopMost = true;
@ -269,8 +287,8 @@ namespace OnTopReplica {
IsFullscreen = false; IsFullscreen = false;
} }
//Disable click forwarding //Disable click forwarding
else if (_thumbnailPanel.ReportThumbnailClicks) { else if (ClickForwardingEnabled) {
_thumbnailPanel.ReportThumbnailClicks = false; ClickForwardingEnabled = false;
} }
} }
} }
@ -302,6 +320,7 @@ namespace OnTopReplica {
bool _isFullscreen = false; bool _isFullscreen = false;
Point _preFullscreenLocation; Point _preFullscreenLocation;
Size _preFullscreenSize; Size _preFullscreenSize;
FormBorderStyle _preFullscreenBorderStyle;
public bool IsFullscreen { public bool IsFullscreen {
get { get {
@ -314,26 +333,30 @@ namespace OnTopReplica {
return; return;
CloseSidePanel(); //on switch, always hide side panels CloseSidePanel(); //on switch, always hide side panels
GlassEnabled = !value;
FormBorderStyle = (value) ? FormBorderStyle.None : _defaultBorderStyle;
TopMost = !value;
HandleMouseMove = !value;
//Location and size //Location and size
if (value) { if (value) {
_preFullscreenLocation = Location; _preFullscreenLocation = Location;
_preFullscreenSize = Size; _preFullscreenSize = ClientSize;
_preFullscreenBorderStyle = FormBorderStyle;
var currentScreen = Screen.FromControl(this); var currentScreen = Screen.FromControl(this);
FormBorderStyle = FormBorderStyle.None;
Size = currentScreen.WorkingArea.Size; Size = currentScreen.WorkingArea.Size;
Location = currentScreen.WorkingArea.Location; Location = currentScreen.WorkingArea.Location;
} }
else { else {
FormBorderStyle = _preFullscreenBorderStyle;
Location = _preFullscreenLocation; Location = _preFullscreenLocation;
Size = _preFullscreenSize; ClientSize = _preFullscreenSize;
RefreshAspectRatio(); RefreshAspectRatio();
} }
//Common
GlassEnabled = !value;
TopMost = !value;
HandleMouseMove = !value;
_isFullscreen = value; _isFullscreen = value;
Program.Platform.OnFormStateChange(this); Program.Platform.OnFormStateChange(this);
@ -349,13 +372,18 @@ namespace OnTopReplica {
/// </summary> /// </summary>
/// <param name="handle">Handle to the window to clone.</param> /// <param name="handle">Handle to the window to clone.</param>
/// <param name="region">Region of the window to clone.</param> /// <param name="region">Region of the window to clone.</param>
public void SetThumbnail(WindowHandle handle, StoredRegion region) { public void SetThumbnail(WindowHandle handle, Rectangle? region) {
try { try {
CurrentThumbnailWindowHandle = handle; CurrentThumbnailWindowHandle = handle;
_thumbnailPanel.SetThumbnailHandle(handle); _thumbnailPanel.SetThumbnailHandle(handle);
if (region != null) #if DEBUG
_thumbnailPanel.SelectedRegion = region.Rect; string windowClass = WindowMethods.GetWindowClass(handle.Handle);
Console.WriteLine("Cloning window HWND {0} of class {1}.", handle.Handle, windowClass);
#endif
if (region.HasValue)
_thumbnailPanel.SelectedRegion = region.Value;
else else
_thumbnailPanel.ConstrainToRegion = false; _thumbnailPanel.ConstrainToRegion = false;
@ -470,33 +498,6 @@ namespace OnTopReplica {
#endregion #endregion
#region Click-through
bool _clickThrough = false;
Color _nonClickThroughKey;
public bool ClickThroughEnabled {
get {
return _clickThrough;
}
set {
//Adjust opacity if fully opaque
if (value && Opacity == 1.0)
Opacity = 0.75;
if (!value)
Opacity = 1.0;
//Enable transparency and force as top-most
TransparencyKey = (value) ? Color.Black : _nonClickThroughKey;
if (value)
TopMost = true;
_clickThrough = value;
}
}
#endregion
#region Accessors #region Accessors
/// <summary> /// <summary>

View file

@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Properties;
using VistaControls.TaskDialog;
using System.Drawing;
using System.Windows.Forms;
namespace OnTopReplica {
//Contains some feature implementations of MainForm
partial class MainForm {
#region Click forwarding
public bool ClickForwardingEnabled {
get {
return _thumbnailPanel.ReportThumbnailClicks;
}
set {
if (value && Settings.Default.FirstTimeClickForwarding) {
TaskDialog dlg = new TaskDialog(Strings.InfoClickForwarding, Strings.InfoClickForwardingTitle, Strings.InfoClickForwardingContent) {
CommonButtons = TaskDialogButton.Yes | TaskDialogButton.No
};
if (dlg.Show(this).CommonButton == Result.No)
return;
Settings.Default.FirstTimeClickForwarding = false;
}
_thumbnailPanel.ReportThumbnailClicks = value;
}
}
#endregion
#region Click-through
bool _clickThrough = false;
Color _nonClickThroughKey;
public bool ClickThroughEnabled {
get {
return _clickThrough;
}
set {
//Adjust opacity if fully opaque
/*if (value && Opacity == 1.0)
Opacity = 0.75;
if (!value)
Opacity = 1.0;*/
//Enable transparency and force as top-most
TransparencyKey = (value) ? Color.Black : _nonClickThroughKey;
if (value)
TopMost = true;
_clickThrough = value;
}
}
#endregion
#region Chrome
public bool IsChromeVisible {
get {
return (FormBorderStyle == FormBorderStyle.SizableToolWindow);
}
set {
if (!value) {
Location = new Point {
X = Location.X + SystemInformation.FrameBorderSize.Width,
Y = Location.Y + SystemInformation.FrameBorderSize.Height
};
FormBorderStyle = FormBorderStyle.None;
}
else if(value) {
Location = new Point {
X = Location.X - SystemInformation.FrameBorderSize.Width,
Y = Location.Y - SystemInformation.FrameBorderSize.Height
};
FormBorderStyle = FormBorderStyle.SizableToolWindow;
}
Program.Platform.OnFormStateChange(this);
Invalidate();
}
}
#endregion
#region Position lock
ScreenPosition? _positionLock = null;
/// <summary>
/// Gets or sets the screen position where the window is currently locked in.
/// </summary>
public ScreenPosition? PositionLock {
get {
return _positionLock;
}
set {
if (value != null)
this.SetScreenPosition(value.Value);
_positionLock = value;
}
}
#endregion
}
}

View file

@ -38,18 +38,24 @@ namespace OnTopReplica {
return new Point(finX, finY); return new Point(finX, finY);
} }
private int ChromeBorderVertical { /// <summary>
/// Gets the window's vertical chrome size.
/// </summary>
public int ChromeBorderVertical {
get { get {
if (FormBorderStyle == _defaultBorderStyle) if (IsChromeVisible)
return SystemInformation.FrameBorderSize.Height; return SystemInformation.FrameBorderSize.Height;
else else
return 0; return 0;
} }
} }
private int ChromeBorderHorizontal { /// <summary>
/// Gets the window's horizontal chrome size.
/// </summary>
public int ChromeBorderHorizontal {
get { get {
if (FormBorderStyle == _defaultBorderStyle) if (IsChromeVisible)
return SystemInformation.FrameBorderSize.Width; return SystemInformation.FrameBorderSize.Width;
else else
return 0; return 0;

View file

@ -20,8 +20,8 @@ namespace OnTopReplica {
selectRegionToolStripMenuItem.Enabled = showing; selectRegionToolStripMenuItem.Enabled = showing;
switchToWindowToolStripMenuItem.Enabled = showing; switchToWindowToolStripMenuItem.Enabled = showing;
resizeToolStripMenuItem.Enabled = showing; resizeToolStripMenuItem.Enabled = showing;
chromeToolStripMenuItem.Checked = (FormBorderStyle == _defaultBorderStyle); chromeToolStripMenuItem.Checked = IsChromeVisible;
clickForwardingToolStripMenuItem.Checked = _thumbnailPanel.ReportThumbnailClicks; clickForwardingToolStripMenuItem.Checked = ClickForwardingEnabled;
chromeToolStripMenuItem.Enabled = showing; chromeToolStripMenuItem.Enabled = showing;
clickThroughToolStripMenuItem.Enabled = showing; clickThroughToolStripMenuItem.Enabled = showing;
clickForwardingToolStripMenuItem.Enabled = showing; clickForwardingToolStripMenuItem.Enabled = showing;
@ -29,8 +29,9 @@ namespace OnTopReplica {
} }
private void Menu_Windows_opening(object sender, CancelEventArgs e) { private void Menu_Windows_opening(object sender, CancelEventArgs e) {
_windowManager.Refresh(WindowManager.EnumerationMode.TaskWindows); _windowSeeker.Refresh();
WindowListHelper.PopulateMenu(this, _windowManager, (ToolStrip)sender, var menu = (ToolStrip)sender;
menu.PopulateMenu(this, _windowSeeker,
CurrentThumbnailWindowHandle, new EventHandler(Menu_Windows_itemclick)); CurrentThumbnailWindowHandle, new EventHandler(Menu_Windows_itemclick));
} }
@ -50,7 +51,9 @@ namespace OnTopReplica {
} }
var selectionData = (WindowListHelper.WindowSelectionData)tsi.Tag; var selectionData = (WindowListHelper.WindowSelectionData)tsi.Tag;
SetThumbnail(selectionData.Handle, selectionData.Region); Rectangle? bounds = (selectionData.Region != null)
? (Rectangle?)selectionData.Region.Bounds : null;
SetThumbnail(selectionData.Handle, bounds);
} }
private void Menu_Switch_click(object sender, EventArgs e) { private void Menu_Switch_click(object sender, EventArgs e) {
@ -66,17 +69,7 @@ namespace OnTopReplica {
} }
private void Menu_ClickForwarding_click(object sender, EventArgs e) { private void Menu_ClickForwarding_click(object sender, EventArgs e) {
if (Settings.Default.FirstTimeClickForwarding && !_thumbnailPanel.ReportThumbnailClicks) { ClickForwardingEnabled = !ClickForwardingEnabled;
TaskDialog dlg = new TaskDialog(Strings.InfoClickForwarding, Strings.InfoClickForwardingTitle, Strings.InfoClickForwardingContent) {
CommonButtons = TaskDialogButton.Yes | TaskDialogButton.No
};
if (dlg.Show(this).CommonButton == Result.No)
return;
Settings.Default.FirstTimeClickForwarding = false;
}
_thumbnailPanel.ReportThumbnailClicks = !_thumbnailPanel.ReportThumbnailClicks;
} }
private void Menu_ClickThrough_click(object sender, EventArgs e) { private void Menu_ClickThrough_click(object sender, EventArgs e) {
@ -116,6 +109,8 @@ namespace OnTopReplica {
private void Menu_Resize_opening(object sender, CancelEventArgs e) { private void Menu_Resize_opening(object sender, CancelEventArgs e) {
if (!_thumbnailPanel.IsShowingThumbnail) if (!_thumbnailPanel.IsShowingThumbnail)
e.Cancel = true; e.Cancel = true;
restorePositionAndSizeToolStripMenuItem.Checked = Settings.Default.RestoreSizeAndPosition;
} }
private void Menu_Resize_Double(object sender, EventArgs e) { private void Menu_Resize_Double(object sender, EventArgs e) {
@ -138,40 +133,41 @@ namespace OnTopReplica {
IsFullscreen = true; IsFullscreen = true;
} }
private void Menu_Position_TopLeft(object sender, EventArgs e) { private void Menu_Resize_RecallPosition_click(object sender, EventArgs e) {
var screen = Screen.FromControl(this); Settings.Default.RestoreSizeAndPosition = !Settings.Default.RestoreSizeAndPosition;
}
Location = new Point( private void Menu_Position_Opening(object sender, EventArgs e) {
screen.WorkingArea.Left - ChromeBorderHorizontal, disabledToolStripMenuItem.Checked = (PositionLock == null);
screen.WorkingArea.Top - ChromeBorderVertical topLeftToolStripMenuItem.Checked = (PositionLock == ScreenPosition.TopLeft);
); topRightToolStripMenuItem.Checked = (PositionLock == ScreenPosition.TopRight);
centerToolStripMenuItem.Checked = (PositionLock == ScreenPosition.Center);
bottomLeftToolStripMenuItem.Checked = (PositionLock == ScreenPosition.BottomLeft);
bottomRightToolStripMenuItem.Checked = (PositionLock == ScreenPosition.BottomRight);
}
private void Menu_Position_Disable(object sender, EventArgs e) {
PositionLock = null;
}
private void Menu_Position_TopLeft(object sender, EventArgs e) {
PositionLock = ScreenPosition.TopLeft;
} }
private void Menu_Position_TopRight(object sender, EventArgs e) { private void Menu_Position_TopRight(object sender, EventArgs e) {
var screen = Screen.FromControl(this); PositionLock = ScreenPosition.TopRight;
}
Location = new Point( private void Menu_Position_Center(object sender, EventArgs e) {
screen.WorkingArea.Width - Size.Width + ChromeBorderHorizontal, PositionLock = ScreenPosition.Center;
screen.WorkingArea.Top - ChromeBorderVertical
);
} }
private void Menu_Position_BottomLeft(object sender, EventArgs e) { private void Menu_Position_BottomLeft(object sender, EventArgs e) {
var screen = Screen.FromControl(this); PositionLock = ScreenPosition.BottomLeft;
Location = new Point(
screen.WorkingArea.Left - ChromeBorderHorizontal,
screen.WorkingArea.Height - Size.Height + ChromeBorderVertical
);
} }
private void Menu_Position_BottomRight(object sender, EventArgs e) { private void Menu_Position_BottomRight(object sender, EventArgs e) {
var screen = Screen.FromControl(this); PositionLock = ScreenPosition.BottomRight;
Location = new Point(
screen.WorkingArea.Width - Size.Width + ChromeBorderHorizontal,
screen.WorkingArea.Height - Size.Height + ChromeBorderVertical
);
} }
private void Menu_Reduce_click(object sender, EventArgs e) { private void Menu_Reduce_click(object sender, EventArgs e) {
@ -180,23 +176,7 @@ namespace OnTopReplica {
} }
private void Menu_Chrome_click(object sender, EventArgs e) { private void Menu_Chrome_click(object sender, EventArgs e) {
if (FormBorderStyle == _defaultBorderStyle) { IsChromeVisible = !IsChromeVisible;
FormBorderStyle = FormBorderStyle.None;
Location = new Point {
X = Location.X + SystemInformation.FrameBorderSize.Width,
Y = Location.Y + SystemInformation.FrameBorderSize.Height
};
}
else {
FormBorderStyle = _defaultBorderStyle;
Location = new Point {
X = Location.X - SystemInformation.FrameBorderSize.Width,
Y = Location.Y - SystemInformation.FrameBorderSize.Height
};
}
Program.Platform.OnFormStateChange(this);
Invalidate();
} }
private void Menu_Language_click(object sender, EventArgs e) { private void Menu_Language_click(object sender, EventArgs e) {

View file

@ -1,8 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Windows.Forms; using System.Windows.Forms;
using OnTopReplica.MessagePumpProcessors;
using OnTopReplica.Native; using OnTopReplica.Native;
namespace OnTopReplica { namespace OnTopReplica {
@ -12,6 +11,15 @@ namespace OnTopReplica {
public MainForm Form { get; private set; } public MainForm Form { get; private set; }
private void Register(IMessagePumpProcessor processor, MainForm form) {
_processors[processor.GetType()] = processor;
processor.Initialize(form);
#if DEBUG
Console.WriteLine("Registered message pump processor: {0}", processor.GetType());
#endif
}
/// <summary> /// <summary>
/// Instantiates all message pump processors and registers them on the main form. /// Instantiates all message pump processors and registers them on the main form.
/// </summary> /// </summary>
@ -29,18 +37,10 @@ namespace OnTopReplica {
#endif #endif
} }
foreach (var t in Assembly.GetExecutingAssembly().GetTypes()) { //Register message pump processors
if (typeof(IMessagePumpProcessor).IsAssignableFrom(t) && !t.IsAbstract) { Register(new WindowKeeper(), form);
var instance = (IMessagePumpProcessor)Activator.CreateInstance(t); Register(new HotKeyManager(), form);
instance.Initialize(form); Register(new GroupSwitchManager(), form);
_processors[t] = instance;
#if DEBUG
Console.WriteLine("Registered message pump processor: {0}", t);
#endif
}
}
} }
/// <summary> /// <summary>

View file

@ -1,41 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using OnTopReplica.Native;
using System.Runtime.InteropServices;
namespace OnTopReplica.MessagePumpProcessors {
class TitleSetter : BaseMessagePumpProcessor {
const string Title = "OnTopReplica";
public override bool Process(ref Message msg) {
switch (msg.Msg) {
case WM.GETTEXT: {
Console.WriteLine("GetText");
int maxLen = msg.WParam.ToInt32();
byte[] strBytes = Encoding.UTF8.GetBytes(Title);
byte[] termBytes = new byte[strBytes.Length + 1];
strBytes.CopyTo(termBytes, 0);
termBytes[strBytes.Length] = 0;
Marshal.Copy(termBytes, 0, msg.LParam, Math.Min(maxLen, Title.Length + 1));
}
goto case WM.GETTEXTLENGTH;
case WM.GETTEXTLENGTH:
Console.WriteLine("GetTextLength");
msg.Result = (IntPtr)Title.Length;
return true;
}
return false;
}
protected override void Shutdown() {
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -37,6 +37,17 @@ namespace OnTopReplica.Native {
return String.Empty; return String.Empty;
} }
const int MaxClassLength = 255;
public static string GetWindowClass(IntPtr hwnd) {
var sb = new StringBuilder(MaxClassLength + 1);
RealGetWindowClass(hwnd, sb, MaxClassLength);
return sb.ToString();
}
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern uint RealGetWindowClass(IntPtr hwnd, [Out] StringBuilder lpString, uint maxCount);
public enum WindowLong { public enum WindowLong {
WndProc = (-4), WndProc = (-4),
HInstance = (-6), HInstance = (-6),

View file

@ -48,7 +48,7 @@
<WebPage>publish.htm</WebPage> <WebPage>publish.htm</WebPage>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish> <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.0.2.%2a</ApplicationVersion> <ApplicationVersion>3.2.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
@ -106,11 +106,17 @@
<Compile Include="AboutForm.Designer.cs"> <Compile Include="AboutForm.Designer.cs">
<DependentUpon>AboutForm.cs</DependentUpon> <DependentUpon>AboutForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Actions.cs" />
<Compile Include="AspectRatioForm.cs"> <Compile Include="AspectRatioForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="CloneClickEventArgs.cs" /> <Compile Include="CloneClickEventArgs.cs" />
<Compile Include="CloseRequestEventArgs.cs" /> <Compile Include="CloseRequestEventArgs.cs" />
<Compile Include="EnumerableExtensions.cs" />
<Compile Include="ExtensionAttribute.cs" />
<Compile Include="MainForm_Features.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm_Gui.cs"> <Compile Include="MainForm_Gui.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -124,12 +130,16 @@
<Compile Include="MessagePumpProcessors\GroupSwitchManager.cs" /> <Compile Include="MessagePumpProcessors\GroupSwitchManager.cs" />
<Compile Include="IMessagePumpProcessor.cs" /> <Compile Include="IMessagePumpProcessor.cs" />
<Compile Include="MessagePumpProcessors\BaseMessagePumpProcessor.cs" /> <Compile Include="MessagePumpProcessors\BaseMessagePumpProcessor.cs" />
<None Include="MessagePumpProcessors\TitleSetter.cs" />
<Compile Include="MessagePumpProcessors\WindowKeeper.cs" /> <Compile Include="MessagePumpProcessors\WindowKeeper.cs" />
<Compile Include="Native\ErrorMethods.cs" /> <Compile Include="Native\ErrorMethods.cs" />
<Compile Include="Native\HookMethods.cs" /> <Compile Include="Native\HookMethods.cs" />
<Compile Include="Native\HotKeyMethods.cs" /> <Compile Include="Native\HotKeyMethods.cs" />
<Compile Include="Native\HT.cs" /> <Compile Include="Native\HT.cs" />
<Compile Include="Pair.cs" />
<Compile Include="WindowSeekers\BaseWindowSeeker.cs" />
<Compile Include="WindowSeekers\ByClassWindowSeeker.cs" />
<Compile Include="WindowSeekers\ByTitleWindowSeeker.cs" />
<Compile Include="WindowSeekers\TaskWindowSeeker.cs" />
<None Include="Native\ITaskBarList.cs" /> <None Include="Native\ITaskBarList.cs" />
<Compile Include="Native\InputMethods.cs" /> <Compile Include="Native\InputMethods.cs" />
<Compile Include="Native\MessagingMethods.cs" /> <Compile Include="Native\MessagingMethods.cs" />
@ -141,7 +151,9 @@
<Compile Include="Native\WindowMethods.cs" /> <Compile Include="Native\WindowMethods.cs" />
<Compile Include="Native\WM.cs" /> <Compile Include="Native\WM.cs" />
<Compile Include="Native\WMSZ.cs" /> <Compile Include="Native\WMSZ.cs" />
<Compile Include="NDesk\Options\Options.cs" />
<Compile Include="NotificationIcon.cs" /> <Compile Include="NotificationIcon.cs" />
<Compile Include="ScreenPosition.cs" />
<Compile Include="SidePanel.cs"> <Compile Include="SidePanel.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@ -151,6 +163,18 @@
<Compile Include="SidePanels\GroupSwitchPanel.Designer.cs"> <Compile Include="SidePanels\GroupSwitchPanel.Designer.cs">
<DependentUpon>GroupSwitchPanel.cs</DependentUpon> <DependentUpon>GroupSwitchPanel.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="StartupOptions\CliStatus.cs" />
<Compile Include="StartupOptions\CommandLineReportForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="StartupOptions\CommandLineReportForm.Designer.cs">
<DependentUpon>CommandLineReportForm.cs</DependentUpon>
</Compile>
<Compile Include="StartupOptions\RectangleConverter.cs" />
<Compile Include="StartupOptions\Factory.cs" />
<Compile Include="StartupOptions\Options.cs" />
<Compile Include="StartupOptions\ScreenPositionConverter.cs" />
<Compile Include="StartupOptions\SizeConverter.cs" />
<Compile Include="StoredRegionComparer.cs" /> <Compile Include="StoredRegionComparer.cs" />
<Compile Include="Native\WindowsSevenMethods.cs" /> <Compile Include="Native\WindowsSevenMethods.cs" />
<None Include="Native\CommonControls.cs" /> <None Include="Native\CommonControls.cs" />
@ -186,6 +210,9 @@
<DependentUpon>GroupSwitchPanel.cs</DependentUpon> <DependentUpon>GroupSwitchPanel.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="StartupOptions\CommandLineReportForm.resx">
<DependentUpon>CommandLineReportForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Strings.cs.resx"> <EmbeddedResource Include="Strings.cs.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.cs.Designer.cs</LastGenOutput> <LastGenOutput>Strings.cs.Designer.cs</LastGenOutput>
@ -240,6 +267,11 @@
</Compile> </Compile>
<Compile Include="StoredRegion.cs" /> <Compile Include="StoredRegion.cs" />
<Compile Include="StoredRegionArray.cs" /> <Compile Include="StoredRegionArray.cs" />
<Compile Include="Strings.it.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.it.resx</DependentUpon>
</Compile>
<Compile Include="ThumbnailPanel.cs"> <Compile Include="ThumbnailPanel.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
@ -249,7 +281,6 @@
<Compile Include="Win32Helper.cs" /> <Compile Include="Win32Helper.cs" />
<Compile Include="WindowHandle.cs" /> <Compile Include="WindowHandle.cs" />
<Compile Include="WindowListHelper.cs" /> <Compile Include="WindowListHelper.cs" />
<Compile Include="WindowManager.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Assets\windows.png" /> <None Include="Assets\windows.png" />
@ -273,6 +304,7 @@
<None Include="Assets\fullscreen.png" /> <None Include="Assets\fullscreen.png" />
<None Include="Assets\clickforwarding.png" /> <None Include="Assets\clickforwarding.png" />
<None Include="Assets\groupmode.png" /> <None Include="Assets\groupmode.png" />
<None Include="Assets\pos_center.png" />
<Content Include="Assets\xiao_arrow.png" /> <Content Include="Assets\xiao_arrow.png" />
<None Include="Assets\xiao_help.png" /> <None Include="Assets\xiao_help.png" />
<None Include="Assets\window_opacity_new.png" /> <None Include="Assets\window_opacity_new.png" />

View file

@ -15,4 +15,8 @@
<PropertyGroup> <PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging> <EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>
</StartArguments>
</PropertyGroup>
</Project> </Project>

15
OnTopReplica/Pair.cs Normal file
View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OnTopReplica {
/// <summary>
/// Simple tuple with two values.
/// </summary>
struct Pair<T1, T2> {
public T1 Item1;
public T2 Item2;
}
}

View file

@ -9,6 +9,7 @@ using System.IO;
using VistaControls.TaskDialog; using VistaControls.TaskDialog;
using OnTopReplica.Update; using OnTopReplica.Update;
using System.Reflection; using System.Reflection;
using OnTopReplica.StartupOptions;
namespace OnTopReplica { namespace OnTopReplica {
@ -26,7 +27,7 @@ namespace OnTopReplica {
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() { static void Main(string[] args) {
//Hook abort handler //Hook abort handler
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
@ -44,6 +45,16 @@ namespace OnTopReplica {
Settings.Default.Upgrade(); Settings.Default.Upgrade();
Settings.Default.MustUpdate = false; Settings.Default.MustUpdate = false;
} }
//Load startup options
var options = StartupOptions.Factory.CreateOptions(args);
string optionsMessage = options.DebugMessage;
if (!string.IsNullOrEmpty(optionsMessage)) { //show dialog if debug message present or if parsing failed
var dlg = new CommandLineReportForm(options.Status, optionsMessage);
dlg.ShowDialog();
}
if (options.Status == CliStatus.Information || options.Status == CliStatus.Error)
return;
bool mustReloadForm = false; bool mustReloadForm = false;
Point reloadLocation = new Point(); Point reloadLocation = new Point();
@ -55,7 +66,7 @@ namespace OnTopReplica {
Settings.Default.Language = _languageChangeCode; Settings.Default.Language = _languageChangeCode;
_languageChangeCode = null; _languageChangeCode = null;
_mainForm = new MainForm(); _mainForm = new MainForm(options);
if (mustReloadForm) { if (mustReloadForm) {
_mainForm.Location = reloadLocation; _mainForm.Location = reloadLocation;
_mainForm.Size = reloadSize; _mainForm.Size = reloadSize;
@ -71,6 +82,8 @@ namespace OnTopReplica {
while (_languageChangeCode != null); while (_languageChangeCode != null);
//Persist settings //Persist settings
Settings.Default.RestoreLastPosition = reloadLocation;
Settings.Default.RestoreLastSize = reloadSize;
Settings.Default.Save(); Settings.Default.Save();
} }

View file

@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.1.0")] [assembly: AssemblyVersion("3.2.0.0")]
[assembly: AssemblyFileVersion("3.1.1.0")] [assembly: AssemblyFileVersion("3.2.0.0")]

View file

@ -165,6 +165,13 @@ namespace OnTopReplica.Properties {
} }
} }
internal static System.Drawing.Bitmap pos_center {
get {
object obj = ResourceManager.GetObject("pos_center", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap pos_null { internal static System.Drawing.Bitmap pos_null {
get { get {
object obj = ResourceManager.GetObject("pos_null", resourceCulture); object obj = ResourceManager.GetObject("pos_null", resourceCulture);

View file

@ -223,8 +223,11 @@
<data name="flag_usa" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="flag_usa" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\flag_usa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Assets\flag_usa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupmode" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="groupmode" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\groupmode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Assets\groupmode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="pos_center" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\pos_center.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View file

@ -132,25 +132,37 @@ namespace OnTopReplica.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")] [global::System.Configuration.DefaultSettingValueAttribute("False")]
public string Setting { public bool RestoreSizeAndPosition {
get { get {
return ((string)(this["Setting"])); return ((bool)(this["RestoreSizeAndPosition"]));
} }
set { set {
this["Setting"] = value; this["RestoreSizeAndPosition"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")] [global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
public string Setting1 { public global::System.Drawing.Size RestoreLastSize {
get { get {
return ((string)(this["Setting1"])); return ((global::System.Drawing.Size)(this["RestoreLastSize"]));
} }
set { set {
this["Setting1"] = value; this["RestoreLastSize"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
public global::System.Drawing.Point RestoreLastPosition {
get {
return ((global::System.Drawing.Point)(this["RestoreLastPosition"]));
}
set {
this["RestoreLastPosition"] = value;
} }
} }
} }

View file

@ -29,11 +29,14 @@
<Setting Name="FullscreenAlwaysOnTop" Type="System.Boolean" Scope="User"> <Setting Name="FullscreenAlwaysOnTop" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="Setting" Type="System.String" Scope="User"> <Setting Name="RestoreSizeAndPosition" Type="System.Boolean" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="Setting1" Type="System.String" Scope="User"> <Setting Name="RestoreLastSize" Type="System.Drawing.Size" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">0, 0</Value>
</Setting>
<Setting Name="RestoreLastPosition" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View file

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace OnTopReplica {
/// <summary>
/// Describes a resolution independent position.
/// </summary>
enum ScreenPosition {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
Center
}
/// <summary>
/// Extension methods for ScreenPositions.
/// </summary>
static class ScreenPositionExtensions {
/// <summary>
/// Sets the form's screen position in independent coordinates.
/// </summary>
/// <remarks>
/// Position is set relative to the form's current screen.
/// </remarks>
public static void SetScreenPosition(this MainForm form, ScreenPosition position) {
var screen = Screen.FromControl(form);
var wa = screen.WorkingArea;
Point p = new Point();
switch (position) {
case ScreenPosition.TopLeft:
p = new Point(
wa.Left - form.ChromeBorderHorizontal,
wa.Top - form.ChromeBorderVertical
);
break;
case ScreenPosition.TopRight:
p = new Point(
wa.Right - form.Width + form.ChromeBorderHorizontal,
wa.Top - form.ChromeBorderVertical
);
break;
case ScreenPosition.BottomLeft:
p = new Point(
wa.Left - form.ChromeBorderHorizontal,
wa.Bottom - form.Height + form.ChromeBorderVertical
);
break;
case ScreenPosition.BottomRight:
p = new Point(
wa.Right - form.Width + form.ChromeBorderHorizontal,
wa.Bottom - form.Height + form.ChromeBorderVertical
);
break;
case ScreenPosition.Center:
p = new Point(
wa.X + (wa.Width / 2) - (form.Width / 2) - (form.ChromeBorderHorizontal / 2),
wa.Y + (wa.Height / 2) - (form.Height / 2) - (form.ChromeBorderVertical / 2)
);
break;
}
form.Location = p;
}
}
}

View file

@ -4,6 +4,7 @@ using System.Windows.Forms;
using OnTopReplica.Properties; using OnTopReplica.Properties;
using System.Collections.Generic; using System.Collections.Generic;
using OnTopReplica.MessagePumpProcessors; using OnTopReplica.MessagePumpProcessors;
using OnTopReplica.WindowSeekers;
namespace OnTopReplica.SidePanels { namespace OnTopReplica.SidePanels {
partial class GroupSwitchPanel : SidePanel { partial class GroupSwitchPanel : SidePanel {
@ -23,8 +24,8 @@ namespace OnTopReplica.SidePanels {
} }
private void LoadWindowList() { private void LoadWindowList() {
var manager = new WindowManager(); var manager = new TaskWindowSeeker();
manager.Refresh(WindowManager.EnumerationMode.TaskWindows); manager.Refresh();
var imageList = new ImageList(); var imageList = new ImageList();
imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.ColorDepth = ColorDepth.Depth32Bit;
@ -46,7 +47,7 @@ namespace OnTopReplica.SidePanels {
public override void OnClosing(MainForm form) { public override void OnClosing(MainForm form) {
base.OnClosing(form); base.OnClosing(form);
if (_enableOnClose) { if (_enableOnClose && listWindows.SelectedItems.Count > 0) {
List<WindowHandle> ret = new List<WindowHandle>(); List<WindowHandle> ret = new List<WindowHandle>();
foreach (ListViewItem i in listWindows.SelectedItems) { foreach (ListViewItem i in listWindows.SelectedItems) {
ret.Add((WindowHandle)i.Tag); ret.Add((WindowHandle)i.Tag);

View file

@ -55,7 +55,7 @@ namespace OnTopReplica.SidePanels {
return; return;
} }
SetRegion(region.Rect); SetRegion(region.Bounds);
//Select right combobox //Select right combobox
if (comboRegions.Items.Contains(region)) { if (comboRegions.Items.Contains(region)) {
@ -207,7 +207,7 @@ namespace OnTopReplica.SidePanels {
if (region == null) if (region == null)
return; return;
SetRegion(region.Rect); SetRegion(region.Bounds);
} }
} }

View file

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OnTopReplica.StartupOptions {
public enum CliStatus {
/// <summary>
/// No errors while parsing.
/// </summary>
Ok,
/// <summary>
/// User asked for help.
/// </summary>
Information,
/// <summary>
/// Error while parsing.
/// </summary>
Error
}
}

View file

@ -0,0 +1,116 @@
namespace OnTopReplica.StartupOptions {
partial class CommandLineReportForm {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CommandLineReportForm));
this.buttonOk = new System.Windows.Forms.Button();
this.labelInstruction = new System.Windows.Forms.Label();
this.txtDescription = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtCliArgs = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonOk
//
this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Location = new System.Drawing.Point(440, 200);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new System.Drawing.Size(75, 23);
this.buttonOk.TabIndex = 0;
this.buttonOk.Text = "OK";
this.buttonOk.UseVisualStyleBackColor = true;
//
// labelInstruction
//
this.labelInstruction.AutoSize = true;
this.labelInstruction.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInstruction.ForeColor = System.Drawing.SystemColors.HotTrack;
this.labelInstruction.Location = new System.Drawing.Point(12, 10);
this.labelInstruction.Name = "labelInstruction";
this.labelInstruction.Size = new System.Drawing.Size(112, 21);
this.labelInstruction.TabIndex = 1;
this.labelInstruction.Text = "Command line";
//
// txtDescription
//
this.txtDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtDescription.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtDescription.Location = new System.Drawing.Point(12, 42);
this.txtDescription.Multiline = true;
this.txtDescription.Name = "txtDescription";
this.txtDescription.ReadOnly = true;
this.txtDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtDescription.Size = new System.Drawing.Size(503, 152);
this.txtDescription.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 205);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Arguments:";
//
// txtCliArgs
//
this.txtCliArgs.Location = new System.Drawing.Point(79, 202);
this.txtCliArgs.Name = "txtCliArgs";
this.txtCliArgs.ReadOnly = true;
this.txtCliArgs.Size = new System.Drawing.Size(355, 20);
this.txtCliArgs.TabIndex = 4;
//
// CommandLineReportForm
//
this.AcceptButton = this.buttonOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(527, 235);
this.Controls.Add(this.txtCliArgs);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtDescription);
this.Controls.Add(this.labelInstruction);
this.Controls.Add(this.buttonOk);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "CommandLineReportForm";
this.Text = "Command line parameters";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOk;
private System.Windows.Forms.Label labelInstruction;
private System.Windows.Forms.TextBox txtDescription;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtCliArgs;
}
}

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace OnTopReplica.StartupOptions {
public partial class CommandLineReportForm : Form {
public CommandLineReportForm(CliStatus status, string message) {
InitializeComponent();
switch (status) {
case CliStatus.Information:
labelInstruction.Text = "Command line help";
break;
case CliStatus.Error:
labelInstruction.Text = "Command line parsing error";
break;
}
txtDescription.Text = message;
txtCliArgs.Text = Environment.CommandLine;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using OnTopReplica.Properties;
namespace OnTopReplica.StartupOptions {
class Factory {
static Factory() {
//Custom type conversion attributes
TypeDescriptor.AddAttributes(typeof(Size), new TypeConverterAttribute(typeof(SizeConverter)));
TypeDescriptor.AddAttributes(typeof(ScreenPosition), new TypeConverterAttribute(typeof(ScreenPositionConverter)));
TypeDescriptor.AddAttributes(typeof(Rectangle), new TypeConverterAttribute(typeof(RectangleConverter)));
}
public static Options CreateOptions(string[] args) {
var options = new Options();
LoadSettings(options);
ParseCommandLine(args, options);
return options;
}
private static void LoadSettings(Options options) {
if (Settings.Default.RestoreSizeAndPosition) {
options.StartLocation = Settings.Default.RestoreLastPosition;
options.StartSize = Settings.Default.RestoreLastSize;
}
}
private static void ParseCommandLine(string[] args, Options options) {
var cmdOptions = new NDesk.Options.OptionSet()
.Add<long>("windowId=", "Window handle ({HWND}) to be cloned.", id => {
options.WindowId = new IntPtr(id);
})
.Add<string>("windowTitle=", "{TITLE} of the window to be cloned.", s => {
options.WindowTitle = s;
})
.Add<string>("windowClass=", "{CLASS} of the window to be cloned.", s => {
options.WindowClass = s;
})
.Add("v|visible", "If set, only clones windows that are visible.", s => {
options.MustBeVisible = true;
})
.Add<Size>("size=", "Target {SIZE} of the cloned thumbnail.", s => {
options.StartSize = s;
})
.Add<Size>("position=", "Target {COORDINATES} of the OnTopReplica window.", s => {
options.StartLocation = new Point(s.Width, s.Height);
options.StartScreenPosition = null;
})
.Add<ScreenPosition>("screenPosition=", "Resolution independent window position on current screen, with locking (TR|TL|C|BR|BL).", pos => {
options.StartLocation = null;
options.StartScreenPosition = pos;
})
.Add<Rectangle>("r|region=", "Region {BOUNDS} of the original window.", region => {
options.Region = region;
})
.Add<byte>("o|opacity=", "Opacity of the window (0-255).", opacity => {
options.Opacity = opacity;
})
.Add("clickForwarding", "Enables click forwarding.", s => {
options.EnableClickForwarding = true;
})
.Add("chromeOff", "Disables the window's chrome (border).", s => {
options.DisableChrome = true;
})
.Add("h|help|?", "Show command line help.", s => {
options.Status = CliStatus.Information;
});
List<string> values;
try {
values = cmdOptions.Parse(args);
}
catch (NDesk.Options.OptionException ex) {
options.DebugMessageWriter.WriteLine(ex.Message);
options.DebugMessageWriter.WriteLine("Try 'OnTopReplica /help' for more information.");
options.Status = CliStatus.Error;
}
if (options.Status == CliStatus.Information) {
cmdOptions.WriteOptionDescriptions(options.DebugMessageWriter);
}
}
}
}

View file

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using OnTopReplica.WindowSeekers;
namespace OnTopReplica.StartupOptions {
/// <summary>
/// Represents startup options that can be set via CLI scripting (or other stuff).
/// </summary>
class Options {
public Options() {
Status = CliStatus.Ok;
Opacity = 255;
DisableChrome = false;
MustBeVisible = false;
}
#region Position and size
public Point? StartLocation { get; set; }
public ScreenPosition? StartScreenPosition { get; set; }
public Size? StartSize { get; set; }
#endregion
#region Window cloning
public IntPtr? WindowId { get; set; }
public string WindowTitle { get; set; }
public string WindowClass { get; set; }
public Rectangle? Region { get; set; }
public bool MustBeVisible { get; set; }
#endregion
#region Options
public bool EnableClickForwarding { get; set; }
public byte Opacity { get; set; }
public bool DisableChrome { get; set; }
#endregion
#region Debug info
StringBuilder _sb = new StringBuilder();
TextWriter _sbWriter;
public CliStatus Status { get; set; }
/// <summary>
/// Gets a debug message writer.
/// </summary>
public TextWriter DebugMessageWriter {
get {
if (_sbWriter == null) {
_sbWriter = new StringWriter(_sb);
}
return _sbWriter;
}
}
/// <summary>
/// Gets the debug message.
/// </summary>
public string DebugMessage {
get {
if(_sbWriter != null)
_sbWriter.Flush();
return _sb.ToString();
}
}
#endregion
#region Application
public void Apply(MainForm form) {
//GUI
form.IsChromeVisible = !DisableChrome;
form.Opacity = (double)Opacity / 255.0;
//Thumbnail cloning
WindowHandle handle = null;
if (WindowId.HasValue) {
handle = WindowHandle.FromHandle(WindowId.Value);
}
else if (WindowTitle != null) {
var seeker = new ByTitleWindowSeeker(WindowTitle) {
OwnerHandle = form.Handle,
SkipNotVisibleWindows = MustBeVisible
};
seeker.Refresh();
handle = seeker.Windows.FirstOrDefault();
}
else if (WindowClass != null) {
var seeker = new ByClassWindowSeeker(WindowClass) {
OwnerHandle = form.Handle,
SkipNotVisibleWindows = MustBeVisible
};
seeker.Refresh();
handle = seeker.Windows.FirstOrDefault();
}
if (handle != null) {
form.SetThumbnail(handle, Region);
}
//Size
if (StartSize.HasValue) {
form.ClientSize = StartSize.Value;
}
//Position
if (StartLocation.HasValue) {
form.Location = StartLocation.Value;
}
else if (StartScreenPosition.HasValue) {
form.PositionLock = StartScreenPosition.Value;
}
//Other features
if (EnableClickForwarding) {
form.ClickForwardingEnabled = true;
}
}
#endregion
}
}

View file

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Drawing;
using System.Text.RegularExpressions;
namespace OnTopReplica.StartupOptions {
class RectangleConverter : TypeConverter {
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
if (value != null) {
var sVal = value.ToString();
return Convert(sVal);
}
else
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) {
return sourceType == typeof(string);
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
return destinationType == typeof(Rectangle);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
if (value != null && destinationType == typeof(Rectangle)) {
var sVal = value.ToString();
return Convert(sVal);
}
else
return base.ConvertTo(context, culture, value, destinationType);
}
static Regex _sizeRegex = new Regex("^\\D*(?<x>\\d*)\\s*,\\s*(?<y>\\d*)\\s*,\\s*(?<width>\\d*)\\s*,\\s*(?<height>\\d*)\\D*$",
RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Singleline);
private Rectangle Convert(string s) {
var match = _sizeRegex.Match(s);
var x = match.Groups["x"];
var y = match.Groups["y"];
var width = match.Groups["width"];
var height = match.Groups["height"];
if (match.Success && x.Success && y.Success && width.Success && height.Success) {
var xVal = int.Parse(x.Value);
var yVal = int.Parse(y.Value);
var widthVal = int.Parse(width.Value);
var heightVal = int.Parse(height.Value);
return new Rectangle(xVal, yVal, widthVal, heightVal);
}
else
throw new ArgumentException("Cannot convert '" + s + "' to rectangle.");
}
}
}

View file

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace OnTopReplica.StartupOptions {
class ScreenPositionConverter : TypeConverter {
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) {
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
if (destinationType == typeof(ScreenPosition))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
var sValue = value.ToString();
switch (sValue) {
case "TL":
return ScreenPosition.TopLeft;
case "TR":
return ScreenPosition.TopRight;
case "BL":
return ScreenPosition.BottomLeft;
case "BR":
return ScreenPosition.BottomRight;
case "C":
return ScreenPosition.Center;
default:
throw new ArgumentException("Invalid screen position value '" + sValue + "'.");
}
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
if (destinationType == typeof(ScreenPosition))
return ConvertFrom(context, culture, value);
return base.ConvertTo(context, culture, value, destinationType);
}
}
}

View file

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Drawing;
using System.Text.RegularExpressions;
namespace OnTopReplica.StartupOptions {
class SizeConverter : TypeConverter {
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
if (value != null) {
var sVal = value.ToString();
return StringToSize(sVal);
}
else
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) {
return (sourceType == typeof(string) || sourceType == typeof(Size));
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
return (destinationType == typeof(Size) || destinationType == typeof(string));
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
if (value == null)
return base.ConvertTo(context, culture, value, destinationType);
if (destinationType == typeof(Size)) {
var sVal = value.ToString();
return StringToSize(sVal);
}
else if (destinationType == typeof(string)) {
if (value is Size) {
Size sValue = (Size)value;
return string.Format("{0}, {1}", sValue.Width, sValue.Height);
}
return value.ToString();
}
else
return base.ConvertTo(context, culture, value, destinationType);
}
static Regex _sizeRegex = new Regex("^\\D*(?<x>\\d*)\\s*,\\s*(?<y>\\d*)\\D*$",
RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Singleline);
private Size StringToSize(string s) {
var match = _sizeRegex.Match(s);
var x = match.Groups["x"];
var y = match.Groups["y"];
if (!match.Success || !x.Success || !y.Success)
throw new ArgumentException("Cannot convert '" + s + "' to coordinates pair.");
var xVal = Int32.Parse(x.Value);
var yVal = Int32.Parse(y.Value);
return new Size(xVal, yVal);
}
}
}

View file

@ -13,11 +13,11 @@ namespace OnTopReplica {
} }
public StoredRegion(Rectangle r, string n) { public StoredRegion(Rectangle r, string n) {
Rect = r; Bounds = r;
Name = n; Name = n;
} }
public Rectangle Rect { public Rectangle Bounds {
get; get;
set; set;
} }
@ -47,14 +47,14 @@ namespace OnTopReplica {
reader.Read(); reader.Read();
XmlSerializer x = new XmlSerializer(typeof(Rectangle)); XmlSerializer x = new XmlSerializer(typeof(Rectangle));
Rect = (Rectangle)x.Deserialize(reader); Bounds = (Rectangle)x.Deserialize(reader);
} }
public void WriteXml(System.Xml.XmlWriter writer) { public void WriteXml(System.Xml.XmlWriter writer) {
writer.WriteAttributeString("name", Name); writer.WriteAttributeString("name", Name);
XmlSerializer x = new XmlSerializer(typeof(Rectangle)); XmlSerializer x = new XmlSerializer(typeof(Rectangle));
x.Serialize(writer, Rect); x.Serialize(writer, Bounds);
} }
#endregion #endregion

View file

@ -1025,7 +1025,25 @@ namespace OnTopReplica {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Position. /// Looks up a localized string similar to Center.
/// </summary>
internal static string MenuPosCenter {
get {
return ResourceManager.GetString("MenuPosCenter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled.
/// </summary>
internal static string MenuPosDisabled {
get {
return ResourceManager.GetString("MenuPosDisabled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Position lock.
/// </summary> /// </summary>
internal static string MenuPosition { internal static string MenuPosition {
get { get {

View file

@ -171,7 +171,7 @@ Dette program kræver Windows Vista Home Premium eller bedre.</value>
<value>Ingen miniature indlæst.</value> <value>Ingen miniature indlæst.</value>
</data> </data>
<data name="ErrorUnableToCreateThumbnail" xml:space="preserve"> <data name="ErrorUnableToCreateThumbnail" xml:space="preserve">
<value>Kan ikke lave miniature.</value> <value>Kan ikke lave miniature</value>
</data> </data>
<data name="ErrorUnableToFit" xml:space="preserve"> <data name="ErrorUnableToFit" xml:space="preserve">
<value>Kunne ikke passes til vinduet.</value> <value>Kunne ikke passes til vinduet.</value>

0
OnTopReplica/Strings.it.Designer.cs generated Normal file
View file

View file

@ -1,30 +1,135 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<resheader name="resmimetype"> <!--
<value>text/microsoft-resx</value> Microsoft ResX Schema
</resheader>
<resheader name="version"> Version 2.0
<value>2.0</value>
</resheader> The primary goals of this format is to allow a simple XML format
<resheader name="reader"> that is mostly human readable. The generation and parsing of the
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> various data types are done through the TypeConverter classes
</resheader> associated with the data types.
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> Example:
</resheader>
<data name="AboutButtonCancelTT" xml:space="preserve"> ... ado.net/XML headers & schema ...
<value>Annulla il processo di aggiornamento.</value> <resheader name="resmimetype">text/microsoft-resx</resheader>
</data> <resheader name="version">2.0</resheader>
<data name="AboutButtonExpanderTT" xml:space="preserve"> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<value>Mostra dettagli su OnTopReplica.</value> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="AboutButtonResetTT" xml:space="preserve"> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<value>Resetta tutte le impostazioni di OnTopReplica.</value> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
</data> <value>[base64 mime encoded serialized .NET Framework object]</value>
<data name="AboutButtonUpdateTT" xml:space="preserve"> </data>
<value>Aggiorna OnTopReplica ora.</value> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
</data> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<data name="AboutDetails" xml:space="preserve"> <comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AboutButtonCancelTT" xml:space="preserve">
<value>Annulla il processo di aggiornamento.</value>
</data>
<data name="AboutButtonExpanderTT" xml:space="preserve">
<value>Mostra dettagli su OnTopReplica.</value>
</data>
<data name="AboutButtonResetTT" xml:space="preserve">
<value>Resetta tutte le impostazioni di OnTopReplica.</value>
</data>
<data name="AboutButtonUpdateTT" xml:space="preserve">
<value>Aggiorna OnTopReplica ora.</value>
</data>
<data name="AboutDetails" xml:space="preserve">
<value>&lt;html&gt; <value>&lt;html&gt;
&lt;head&gt; &lt;head&gt;
&lt;style type="text/css"&gt; &lt;style type="text/css"&gt;
@ -75,413 +180,416 @@ a:hover {
&lt;p&gt;Alcune delle icone sono state prese da &lt;a href="http://www.vistaico.com"&gt;VistaICO.com&lt;/a&gt; e dal set di icone Xiao.&lt;/p&gt; &lt;p&gt;Alcune delle icone sono state prese da &lt;a href="http://www.vistaico.com"&gt;VistaICO.com&lt;/a&gt; e dal set di icone Xiao.&lt;/p&gt;
&lt;/body&gt; &lt;/body&gt;
&lt;/html&gt;</value> &lt;/html&gt;</value>
</data> </data>
<data name="ApplicationName" xml:space="preserve"> <data name="ApplicationName" xml:space="preserve">
<value>OnTopReplica</value> <value>OnTopReplica</value>
</data> </data>
<data name="AskReset" xml:space="preserve"> <data name="AskReset" xml:space="preserve">
<value>Ripristinare completamente la finestra?</value> <value>Ripristinare completamente la finestra?</value>
</data> </data>
<data name="AskResetButtonOk" xml:space="preserve"> <data name="AskResetButtonOk" xml:space="preserve">
<value>&amp;Ripristina <value>&amp;Ripristina
Tutte le impostazioni saranno perse.</value> Tutte le impostazioni saranno perse.</value>
</data> </data>
<data name="AskResetContent" xml:space="preserve"> <data name="AskResetContent" xml:space="preserve">
<value>Può essere usato se si è perso il controllo della finestra o si è spostata oltre ai bordi dello schermo.</value> <value>Può essere usato se si è perso il controllo della finestra o si è spostata oltre ai bordi dello schermo.</value>
</data> </data>
<data name="AskResetTitle" xml:space="preserve"> <data name="AskResetTitle" xml:space="preserve">
<value>Ripristino</value> <value>Ripristino</value>
</data> </data>
<data name="AskSettingReset" xml:space="preserve"> <data name="AskSettingReset" xml:space="preserve">
<value>Resettare impostazioni?</value> <value>Resettare impostazioni?</value>
</data> </data>
<data name="AskSettingResetContent" xml:space="preserve"> <data name="AskSettingResetContent" xml:space="preserve">
<value>Questa procedura resetterà tutte le impostazioni di OnTopReplica e cancellerà tutte le informazioni memorizzate (come, ad esempio, le regioni salvate).</value> <value>Questa procedura resetterà tutte le impostazioni di OnTopReplica e cancellerà tutte le informazioni memorizzate (come, ad esempio, le regioni salvate).</value>
</data> </data>
<data name="AskSettingResetTitle" xml:space="preserve"> <data name="AskSettingResetTitle" xml:space="preserve">
<value>Reimposta</value> <value>Reimposta</value>
</data> </data>
<data name="AskUpdate" xml:space="preserve"> <data name="AskUpdate" xml:space="preserve">
<value>Scaricare OnTopReplica {0}?</value> <value>Scaricare OnTopReplica {0}?</value>
<comment>{0} update version</comment> <comment>{0} update version</comment>
</data> </data>
<data name="AskUpdateButtonCancel" xml:space="preserve"> <data name="AskUpdateButtonCancel" xml:space="preserve">
<value>Annulla aggiornamento <value>Annulla aggiornamento
OnTopReplica si aggiornerà in un secondo momento.</value> OnTopReplica si aggiornerà in un secondo momento.</value>
</data> </data>
<data name="AskUpdateButtonOk" xml:space="preserve"> <data name="AskUpdateButtonOk" xml:space="preserve">
<value>Continua <value>Continua
Scarica OnTopReplica {0}.</value> Scarica OnTopReplica {0}.</value>
<comment>{0} update version</comment> <comment>{0} update version</comment>
</data> </data>
<data name="AskUpdateContent" xml:space="preserve"> <data name="AskUpdateContent" xml:space="preserve">
<value>Sarà possibile scaricare la nuova versione ed installarla.</value> <value>Sarà possibile scaricare la nuova versione ed installarla.</value>
</data> </data>
<data name="AskUpdateExpanded" xml:space="preserve"> <data name="AskUpdateExpanded" xml:space="preserve">
<value>Versione installata: {0} <value>Versione installata: {0}
Versione disponibile: {1}</value> Versione disponibile: {1}</value>
<comment>{0} installed version number <comment>{0} installed version number
{1} online available version number</comment> {1} online available version number</comment>
</data> </data>
<data name="AskUpdateTitle" xml:space="preserve"> <data name="AskUpdateTitle" xml:space="preserve">
<value>Aggiornamento disponibile</value> <value>Aggiornamento disponibile</value>
</data> </data>
<data name="ButtonCancel" xml:space="preserve"> <data name="ButtonCancel" xml:space="preserve">
<value>&amp;Annulla</value> <value>&amp;Annulla</value>
</data> </data>
<data name="CreatedBy" xml:space="preserve"> <data name="CreatedBy" xml:space="preserve">
<value>Creato da: Lorenz Cuno Klopfenstein.</value> <value>Creato da: Lorenz Cuno Klopfenstein.</value>
</data> </data>
<data name="DrawRegions" xml:space="preserve"> <data name="DrawRegions" xml:space="preserve">
<value>Disegna una regione usando il mouse.</value> <value>Disegna una regione usando il mouse.</value>
</data> </data>
<data name="ErrorDetailButton" xml:space="preserve"> <data name="ErrorDetailButton" xml:space="preserve">
<value>Dettagli</value> <value>Dettagli</value>
</data> </data>
<data name="ErrorDetailsAero" xml:space="preserve"> <data name="ErrorDetailsAero" xml:space="preserve">
<value>Dettagli su Windows Aero</value> <value>Dettagli su Windows Aero</value>
</data> </data>
<data name="ErrorDetailsAeroInfo" xml:space="preserve"> <data name="ErrorDetailsAeroInfo" xml:space="preserve">
<value>Windows Aero è disponibile soltanto su Windows Vista Home Premium o superiore.</value> <value>Windows Aero è disponibile soltanto su Windows Vista Home Premium o superiore.</value>
</data> </data>
<data name="ErrorDwmOff" xml:space="preserve"> <data name="ErrorDwmOff" xml:space="preserve">
<value>Il servizio di Desktop Composition Aero non è attivo.</value> <value>Il servizio di Desktop Composition Aero non è attivo.</value>
</data> </data>
<data name="ErrorDwmOffContent" xml:space="preserve"> <data name="ErrorDwmOffContent" xml:space="preserve">
<value>È necessario attivare la "composizione del desktop" (DWM) selezionando "Windows Aero" come tema utilizzato da Windows. <value>È necessario attivare la "composizione del desktop" (DWM) selezionando "Windows Aero" come tema utilizzato da Windows.
Per farlo, clicca col tasto destro del mouse sul desktop e poi su Personalizza.</value> Per farlo, clicca col tasto destro del mouse sul desktop e poi su Personalizza.</value>
</data> </data>
<data name="ErrorGenericInfoButton" xml:space="preserve"> <data name="ErrorGenericInfoButton" xml:space="preserve">
<value>Dettagli errore</value> <value>Dettagli errore</value>
</data> </data>
<data name="ErrorGenericInfoText" xml:space="preserve"> <data name="ErrorGenericInfoText" xml:space="preserve">
<value>Errore: </value> <value>Errore: </value>
</data> </data>
<data name="ErrorGenericThumbnailHandleError" xml:space="preserve"> <data name="ErrorGenericThumbnailHandleError" xml:space="preserve">
<value>Sembra che la finestra selezionata sia stata chiusa o che non sia più valida.</value> <value>Sembra che la finestra selezionata sia stata chiusa o che non sia più valida.</value>
</data> </data>
<data name="ErrorGenericTitle" xml:space="preserve"> <data name="ErrorGenericTitle" xml:space="preserve">
<value>Errore</value> <value>Errore</value>
</data> </data>
<data name="ErrorNoDwm" xml:space="preserve"> <data name="ErrorNoDwm" xml:space="preserve">
<value>La "composzione del desktop" non è supportata dal tuo sistema operativo. <value>La "composzione del desktop" non è supportata dal tuo sistema operativo.
È necessario utilizzare Windows Vista o superiore per avviare OnTopReplica.</value> È necessario utilizzare Windows Vista o superiore per avviare OnTopReplica.</value>
</data> </data>
<data name="ErrorNoDwmTitle" xml:space="preserve"> <data name="ErrorNoDwmTitle" xml:space="preserve">
<value>Desktop Composition (DWM) non supportato</value> <value>Desktop Composition (DWM) non supportato</value>
</data> </data>
<data name="ErrorNoThumbnail" xml:space="preserve"> <data name="ErrorNoThumbnail" xml:space="preserve">
<value>Nessuna finestra clonata al momento.</value> <value>Nessuna finestra clonata al momento.</value>
</data> </data>
<data name="ErrorUnableToCreateThumbnail" xml:space="preserve"> <data name="ErrorUnableToCreateThumbnail" xml:space="preserve">
<value>Impossibile clonare la finestra.</value> <value>Impossibile clonare la finestra</value>
</data> </data>
<data name="ErrorUnableToFit" xml:space="preserve"> <data name="ErrorUnableToFit" xml:space="preserve">
<value>Impossibile adattare la finestra.</value> <value>Impossibile adattare la finestra.</value>
</data> </data>
<data name="ErrorUpdate" xml:space="preserve"> <data name="ErrorUpdate" xml:space="preserve">
<value>Impossibile controllare gli aggiornamenti.</value> <value>Impossibile controllare gli aggiornamenti.</value>
</data> </data>
<data name="ErrorUpdateContent" xml:space="preserve"> <data name="ErrorUpdateContent" xml:space="preserve">
<value>Sembra che OnTopReplica non sia stato installato usando 'ClickOnce'. Sarà necessario aggiornare manualmente il programma visitando &lt;a href="http://ontopreplica.codeplex.com"&gt;la homepage del progetto&lt;/a&gt;.</value> <value>Sembra che OnTopReplica non sia stato installato usando 'ClickOnce'. Sarà necessario aggiornare manualmente il programma visitando &lt;a href="http://ontopreplica.codeplex.com"&gt;la homepage del progetto&lt;/a&gt;.</value>
</data> </data>
<data name="ErrorUpdateContentGeneric" xml:space="preserve"> <data name="ErrorUpdateContentGeneric" xml:space="preserve">
<value>Non è stato possibile controllare se esiste una versione più aggiornata di OnTopReplica. Verificare di essere connessi ad Internet. Se la connessione è attiva, è possibile che il sito ufficiale sia temporaneamente offline.</value> <value>Non è stato possibile controllare se esiste una versione più aggiornata di OnTopReplica. Verificare di essere connessi ad Internet. Se la connessione è attiva, è possibile che il sito ufficiale sia temporaneamente offline.</value>
</data> </data>
<data name="FullscreenMode" xml:space="preserve"> <data name="FullscreenMode" xml:space="preserve">
<value>Modalità</value> <value>Modalità</value>
</data> </data>
<data name="FullscreenModeAlwaysOnTop" xml:space="preserve"> <data name="FullscreenModeAlwaysOnTop" xml:space="preserve">
<value>Sempre in cima</value> <value>Sempre in cima</value>
</data> </data>
<data name="FullscreenModeAlwaysOnTopTT" xml:space="preserve"> <data name="FullscreenModeAlwaysOnTopTT" xml:space="preserve">
<value>OnTopReplica sarà sempre la finestra sopra a tutte le altre.</value> <value>OnTopReplica sarà sempre la finestra sopra a tutte le altre.</value>
</data> </data>
<data name="FullscreenModeClickThrough" xml:space="preserve"> <data name="FullscreenModeClickThrough" xml:space="preserve">
<value>Click through</value> <value>Click through</value>
</data> </data>
<data name="FullscreenModeClickThroughTT" xml:space="preserve"> <data name="FullscreenModeClickThroughTT" xml:space="preserve">
<value>OnTopReplica si comporterà come uno schermo trasparente, che permette di cliccare sulle finestre al di sotto.</value> <value>OnTopReplica si comporterà come uno schermo trasparente, che permette di cliccare sulle finestre al di sotto.</value>
</data> </data>
<data name="FullscreenModeNormal" xml:space="preserve"> <data name="FullscreenModeNormal" xml:space="preserve">
<value>Normale</value> <value>Normale</value>
</data> </data>
<data name="FullscreenModeNormalTT" xml:space="preserve"> <data name="FullscreenModeNormalTT" xml:space="preserve">
<value>Si comporta come una finestra normale. Puoi portare altre finestre sopra OnTopReplica.</value> <value>Si comporta come una finestra normale. Puoi portare altre finestre sopra OnTopReplica.</value>
</data> </data>
<data name="FullscreenTitle" xml:space="preserve"> <data name="FullscreenTitle" xml:space="preserve">
<value>OnTopReplica a pieno schermo</value> <value>OnTopReplica a pieno schermo</value>
</data> </data>
<data name="GroupSwitchModeDisableButton" xml:space="preserve"> <data name="GroupSwitchModeDisableButton" xml:space="preserve">
<value>Disattiva</value> <value>Disattiva</value>
</data> </data>
<data name="GroupSwitchModeEnableButton" xml:space="preserve"> <data name="GroupSwitchModeEnableButton" xml:space="preserve">
<value>Abilita modalità</value> <value>Abilita modalità</value>
</data> </data>
<data name="GroupSwitchModeStatusDisabled" xml:space="preserve"> <data name="GroupSwitchModeStatusDisabled" xml:space="preserve">
<value>Seleziona più finestre per attivare.</value> <value>Seleziona più finestre per attivare.</value>
</data> </data>
<data name="GroupSwitchModeStatusEnabled" xml:space="preserve"> <data name="GroupSwitchModeStatusEnabled" xml:space="preserve">
<value>Modalità Gruppo attivata.</value> <value>Modalità Gruppo attivata.</value>
</data> </data>
<data name="GroupSwitchModeTitle" xml:space="preserve"> <data name="GroupSwitchModeTitle" xml:space="preserve">
<value>Modalità Gruppo di finestre:</value> <value>Modalità Gruppo di finestre:</value>
</data> </data>
<data name="GroupSwitchModeWindows" xml:space="preserve"> <data name="GroupSwitchModeWindows" xml:space="preserve">
<value>Finestre</value> <value>Finestre</value>
<comment>Column Header of list, simply refers to available windows to be cloned</comment> <comment>Column Header of list, simply refers to available windows to be cloned</comment>
</data> </data>
<data name="Homepage" xml:space="preserve"> <data name="Homepage" xml:space="preserve">
<value>Sito internet: www.codeplex.com/ontopreplica.</value> <value>Sito internet: www.codeplex.com/ontopreplica.</value>
</data> </data>
<data name="InfoClickForwarding" xml:space="preserve"> <data name="InfoClickForwarding" xml:space="preserve">
<value>Attivare la modalità di inoltro dei clic?</value> <value>Attivare la modalità di inoltro dei clic?</value>
</data> </data>
<data name="InfoClickForwardingContent" xml:space="preserve"> <data name="InfoClickForwardingContent" xml:space="preserve">
<value>In questa modalità, OnTopReplica inoltrerà tutti i clic del pulsante sinistro sul clone della finestra alla finestra originale (questo permetterà di interagire in maniera basilare con la finestra clonata, senza averla in primo piano). <value>In questa modalità, OnTopReplica inoltrerà tutti i clic del pulsante sinistro sul clone della finestra alla finestra originale (questo permetterà di interagire in maniera basilare con la finestra clonata, senza averla in primo piano).
Per uscire da questa modalità, usa il tasto ESC.</value> Per uscire da questa modalità, usa il tasto ESC.</value>
</data> </data>
<data name="InfoClickForwardingTitle" xml:space="preserve"> <data name="InfoClickForwardingTitle" xml:space="preserve">
<value>Inoltro dei clic</value> <value>Inoltro dei clic</value>
</data> </data>
<data name="InfoClickThrough" xml:space="preserve"> <data name="InfoClickThrough" xml:space="preserve">
<value>Attivare la modalità Click-Through?</value> <value>Attivare la modalità Click-Through?</value>
</data> </data>
<data name="InfoClickThroughDetails" xml:space="preserve"> <data name="InfoClickThroughDetails" xml:space="preserve">
<value>La modalità "Click-Through" funziona solo se l'opzione è stata attivata e se la finestra è semitrasparente.</value> <value>La modalità "Click-Through" funziona solo se l'opzione è stata attivata e se la finestra è semitrasparente.</value>
</data> </data>
<data name="InfoClickThroughInformation" xml:space="preserve"> <data name="InfoClickThroughInformation" xml:space="preserve">
<value>In questa modalità la finestra clonata si comporterà come una maschera semitrasparente che permette di cliccare sulle finestre dietro di essa. <value>In questa modalità la finestra clonata si comporterà come una maschera semitrasparente che permette di cliccare sulle finestre dietro di essa.
Per tornare alla modalità normale in qualsiasi momento, attiva OnTopReplica (dalla barra delle applicazioni).</value> Per tornare alla modalità normale in qualsiasi momento, attiva OnTopReplica (dalla barra delle applicazioni).</value>
</data> </data>
<data name="InfoClickThroughNo" xml:space="preserve"> <data name="InfoClickThroughNo" xml:space="preserve">
<value>No, grazie. <value>No, grazie.
Puoi abilitare il Click-Through in futuro</value> Puoi abilitare il Click-Through in futuro</value>
</data> </data>
<data name="InfoClickThroughOk" xml:space="preserve"> <data name="InfoClickThroughOk" xml:space="preserve">
<value>Abilita Click-Through</value> <value>Abilita Click-Through</value>
</data> </data>
<data name="InfoClickThroughTitle" xml:space="preserve"> <data name="InfoClickThroughTitle" xml:space="preserve">
<value>Modalità Click-Through</value> <value>Modalità Click-Through</value>
</data> </data>
<data name="InfoUpdated" xml:space="preserve"> <data name="InfoUpdated" xml:space="preserve">
<value>OnTopReplica è stato aggiornato.</value> <value>OnTopReplica è stato aggiornato.</value>
</data> </data>
<data name="InfoUpdatedContent" xml:space="preserve"> <data name="InfoUpdatedContent" xml:space="preserve">
<value>Per utilizzare la nuova versione di OnTopReplica è necessario riavviare l'applicazione.</value> <value>Per utilizzare la nuova versione di OnTopReplica è necessario riavviare l'applicazione.</value>
</data> </data>
<data name="InfoUpdatedTitle" xml:space="preserve"> <data name="InfoUpdatedTitle" xml:space="preserve">
<value>Aggiornamento completato</value> <value>Aggiornamento completato</value>
</data> </data>
<data name="InfoUpToDate" xml:space="preserve"> <data name="InfoUpToDate" xml:space="preserve">
<value>La versione più aggiornata è già installata.</value> <value>La versione più aggiornata è già installata.</value>
</data> </data>
<data name="InfoUpToDateTitle" xml:space="preserve"> <data name="InfoUpToDateTitle" xml:space="preserve">
<value>Nessun aggiornamento disponibile</value> <value>Nessun aggiornamento disponibile</value>
</data> </data>
<data name="Language" xml:space="preserve"> <data name="Language" xml:space="preserve">
<value>Lingua</value> <value>Lingua</value>
</data> </data>
<data name="MenuAbout" xml:space="preserve"> <data name="MenuAbout" xml:space="preserve">
<value>A proposito di...</value> <value>A proposito di...</value>
</data> </data>
<data name="MenuAboutTT" xml:space="preserve"> <data name="MenuAboutTT" xml:space="preserve">
<value>Nasconde la finestra principale e mostra una schermata di informazioni.</value> <value>Nasconde la finestra principale e mostra una schermata di informazioni.</value>
</data> </data>
<data name="MenuAdvanced" xml:space="preserve"> <data name="MenuAdvanced" xml:space="preserve">
<value>Avanzate</value> <value>Avanzate</value>
</data> </data>
<data name="MenuChrome" xml:space="preserve"> <data name="MenuChrome" xml:space="preserve">
<value>Bordo</value> <value>Bordo</value>
</data> </data>
<data name="MenuChromeTT" xml:space="preserve"> <data name="MenuChromeTT" xml:space="preserve">
<value>Abilita o disabilita il bordo della finestra.</value> <value>Abilita o disabilita il bordo della finestra.</value>
</data> </data>
<data name="MenuClickForwarding" xml:space="preserve"> <data name="MenuClickForwarding" xml:space="preserve">
<value>Inoltro dei clic</value> <value>Inoltro dei clic</value>
</data> </data>
<data name="MenuClickForwardingTT" xml:space="preserve"> <data name="MenuClickForwardingTT" xml:space="preserve">
<value>Attiva la modalità di "inoltro dei clic" alla finestra clonata.</value> <value>Attiva la modalità di "inoltro dei clic" alla finestra clonata.</value>
</data> </data>
<data name="MenuClickThrough" xml:space="preserve"> <data name="MenuClickThrough" xml:space="preserve">
<value>Abilita Click-Through</value> <value>Abilita Click-Through</value>
</data> </data>
<data name="MenuClickThroughTT" xml:space="preserve"> <data name="MenuClickThroughTT" xml:space="preserve">
<value>OnTopReplica si comporterà come una schermata trasparente, permettendo di cliccare sulle finestre al di sotto di essa.</value> <value>OnTopReplica si comporterà come una schermata trasparente, permettendo di cliccare sulle finestre al di sotto di essa.</value>
</data> </data>
<data name="MenuClose" xml:space="preserve"> <data name="MenuClose" xml:space="preserve">
<value>Chiudi</value> <value>Chiudi</value>
</data> </data>
<data name="MenuCloseTT" xml:space="preserve"> <data name="MenuCloseTT" xml:space="preserve">
<value>Termina OnTopReplica.</value> <value>Termina OnTopReplica.</value>
</data> </data>
<data name="MenuFitDouble" xml:space="preserve"> <data name="MenuFitDouble" xml:space="preserve">
<value>2:1 Doppio</value> <value>2:1 Doppio</value>
</data> </data>
<data name="MenuFitFullscreen" xml:space="preserve"> <data name="MenuFitFullscreen" xml:space="preserve">
<value>Tutto schermo</value> <value>Tutto schermo</value>
</data> </data>
<data name="MenuFitHalf" xml:space="preserve"> <data name="MenuFitHalf" xml:space="preserve">
<value>1:2 Metà</value> <value>1:2 Metà</value>
</data> </data>
<data name="MenuFitOriginal" xml:space="preserve"> <data name="MenuFitOriginal" xml:space="preserve">
<value>1:1 Clone esatto</value> <value>1:1 Clone esatto</value>
</data> </data>
<data name="MenuFitQuarter" xml:space="preserve"> <data name="MenuFitQuarter" xml:space="preserve">
<value>1:4 Quarto</value> <value>1:4 Quarto</value>
</data> </data>
<data name="MenuGlass" xml:space="preserve"> <data name="MenuGlass" xml:space="preserve">
<value>Effetto vetro</value> <value>Effetto vetro</value>
</data> </data>
<data name="MenuGlassTT" xml:space="preserve"> <data name="MenuGlassTT" xml:space="preserve">
<value>Abilita o disabilita l'effetto vetro.</value> <value>Abilita o disabilita l'effetto vetro.</value>
</data> </data>
<data name="MenuGroupSwitch" xml:space="preserve"> <data name="MenuGroupSwitch" xml:space="preserve">
<value>Modalità Gruppo di finestre</value> <value>Modalità Gruppo di finestre</value>
</data> </data>
<data name="MenuGroupSwitchTT" xml:space="preserve"> <data name="MenuGroupSwitchTT" xml:space="preserve">
<value>OnTopReplica clonerà automaticamente una finestra di un gruppo, scegliendo quella che non è stata in primo piano da più tempo.</value> <value>OnTopReplica clonerà automaticamente una finestra di un gruppo, scegliendo quella che non è stata in primo piano da più tempo.</value>
</data> </data>
<data name="MenuOp100" xml:space="preserve"> <data name="MenuOp100" xml:space="preserve">
<value>100% (opaco)</value> <value>100% (opaco)</value>
</data> </data>
<data name="MenuOp100TT" xml:space="preserve"> <data name="MenuOp100TT" xml:space="preserve">
<value>Imposta OnTopReplica come finestra completamente opaca.</value> <value>Imposta OnTopReplica come finestra completamente opaca.</value>
</data> </data>
<data name="MenuOp25" xml:space="preserve"> <data name="MenuOp25" xml:space="preserve">
<value>25%</value> <value>25%</value>
</data> </data>
<data name="MenuOp25TT" xml:space="preserve"> <data name="MenuOp25TT" xml:space="preserve">
<value>Imposta l'opacità di OnTopReplica al 25%.</value> <value>Imposta l'opacità di OnTopReplica al 25%.</value>
</data> </data>
<data name="MenuOp50" xml:space="preserve"> <data name="MenuOp50" xml:space="preserve">
<value>50%</value> <value>50%</value>
</data> </data>
<data name="MenuOp50TT" xml:space="preserve"> <data name="MenuOp50TT" xml:space="preserve">
<value>Imposta l'opacità di OnTopReplica al 50%.</value> <value>Imposta l'opacità di OnTopReplica al 50%.</value>
</data> </data>
<data name="MenuOp75" xml:space="preserve"> <data name="MenuOp75" xml:space="preserve">
<value>75%</value> <value>75%</value>
</data> </data>
<data name="MenuOp75TT" xml:space="preserve"> <data name="MenuOp75TT" xml:space="preserve">
<value>Imposta l'opacità di OnTopReplica al 75%.</value> <value>Imposta l'opacità di OnTopReplica al 75%.</value>
</data> </data>
<data name="MenuOpacity" xml:space="preserve"> <data name="MenuOpacity" xml:space="preserve">
<value>Opacità</value> <value>Opacità</value>
</data> </data>
<data name="MenuOpen" xml:space="preserve"> <data name="MenuOpen" xml:space="preserve">
<value>Apri</value> <value>Apri</value>
</data> </data>
<data name="MenuOpenTT" xml:space="preserve"> <data name="MenuOpenTT" xml:space="preserve">
<value>Attiva la finestra di OnTopReplica.</value> <value>Attiva la finestra di OnTopReplica.</value>
</data> </data>
<data name="MenuPosBottomLeft" xml:space="preserve"> <data name="MenuPosBottomLeft" xml:space="preserve">
<value>In basso a sinistra</value> <value>In basso a sinistra</value>
</data> </data>
<data name="MenuPosBottomRight" xml:space="preserve"> <data name="MenuPosBottomRight" xml:space="preserve">
<value>In basso a destra</value> <value>In basso a destra</value>
</data> </data>
<data name="MenuPosition" xml:space="preserve"> <data name="MenuPosition" xml:space="preserve">
<value>Posizione</value> <value>Blocco posizione</value>
</data> </data>
<data name="MenuPositionTT" xml:space="preserve"> <data name="MenuPositionTT" xml:space="preserve">
<value>Posiziona automaticamente OnTopReplica sul monitor corrente.</value> <value>Posiziona automaticamente OnTopReplica sul monitor corrente.</value>
</data> </data>
<data name="MenuPosTopLeft" xml:space="preserve"> <data name="MenuPosTopLeft" xml:space="preserve">
<value>In alto a sinistra</value> <value>In alto a sinistra</value>
</data> </data>
<data name="MenuPosTopRight" xml:space="preserve"> <data name="MenuPosTopRight" xml:space="preserve">
<value>In alto a destra</value> <value>In alto a destra</value>
</data> </data>
<data name="MenuQuitFullscreen" xml:space="preserve"> <data name="MenuQuitFullscreen" xml:space="preserve">
<value>Esci da tutto schermo</value> <value>Esci da tutto schermo</value>
</data> </data>
<data name="MenuRecall" xml:space="preserve"> <data name="MenuRecall" xml:space="preserve">
<value>Ripristina posizione e grandezza</value> <value>Ripristina posizione e grandezza</value>
</data> </data>
<data name="MenuRecallTT" xml:space="preserve"> <data name="MenuRecallTT" xml:space="preserve">
<value>Imposta se, al prossimo avvio di OnTopReplica, debbano essere ripristinati i valori di grandezza e posizione della finestra alla chiusura.</value> <value>Imposta se, al prossimo avvio di OnTopReplica, debbano essere ripristinati i valori di grandezza e posizione della finestra alla chiusura.</value>
</data> </data>
<data name="MenuReduce" xml:space="preserve"> <data name="MenuReduce" xml:space="preserve">
<value>Minimizza</value> <value>Minimizza</value>
</data> </data>
<data name="MenuReduceTT" xml:space="preserve"> <data name="MenuReduceTT" xml:space="preserve">
<value>Riduce OnTopReplica ad un'icona nella barra delle applicazioni.</value> <value>Riduce OnTopReplica ad un'icona nella barra delle applicazioni.</value>
</data> </data>
<data name="MenuRegion" xml:space="preserve"> <data name="MenuRegion" xml:space="preserve">
<value>Seleziona regione...</value> <value>Seleziona regione...</value>
</data> </data>
<data name="MenuRegionTT" xml:space="preserve"> <data name="MenuRegionTT" xml:space="preserve">
<value>Passa alla modalità di "selezione di regione", che permette di limitare la porzione di finestra che viene clonata.</value> <value>Passa alla modalità di "selezione di regione", che permette di limitare la porzione di finestra che viene clonata.</value>
</data> </data>
<data name="MenuReset" xml:space="preserve"> <data name="MenuReset" xml:space="preserve">
<value>Reimposta finestra</value> <value>Reimposta finestra</value>
</data> </data>
<data name="MenuResetTT" xml:space="preserve"> <data name="MenuResetTT" xml:space="preserve">
<value>Reimposta OnTopReplica e la sua finestra principale.</value> <value>Reimposta OnTopReplica e la sua finestra principale.</value>
</data> </data>
<data name="MenuResize" xml:space="preserve"> <data name="MenuResize" xml:space="preserve">
<value>Ridimensionamento</value> <value>Ridimensionamento</value>
</data> </data>
<data name="MenuSwitch" xml:space="preserve"> <data name="MenuSwitch" xml:space="preserve">
<value>Vai alla finestra originale</value> <value>Vai alla finestra originale</value>
</data> </data>
<data name="MenuSwitchTT" xml:space="preserve"> <data name="MenuSwitchTT" xml:space="preserve">
<value>Mostra la finestra originale e nasconde OnTopReplica.</value> <value>Mostra la finestra originale e nasconde OnTopReplica.</value>
</data> </data>
<data name="MenuWindows" xml:space="preserve"> <data name="MenuWindows" xml:space="preserve">
<value>Seleziona finestra</value> <value>Seleziona finestra</value>
</data> </data>
<data name="MenuWindowsNone" xml:space="preserve"> <data name="MenuWindowsNone" xml:space="preserve">
<value>- nessuna -</value> <value>- nessuna -</value>
</data> </data>
<data name="MenuWindowsTT" xml:space="preserve"> <data name="MenuWindowsTT" xml:space="preserve">
<value>Mostra una lista di finestre che è possibile clonare.</value> <value>Mostra una lista di finestre che è possibile clonare.</value>
</data> </data>
<data name="MenuWindowsWholeRegion" xml:space="preserve"> <data name="MenuWindowsWholeRegion" xml:space="preserve">
<value>- intera -</value> <value>- intera -</value>
</data> </data>
<data name="RegionsCurrentRegion" xml:space="preserve"> <data name="RegionsCurrentRegion" xml:space="preserve">
<value>Regione corrente:</value> <value>Regione corrente:</value>
</data> </data>
<data name="RegionsDeleteButton" xml:space="preserve"> <data name="RegionsDeleteButton" xml:space="preserve">
<value>Cancella</value> <value>Cancella</value>
</data> </data>
<data name="RegionsDoneButton" xml:space="preserve"> <data name="RegionsDoneButton" xml:space="preserve">
<value>Chiudi</value> <value>Chiudi</value>
</data> </data>
<data name="RegionsHeight" xml:space="preserve"> <data name="RegionsHeight" xml:space="preserve">
<value>Altezz.</value> <value>Altezz.</value>
</data> </data>
<data name="RegionsResetButton" xml:space="preserve"> <data name="RegionsResetButton" xml:space="preserve">
<value>Reset</value> <value>Reset</value>
</data> </data>
<data name="RegionsSaveButton" xml:space="preserve"> <data name="RegionsSaveButton" xml:space="preserve">
<value>Salva</value> <value>Salva</value>
</data> </data>
<data name="RegionsStoredRegions" xml:space="preserve"> <data name="RegionsStoredRegions" xml:space="preserve">
<value>Regioni memorizzate</value> <value>Regioni memorizzate</value>
</data> </data>
<data name="RegionsTitle" xml:space="preserve"> <data name="RegionsTitle" xml:space="preserve">
<value>Regioni:</value> <value>Regioni:</value>
</data> </data>
<data name="RegionsWidth" xml:space="preserve"> <data name="RegionsWidth" xml:space="preserve">
<value>Largh.</value> <value>Largh.</value>
</data> </data>
<data name="RightClick" xml:space="preserve"> <data name="RightClick" xml:space="preserve">
<value>Clic destro qui per iniziare...</value> <value>Clic destro qui per iniziare...</value>
</data> </data>
<data name="Slogan" xml:space="preserve"> <data name="Slogan" xml:space="preserve">
<value>Una copia leggera, in tempo reale e sempre in primo piano di una finestra a tua scelta.</value> <value>Una copia leggera, in tempo reale e sempre in primo piano di una finestra a tua scelta.</value>
</data> </data>
<data name="UpdateDisclaimer" xml:space="preserve"> <data name="UpdateDisclaimer" xml:space="preserve">
<value>OnTopReplica controlla automaticamente se sono presenti aggiornamenti.</value> <value>OnTopReplica controlla automaticamente se sono presenti aggiornamenti.</value>
</data> </data>
<data name="UpdateNow" xml:space="preserve"> <data name="UpdateNow" xml:space="preserve">
<value>Aggiorna!</value> <value>Aggiorna!</value>
</data> </data>
<data name="MenuPosDisabled" xml:space="preserve">
<value>Disabilitato</value>
</data>
</root> </root>

View file

@ -1,30 +1,135 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<resheader name="resmimetype"> <!--
<value>text/microsoft-resx</value> Microsoft ResX Schema
</resheader>
<resheader name="version"> Version 2.0
<value>2.0</value>
</resheader> The primary goals of this format is to allow a simple XML format
<resheader name="reader"> that is mostly human readable. The generation and parsing of the
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> various data types are done through the TypeConverter classes
</resheader> associated with the data types.
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> Example:
</resheader>
<data name="AboutButtonCancelTT" xml:space="preserve"> ... ado.net/XML headers & schema ...
<value>Abort update process.</value> <resheader name="resmimetype">text/microsoft-resx</resheader>
</data> <resheader name="version">2.0</resheader>
<data name="AboutButtonExpanderTT" xml:space="preserve"> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<value>Show details about OnTopReplica.</value> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="AboutButtonResetTT" xml:space="preserve"> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<value>Reset all OnTopReplica settings.</value> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
</data> <value>[base64 mime encoded serialized .NET Framework object]</value>
<data name="AboutButtonUpdateTT" xml:space="preserve"> </data>
<value>Update OnTopReplica now.</value> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
</data> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<data name="AboutDetails" xml:space="preserve"> <comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AboutButtonCancelTT" xml:space="preserve">
<value>Abort update process.</value>
</data>
<data name="AboutButtonExpanderTT" xml:space="preserve">
<value>Show details about OnTopReplica.</value>
</data>
<data name="AboutButtonResetTT" xml:space="preserve">
<value>Reset all OnTopReplica settings.</value>
</data>
<data name="AboutButtonUpdateTT" xml:space="preserve">
<value>Update OnTopReplica now.</value>
</data>
<data name="AboutDetails" xml:space="preserve">
<value>&lt;html&gt; <value>&lt;html&gt;
&lt;head&gt; &lt;head&gt;
&lt;style type="text/css"&gt; &lt;style type="text/css"&gt;
@ -75,413 +180,419 @@ a:hover {
&lt;p&gt;Some icons from &lt;a href="http://www.vistaico.com"&gt;VistaICO.com&lt;/a&gt; and the Xiao icon set.&lt;/p&gt; &lt;p&gt;Some icons from &lt;a href="http://www.vistaico.com"&gt;VistaICO.com&lt;/a&gt; and the Xiao icon set.&lt;/p&gt;
&lt;/body&gt; &lt;/body&gt;
&lt;/html&gt;</value> &lt;/html&gt;</value>
</data> </data>
<data name="ApplicationName" xml:space="preserve"> <data name="ApplicationName" xml:space="preserve">
<value>OnTopReplica</value> <value>OnTopReplica</value>
</data> </data>
<data name="AskReset" xml:space="preserve"> <data name="AskReset" xml:space="preserve">
<value>Reset window completely?</value> <value>Reset window completely?</value>
</data> </data>
<data name="AskResetButtonOk" xml:space="preserve"> <data name="AskResetButtonOk" xml:space="preserve">
<value>&amp;Reset <value>&amp;Reset
All settings will be lost.</value> All settings will be lost.</value>
</data> </data>
<data name="AskResetContent" xml:space="preserve"> <data name="AskResetContent" xml:space="preserve">
<value>Can be used to reset all settings if you lost control over the window or moved it beyond the screen boundary.</value> <value>Can be used to reset all settings if you lost control over the window or moved it beyond the screen boundary.</value>
</data> </data>
<data name="AskResetTitle" xml:space="preserve"> <data name="AskResetTitle" xml:space="preserve">
<value>Reset</value> <value>Reset</value>
</data> </data>
<data name="AskSettingReset" xml:space="preserve"> <data name="AskSettingReset" xml:space="preserve">
<value>Reset settings?</value> <value>Reset settings?</value>
</data> </data>
<data name="AskSettingResetContent" xml:space="preserve"> <data name="AskSettingResetContent" xml:space="preserve">
<value>This will erase all settings of OnTopReplica, returning it to the original state right after installation (all saved information, like stored regions, will be lost).</value> <value>This will erase all settings of OnTopReplica, returning it to the original state right after installation (all saved information, like stored regions, will be lost).</value>
</data> </data>
<data name="AskSettingResetTitle" xml:space="preserve"> <data name="AskSettingResetTitle" xml:space="preserve">
<value>Reset settings</value> <value>Reset settings</value>
</data> </data>
<data name="AskUpdate" xml:space="preserve"> <data name="AskUpdate" xml:space="preserve">
<value>Download OnTopReplica {0}?</value> <value>Download OnTopReplica {0}?</value>
<comment>{0} update version</comment> <comment>{0} update version</comment>
</data> </data>
<data name="AskUpdateButtonCancel" xml:space="preserve"> <data name="AskUpdateButtonCancel" xml:space="preserve">
<value>Cancel update <value>Cancel update
OnTopReplica will prompt you the next time it is started.</value> OnTopReplica will prompt you the next time it is started.</value>
</data> </data>
<data name="AskUpdateButtonOk" xml:space="preserve"> <data name="AskUpdateButtonOk" xml:space="preserve">
<value>Download <value>Download
Install OnTopReplica {0}.</value> Install OnTopReplica {0}.</value>
<comment>{0} update version</comment> <comment>{0} update version</comment>
</data> </data>
<data name="AskUpdateContent" xml:space="preserve"> <data name="AskUpdateContent" xml:space="preserve">
<value>The new version can be downloaded and installed from the official website.</value> <value>The new version can be downloaded and installed from the official website.</value>
</data> </data>
<data name="AskUpdateExpanded" xml:space="preserve"> <data name="AskUpdateExpanded" xml:space="preserve">
<value>Installed version: {0} <value>Installed version: {0}
Available version: {1}</value> Available version: {1}</value>
<comment>{0} installed version number <comment>{0} installed version number
{1} online available version number</comment> {1} online available version number</comment>
</data> </data>
<data name="AskUpdateTitle" xml:space="preserve"> <data name="AskUpdateTitle" xml:space="preserve">
<value>Update available</value> <value>Update available</value>
</data> </data>
<data name="ButtonCancel" xml:space="preserve"> <data name="ButtonCancel" xml:space="preserve">
<value>&amp;Cancel</value> <value>&amp;Cancel</value>
</data> </data>
<data name="CreatedBy" xml:space="preserve"> <data name="CreatedBy" xml:space="preserve">
<value>Created by: Lorenz Cuno Klopfenstein.</value> <value>Created by: Lorenz Cuno Klopfenstein.</value>
</data> </data>
<data name="DrawRegions" xml:space="preserve"> <data name="DrawRegions" xml:space="preserve">
<value>Draw regions using mouse.</value> <value>Draw regions using mouse.</value>
</data> </data>
<data name="ErrorDetailButton" xml:space="preserve"> <data name="ErrorDetailButton" xml:space="preserve">
<value>Details</value> <value>Details</value>
</data> </data>
<data name="ErrorDetailsAero" xml:space="preserve"> <data name="ErrorDetailsAero" xml:space="preserve">
<value>Details on Windows Aero</value> <value>Details on Windows Aero</value>
</data> </data>
<data name="ErrorDetailsAeroInfo" xml:space="preserve"> <data name="ErrorDetailsAeroInfo" xml:space="preserve">
<value>Windows Aero is only available on Windows Vista Home Premium or higher.</value> <value>Windows Aero is only available on Windows Vista Home Premium or higher.</value>
</data> </data>
<data name="ErrorDwmOff" xml:space="preserve"> <data name="ErrorDwmOff" xml:space="preserve">
<value>Desktop Composition' is not enabled.</value> <value>Desktop Composition' is not enabled.</value>
</data> </data>
<data name="ErrorDwmOffContent" xml:space="preserve"> <data name="ErrorDwmOffContent" xml:space="preserve">
<value>You must enable desktop composition, by selecting 'Windows Aero' as the theme used by Windows. <value>You must enable desktop composition, by selecting 'Windows Aero' as the theme used by Windows.
To do so, right-click on the desktop and click on Personalize.</value> To do so, right-click on the desktop and click on Personalize.</value>
</data> </data>
<data name="ErrorGenericInfoButton" xml:space="preserve"> <data name="ErrorGenericInfoButton" xml:space="preserve">
<value>Error details</value> <value>Error details</value>
</data> </data>
<data name="ErrorGenericInfoText" xml:space="preserve"> <data name="ErrorGenericInfoText" xml:space="preserve">
<value>Error: </value> <value>Error: </value>
</data> </data>
<data name="ErrorGenericThumbnailHandleError" xml:space="preserve"> <data name="ErrorGenericThumbnailHandleError" xml:space="preserve">
<value>It appears that the selected window has been closed or is not valid anymore.</value> <value>It appears that the selected window has been closed or is not valid anymore.</value>
</data> </data>
<data name="ErrorGenericTitle" xml:space="preserve"> <data name="ErrorGenericTitle" xml:space="preserve">
<value>Error</value> <value>Error</value>
</data> </data>
<data name="ErrorNoDwm" xml:space="preserve"> <data name="ErrorNoDwm" xml:space="preserve">
<value>Desktop Composition' is not supported on your Operating System. <value>Desktop Composition' is not supported on your Operating System.
You must run this application on Windows Vista Home Premium or better.</value> You must run this application on Windows Vista Home Premium or better.</value>
</data> </data>
<data name="ErrorNoDwmTitle" xml:space="preserve"> <data name="ErrorNoDwmTitle" xml:space="preserve">
<value>Desktop Composition unsupported</value> <value>Desktop Composition unsupported</value>
</data> </data>
<data name="ErrorNoThumbnail" xml:space="preserve"> <data name="ErrorNoThumbnail" xml:space="preserve">
<value>No thumbnail loaded.</value> <value>No thumbnail loaded.</value>
</data> </data>
<data name="ErrorUnableToCreateThumbnail" xml:space="preserve"> <data name="ErrorUnableToCreateThumbnail" xml:space="preserve">
<value>Unable to create thumbnail.</value> <value>Unable to create thumbnail</value>
</data> </data>
<data name="ErrorUnableToFit" xml:space="preserve"> <data name="ErrorUnableToFit" xml:space="preserve">
<value>Unable to fit window.</value> <value>Unable to fit window.</value>
</data> </data>
<data name="ErrorUpdate" xml:space="preserve"> <data name="ErrorUpdate" xml:space="preserve">
<value>Unable to check for updates.</value> <value>Unable to check for updates.</value>
</data> </data>
<data name="ErrorUpdateContent" xml:space="preserve"> <data name="ErrorUpdateContent" xml:space="preserve">
<value>It appears that OnTopReplica wasn't installed using 'ClickOnce'. You'll have to update manually (visit &lt;a href="http://ontopreplica.codeplex.com"&gt;OnTopReplica's homepage&lt;/a&gt;).</value> <value>It appears that OnTopReplica wasn't installed using 'ClickOnce'. You'll have to update manually (visit &lt;a href="http://ontopreplica.codeplex.com"&gt;OnTopReplica's homepage&lt;/a&gt;).</value>
</data> </data>
<data name="ErrorUpdateContentGeneric" xml:space="preserve"> <data name="ErrorUpdateContentGeneric" xml:space="preserve">
<value>OnTopReplica was unable to check whether an updated version is available. Make sure you are connected to the Internet. If you are, the website may be temporarily down.</value> <value>OnTopReplica was unable to check whether an updated version is available. Make sure you are connected to the Internet. If you are, the website may be temporarily down.</value>
</data> </data>
<data name="FullscreenMode" xml:space="preserve"> <data name="FullscreenMode" xml:space="preserve">
<value>Mode</value> <value>Mode</value>
</data> </data>
<data name="FullscreenModeAlwaysOnTop" xml:space="preserve"> <data name="FullscreenModeAlwaysOnTop" xml:space="preserve">
<value>Always on top</value> <value>Always on top</value>
</data> </data>
<data name="FullscreenModeAlwaysOnTopTT" xml:space="preserve"> <data name="FullscreenModeAlwaysOnTopTT" xml:space="preserve">
<value>Forces OnTopReplica to stay always on top.</value> <value>Forces OnTopReplica to stay always on top.</value>
</data> </data>
<data name="FullscreenModeClickThrough" xml:space="preserve"> <data name="FullscreenModeClickThrough" xml:space="preserve">
<value>Click through</value> <value>Click through</value>
</data> </data>
<data name="FullscreenModeClickThroughTT" xml:space="preserve"> <data name="FullscreenModeClickThroughTT" xml:space="preserve">
<value>OnTopReplica will behave like a transparent overlay that lets your clicks through to the windows below.</value> <value>OnTopReplica will behave like a transparent overlay that lets your clicks through to the windows below.</value>
</data> </data>
<data name="FullscreenModeNormal" xml:space="preserve"> <data name="FullscreenModeNormal" xml:space="preserve">
<value>Standard</value> <value>Standard</value>
</data> </data>
<data name="FullscreenModeNormalTT" xml:space="preserve"> <data name="FullscreenModeNormalTT" xml:space="preserve">
<value>Behaves like an ordinary window. You can bring other windows above OnTopReplica.</value> <value>Behaves like an ordinary window. You can bring other windows above OnTopReplica.</value>
</data> </data>
<data name="FullscreenTitle" xml:space="preserve"> <data name="FullscreenTitle" xml:space="preserve">
<value>OnTopReplica fullscreen</value> <value>OnTopReplica fullscreen</value>
</data> </data>
<data name="GroupSwitchModeDisableButton" xml:space="preserve"> <data name="GroupSwitchModeDisableButton" xml:space="preserve">
<value>Disable</value> <value>Disable</value>
</data> </data>
<data name="GroupSwitchModeEnableButton" xml:space="preserve"> <data name="GroupSwitchModeEnableButton" xml:space="preserve">
<value>Enable Group mode</value> <value>Enable Group mode</value>
</data> </data>
<data name="GroupSwitchModeStatusDisabled" xml:space="preserve"> <data name="GroupSwitchModeStatusDisabled" xml:space="preserve">
<value>Select multiple windows to enable.</value> <value>Select multiple windows to enable.</value>
</data> </data>
<data name="GroupSwitchModeStatusEnabled" xml:space="preserve"> <data name="GroupSwitchModeStatusEnabled" xml:space="preserve">
<value>Group switch mode is enabled.</value> <value>Group switch mode is enabled.</value>
</data> </data>
<data name="GroupSwitchModeTitle" xml:space="preserve"> <data name="GroupSwitchModeTitle" xml:space="preserve">
<value>Group switch mode:</value> <value>Group switch mode:</value>
</data> </data>
<data name="GroupSwitchModeWindows" xml:space="preserve"> <data name="GroupSwitchModeWindows" xml:space="preserve">
<value>Windows</value> <value>Windows</value>
<comment>Column Header of list, simply refers to available windows to be cloned</comment> <comment>Column Header of list, simply refers to available windows to be cloned</comment>
</data> </data>
<data name="Homepage" xml:space="preserve"> <data name="Homepage" xml:space="preserve">
<value>Homepage: www.codeplex.com/ontopreplica.</value> <value>Homepage: www.codeplex.com/ontopreplica.</value>
</data> </data>
<data name="InfoClickForwarding" xml:space="preserve"> <data name="InfoClickForwarding" xml:space="preserve">
<value>Do you want to enable "click forwarding"?</value> <value>Do you want to enable "click forwarding"?</value>
</data> </data>
<data name="InfoClickForwardingContent" xml:space="preserve"> <data name="InfoClickForwardingContent" xml:space="preserve">
<value>If this mode is enabled, OnTopReplica will forward all left mouse clicks to the window that is being cloned (this will allow you to do basic mouse operations on the cloned window without having to activate it). <value>If this mode is enabled, OnTopReplica will forward all left mouse clicks to the window that is being cloned (this will allow you to do basic mouse operations on the cloned window without having to activate it).
To exit this mode, push ESC.</value> To exit this mode, push ESC.</value>
</data> </data>
<data name="InfoClickForwardingTitle" xml:space="preserve"> <data name="InfoClickForwardingTitle" xml:space="preserve">
<value>Click forwarding</value> <value>Click forwarding</value>
</data> </data>
<data name="InfoClickThrough" xml:space="preserve"> <data name="InfoClickThrough" xml:space="preserve">
<value>Enable Click-Through mode?</value> <value>Enable Click-Through mode?</value>
</data> </data>
<data name="InfoClickThroughDetails" xml:space="preserve"> <data name="InfoClickThroughDetails" xml:space="preserve">
<value>Click-through only works if it has been enabled in the Resize submenu and if the window is semi-transparent.</value> <value>Click-through only works if it has been enabled in the Resize submenu and if the window is semi-transparent.</value>
</data> </data>
<data name="InfoClickThroughInformation" xml:space="preserve"> <data name="InfoClickThroughInformation" xml:space="preserve">
<value>In this mode the fullscreen window will behave as a partially transparent overlay, allowing you to click on the other windows behind it. <value>In this mode the fullscreen window will behave as a partially transparent overlay, allowing you to click on the other windows behind it.
To return to normal mode anytime, activate OnTopReplica by clicking on the task bar (or the tray icon).</value> To return to normal mode anytime, activate OnTopReplica by clicking on the task bar (or the tray icon).</value>
</data> </data>
<data name="InfoClickThroughNo" xml:space="preserve"> <data name="InfoClickThroughNo" xml:space="preserve">
<value>No, thank you. <value>No, thank you.
You can enable click-through later</value> You can enable click-through later</value>
</data> </data>
<data name="InfoClickThroughOk" xml:space="preserve"> <data name="InfoClickThroughOk" xml:space="preserve">
<value>Use Click-Through</value> <value>Use Click-Through</value>
</data> </data>
<data name="InfoClickThroughTitle" xml:space="preserve"> <data name="InfoClickThroughTitle" xml:space="preserve">
<value>Click-Through mode</value> <value>Click-Through mode</value>
</data> </data>
<data name="InfoUpdated" xml:space="preserve"> <data name="InfoUpdated" xml:space="preserve">
<value>OnTopReplica has been updated.</value> <value>OnTopReplica has been updated.</value>
</data> </data>
<data name="InfoUpdatedContent" xml:space="preserve"> <data name="InfoUpdatedContent" xml:space="preserve">
<value>In order to use the updated version of OnTopReplica you'll have to restart the application.</value> <value>In order to use the updated version of OnTopReplica you'll have to restart the application.</value>
</data> </data>
<data name="InfoUpdatedTitle" xml:space="preserve"> <data name="InfoUpdatedTitle" xml:space="preserve">
<value>Update successful</value> <value>Update successful</value>
</data> </data>
<data name="InfoUpToDate" xml:space="preserve"> <data name="InfoUpToDate" xml:space="preserve">
<value>OnTopReplica is up to date.</value> <value>OnTopReplica is up to date.</value>
</data> </data>
<data name="InfoUpToDateTitle" xml:space="preserve"> <data name="InfoUpToDateTitle" xml:space="preserve">
<value>No update available</value> <value>No update available</value>
</data> </data>
<data name="Language" xml:space="preserve"> <data name="Language" xml:space="preserve">
<value>Language</value> <value>Language</value>
</data> </data>
<data name="MenuAbout" xml:space="preserve"> <data name="MenuAbout" xml:space="preserve">
<value>About...</value> <value>About...</value>
</data> </data>
<data name="MenuAboutTT" xml:space="preserve"> <data name="MenuAboutTT" xml:space="preserve">
<value>Hides the main window and displays the "about" box.</value> <value>Hides the main window and displays the "about" box.</value>
</data> </data>
<data name="MenuAdvanced" xml:space="preserve"> <data name="MenuAdvanced" xml:space="preserve">
<value>Advanced</value> <value>Advanced</value>
</data> </data>
<data name="MenuChrome" xml:space="preserve"> <data name="MenuChrome" xml:space="preserve">
<value>Chrome</value> <value>Chrome</value>
</data> </data>
<data name="MenuChromeTT" xml:space="preserve"> <data name="MenuChromeTT" xml:space="preserve">
<value>Toggles the display of the window chrome.</value> <value>Toggles the display of the window chrome.</value>
</data> </data>
<data name="MenuClickForwarding" xml:space="preserve"> <data name="MenuClickForwarding" xml:space="preserve">
<value>Enable Click forwarding</value> <value>Enable Click forwarding</value>
</data> </data>
<data name="MenuClickForwardingTT" xml:space="preserve"> <data name="MenuClickForwardingTT" xml:space="preserve">
<value>Enable "click forwarding" to the cloned window.</value> <value>Enable "click forwarding" to the cloned window.</value>
</data> </data>
<data name="MenuClickThrough" xml:space="preserve"> <data name="MenuClickThrough" xml:space="preserve">
<value>Enable Click-Through</value> <value>Enable Click-Through</value>
</data> </data>
<data name="MenuClickThroughTT" xml:space="preserve"> <data name="MenuClickThroughTT" xml:space="preserve">
<value>OnTopReplica will behave like a transparent overlay that lets your clicks through to the windows below.</value> <value>OnTopReplica will behave like a transparent overlay that lets your clicks through to the windows below.</value>
</data> </data>
<data name="MenuClose" xml:space="preserve"> <data name="MenuClose" xml:space="preserve">
<value>Close</value> <value>Close</value>
</data> </data>
<data name="MenuCloseTT" xml:space="preserve"> <data name="MenuCloseTT" xml:space="preserve">
<value>Closes OnTopReplica.</value> <value>Closes OnTopReplica.</value>
</data> </data>
<data name="MenuFitDouble" xml:space="preserve"> <data name="MenuFitDouble" xml:space="preserve">
<value>2:1 Double</value> <value>2:1 Double</value>
</data> </data>
<data name="MenuFitFullscreen" xml:space="preserve"> <data name="MenuFitFullscreen" xml:space="preserve">
<value>Fullscreen</value> <value>Fullscreen</value>
</data> </data>
<data name="MenuFitHalf" xml:space="preserve"> <data name="MenuFitHalf" xml:space="preserve">
<value>1:2 Half</value> <value>1:2 Half</value>
</data> </data>
<data name="MenuFitOriginal" xml:space="preserve"> <data name="MenuFitOriginal" xml:space="preserve">
<value>1:1 Fit to window</value> <value>1:1 Fit to window</value>
</data> </data>
<data name="MenuFitQuarter" xml:space="preserve"> <data name="MenuFitQuarter" xml:space="preserve">
<value>1:4 Quarter</value> <value>1:4 Quarter</value>
</data> </data>
<data name="MenuGlass" xml:space="preserve"> <data name="MenuGlass" xml:space="preserve">
<value>Glass</value> <value>Glass</value>
</data> </data>
<data name="MenuGlassTT" xml:space="preserve"> <data name="MenuGlassTT" xml:space="preserve">
<value>Toggles "glass mode" on and off.</value> <value>Toggles "glass mode" on and off.</value>
</data> </data>
<data name="MenuGroupSwitch" xml:space="preserve"> <data name="MenuGroupSwitch" xml:space="preserve">
<value>Group Switch mode</value> <value>Group Switch mode</value>
</data> </data>
<data name="MenuGroupSwitchTT" xml:space="preserve"> <data name="MenuGroupSwitchTT" xml:space="preserve">
<value>OnTopReplica will automatically clone a window from an user defined group, switching to the one least recently activated to the foreground.</value> <value>OnTopReplica will automatically clone a window from an user defined group, switching to the one least recently activated to the foreground.</value>
</data> </data>
<data name="MenuOp100" xml:space="preserve"> <data name="MenuOp100" xml:space="preserve">
<value>100% (opaque)</value> <value>100% (opaque)</value>
</data> </data>
<data name="MenuOp100TT" xml:space="preserve"> <data name="MenuOp100TT" xml:space="preserve">
<value>Sets OnTopReplica to be completely opaque.</value> <value>Sets OnTopReplica to be completely opaque.</value>
</data> </data>
<data name="MenuOp25" xml:space="preserve"> <data name="MenuOp25" xml:space="preserve">
<value>25%</value> <value>25%</value>
</data> </data>
<data name="MenuOp25TT" xml:space="preserve"> <data name="MenuOp25TT" xml:space="preserve">
<value>Sets OnTopReplica to 25% opacity.</value> <value>Sets OnTopReplica to 25% opacity.</value>
</data> </data>
<data name="MenuOp50" xml:space="preserve"> <data name="MenuOp50" xml:space="preserve">
<value>50%</value> <value>50%</value>
</data> </data>
<data name="MenuOp50TT" xml:space="preserve"> <data name="MenuOp50TT" xml:space="preserve">
<value>Sets OnTopReplica to 50% opacity.</value> <value>Sets OnTopReplica to 50% opacity.</value>
</data> </data>
<data name="MenuOp75" xml:space="preserve"> <data name="MenuOp75" xml:space="preserve">
<value>75%</value> <value>75%</value>
</data> </data>
<data name="MenuOp75TT" xml:space="preserve"> <data name="MenuOp75TT" xml:space="preserve">
<value>Sets OnTopReplica to 75% opacity.</value> <value>Sets OnTopReplica to 75% opacity.</value>
</data> </data>
<data name="MenuOpacity" xml:space="preserve"> <data name="MenuOpacity" xml:space="preserve">
<value>Opacity</value> <value>Opacity</value>
</data> </data>
<data name="MenuOpen" xml:space="preserve"> <data name="MenuOpen" xml:space="preserve">
<value>Open</value> <value>Open</value>
</data> </data>
<data name="MenuOpenTT" xml:space="preserve"> <data name="MenuOpenTT" xml:space="preserve">
<value>Displays OnTopReplica.</value> <value>Displays OnTopReplica.</value>
</data> </data>
<data name="MenuPosBottomLeft" xml:space="preserve"> <data name="MenuPosBottomLeft" xml:space="preserve">
<value>Bottom Left</value> <value>Bottom Left</value>
</data> </data>
<data name="MenuPosBottomRight" xml:space="preserve"> <data name="MenuPosBottomRight" xml:space="preserve">
<value>Bottom Right</value> <value>Bottom Right</value>
</data> </data>
<data name="MenuPosition" xml:space="preserve"> <data name="MenuPosition" xml:space="preserve">
<value>Position</value> <value>Position lock</value>
</data> </data>
<data name="MenuPositionTT" xml:space="preserve"> <data name="MenuPositionTT" xml:space="preserve">
<value>Automatically position OnTopReplica on the current screen.</value> <value>Automatically position OnTopReplica on the current screen.</value>
</data> </data>
<data name="MenuPosTopLeft" xml:space="preserve"> <data name="MenuPosTopLeft" xml:space="preserve">
<value>Top Left</value> <value>Top Left</value>
</data> </data>
<data name="MenuPosTopRight" xml:space="preserve"> <data name="MenuPosTopRight" xml:space="preserve">
<value>Top Right</value> <value>Top Right</value>
</data> </data>
<data name="MenuQuitFullscreen" xml:space="preserve"> <data name="MenuQuitFullscreen" xml:space="preserve">
<value>Quit fullscreen mode</value> <value>Quit fullscreen mode</value>
</data> </data>
<data name="MenuRecall" xml:space="preserve"> <data name="MenuRecall" xml:space="preserve">
<value>Recall last position and size</value> <value>Recall last position and size</value>
</data> </data>
<data name="MenuRecallTT" xml:space="preserve"> <data name="MenuRecallTT" xml:space="preserve">
<value>Toggles whether OnTopReplica should store its last position and size and use them when it is restarted.</value> <value>Toggles whether OnTopReplica should store its last position and size and use them when it is restarted.</value>
</data> </data>
<data name="MenuReduce" xml:space="preserve"> <data name="MenuReduce" xml:space="preserve">
<value>Minimize</value> <value>Minimize</value>
</data> </data>
<data name="MenuReduceTT" xml:space="preserve"> <data name="MenuReduceTT" xml:space="preserve">
<value>Minimizes OnTopReplica to the task bar (or the tray).</value> <value>Minimizes OnTopReplica to the task bar (or the tray).</value>
</data> </data>
<data name="MenuRegion" xml:space="preserve"> <data name="MenuRegion" xml:space="preserve">
<value>Select region...</value> <value>Select region...</value>
</data> </data>
<data name="MenuRegionTT" xml:space="preserve"> <data name="MenuRegionTT" xml:space="preserve">
<value>Switches to "region mode", that allows you to select a limited region of the source's window as thumbnail.</value> <value>Switches to "region mode", that allows you to select a limited region of the source's window as thumbnail.</value>
</data> </data>
<data name="MenuReset" xml:space="preserve"> <data name="MenuReset" xml:space="preserve">
<value>Reset window</value> <value>Reset window</value>
</data> </data>
<data name="MenuResetTT" xml:space="preserve"> <data name="MenuResetTT" xml:space="preserve">
<value>Resets OnTopReplica settings and its main window.</value> <value>Resets OnTopReplica settings and its main window.</value>
</data> </data>
<data name="MenuResize" xml:space="preserve"> <data name="MenuResize" xml:space="preserve">
<value>Resize</value> <value>Resize</value>
</data> </data>
<data name="MenuSwitch" xml:space="preserve"> <data name="MenuSwitch" xml:space="preserve">
<value>Switch to window</value> <value>Switch to window</value>
</data> </data>
<data name="MenuSwitchTT" xml:space="preserve"> <data name="MenuSwitchTT" xml:space="preserve">
<value>Switches to the source window and hides OnTopReplica.</value> <value>Switches to the source window and hides OnTopReplica.</value>
</data> </data>
<data name="MenuWindows" xml:space="preserve"> <data name="MenuWindows" xml:space="preserve">
<value>Select window</value> <value>Select window</value>
</data> </data>
<data name="MenuWindowsNone" xml:space="preserve"> <data name="MenuWindowsNone" xml:space="preserve">
<value>- none -</value> <value>- none -</value>
</data> </data>
<data name="MenuWindowsTT" xml:space="preserve"> <data name="MenuWindowsTT" xml:space="preserve">
<value>Displays a list of window you can select as thumbnail source.</value> <value>Displays a list of window you can select as thumbnail source.</value>
</data> </data>
<data name="MenuWindowsWholeRegion" xml:space="preserve"> <data name="MenuWindowsWholeRegion" xml:space="preserve">
<value>- whole -</value> <value>- whole -</value>
</data> </data>
<data name="RegionsCurrentRegion" xml:space="preserve"> <data name="RegionsCurrentRegion" xml:space="preserve">
<value>Current region:</value> <value>Current region:</value>
</data> </data>
<data name="RegionsDeleteButton" xml:space="preserve"> <data name="RegionsDeleteButton" xml:space="preserve">
<value>Delete</value> <value>Delete</value>
</data> </data>
<data name="RegionsDoneButton" xml:space="preserve"> <data name="RegionsDoneButton" xml:space="preserve">
<value>Done</value> <value>Done</value>
</data> </data>
<data name="RegionsHeight" xml:space="preserve"> <data name="RegionsHeight" xml:space="preserve">
<value>Height</value> <value>Height</value>
</data> </data>
<data name="RegionsResetButton" xml:space="preserve"> <data name="RegionsResetButton" xml:space="preserve">
<value>Reset</value> <value>Reset</value>
</data> </data>
<data name="RegionsSaveButton" xml:space="preserve"> <data name="RegionsSaveButton" xml:space="preserve">
<value>Save</value> <value>Save</value>
</data> </data>
<data name="RegionsStoredRegions" xml:space="preserve"> <data name="RegionsStoredRegions" xml:space="preserve">
<value>Stored regions</value> <value>Stored regions</value>
</data> </data>
<data name="RegionsTitle" xml:space="preserve"> <data name="RegionsTitle" xml:space="preserve">
<value>Regions:</value> <value>Regions:</value>
</data> </data>
<data name="RegionsWidth" xml:space="preserve"> <data name="RegionsWidth" xml:space="preserve">
<value>Width</value> <value>Width</value>
</data> </data>
<data name="RightClick" xml:space="preserve"> <data name="RightClick" xml:space="preserve">
<value>Right-click here to start...</value> <value>Right-click here to start...</value>
</data> </data>
<data name="Slogan" xml:space="preserve"> <data name="Slogan" xml:space="preserve">
<value>A lightweight, real-time, always on top thumbnail of a window of your choice.</value> <value>A lightweight, real-time, always on top thumbnail of a window of your choice.</value>
</data> </data>
<data name="UpdateDisclaimer" xml:space="preserve"> <data name="UpdateDisclaimer" xml:space="preserve">
<value>OnTopReplica automatically checks for updates. No information is logged at any point.</value> <value>OnTopReplica automatically checks for updates. No information is logged at any point.</value>
</data> </data>
<data name="UpdateNow" xml:space="preserve"> <data name="UpdateNow" xml:space="preserve">
<value>Update now!</value> <value>Update now!</value>
</data> </data>
<data name="MenuPosCenter" xml:space="preserve">
<value>Center</value>
</data>
<data name="MenuPosDisabled" xml:space="preserve">
<value>Disabled</value>
</data>
</root> </root>

View file

@ -8,7 +8,8 @@ namespace OnTopReplica {
/// <summary>Helper class that keeps a window handle (HWND), the title of the window and can load its icon.</summary> /// <summary>Helper class that keeps a window handle (HWND), the title of the window and can load its icon.</summary>
public class WindowHandle : System.Windows.Forms.IWin32Window { public class WindowHandle : System.Windows.Forms.IWin32Window {
IntPtr _handle;
IntPtr _handle;
string _title; string _title;
public WindowHandle(IntPtr p, string title) { public WindowHandle(IntPtr p, string title) {
@ -81,5 +82,13 @@ namespace OnTopReplica {
#endregion #endregion
/// <summary>
/// Creates a new windowHandle instance from a given IntPtr handle.
/// </summary>
/// <param name="handle">Handle value.</param>
public static WindowHandle FromHandle(IntPtr handle) {
return new WindowHandle(handle, string.Empty);
}
} }
} }

View file

@ -3,8 +3,12 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using OnTopReplica.Properties; using OnTopReplica.Properties;
using OnTopReplica.WindowSeekers;
namespace OnTopReplica { namespace OnTopReplica {
/// <summary>
/// Extension methods used to apply a window list to a menu.
/// </summary>
static class WindowListHelper { static class WindowListHelper {
public class WindowSelectionData { public class WindowSelectionData {
@ -14,7 +18,15 @@ namespace OnTopReplica {
const int MaxWindowTitleLength = 55; const int MaxWindowTitleLength = 55;
public static void PopulateMenu(Form ownerForm, WindowManager windowManager, ToolStrip menu, /// <summary>
/// Populates the menu with a list of windows.
/// </summary>
/// <param name="menu">The menu to populate.</param>
/// <param name="ownerForm">The owning form.</param>
/// <param name="windowManager">The window manager that provides the windows list.</param>
/// <param name="currentHandle">The currently used window (will be checked in the list).</param>
/// <param name="clickHandler">Event handler for clicks on window items.</param>
public static void PopulateMenu(this ToolStrip menu, Form ownerForm, BaseWindowSeeker windowManager,
WindowHandle currentHandle, EventHandler clickHandler) { WindowHandle currentHandle, EventHandler clickHandler) {
var regions = GetRegions(); var regions = GetRegions();

View file

@ -1,104 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Native;
namespace OnTopReplica {
/// <summary>A helper class that allows you to easily build and keep a list of Windows (in the form of WindowHandle objects).</summary>
public class WindowManager {
List<WindowHandle> _windows = new List<WindowHandle>();
public enum EnumerationMode {
/// <summary>All windows with 'Visible' flag.</summary>
AllVisible,
/// <summary>All top level windows.</summary>
AllTopLevel,
/// <summary>Windows of a task (like Alt+Tab).</summary>
TaskWindows
}
/// <summary>Refreshes the window list.</summary>
public void Refresh(EnumerationMode mode) {
_windows = new List<WindowHandle>();
WindowManagerMethods.EnumWindowsProc proc = null;
switch (mode) {
case EnumerationMode.AllVisible:
proc = new WindowManagerMethods.EnumWindowsProc(EnumWindowProcAll);
break;
case EnumerationMode.AllTopLevel:
proc = new WindowManagerMethods.EnumWindowsProc(EnumWindowProcTopLevel);
break;
case EnumerationMode.TaskWindows:
proc = new WindowManagerMethods.EnumWindowsProc(EnumWindowProcTask);
break;
}
WindowManagerMethods.EnumWindows(proc, IntPtr.Zero);
}
public IEnumerable<WindowHandle> Windows {
get {
return _windows;
}
}
private bool EnumWindowProcAll(IntPtr hwnd, IntPtr lParam) {
if (WindowManagerMethods.IsWindowVisible(hwnd)) {
string title = WindowMethods.GetWindowText(hwnd);
_windows.Add( new WindowHandle(hwnd, title));
}
return true;
}
private bool EnumWindowProcTopLevel(IntPtr hwnd, IntPtr lParam) {
if (WindowManagerMethods.IsWindowVisible(hwnd)) {
//Check if window has no parent
if ((long)WindowManagerMethods.GetParent(hwnd) == 0 && WindowManagerMethods.GetDesktopWindow() != hwnd) {
string title = WindowMethods.GetWindowText(hwnd);
_windows.Add( new WindowHandle(hwnd, title));
}
}
return true;
}
private bool EnumWindowProcTask(IntPtr hwnd, IntPtr lParam) {
//Code taken from: http://www.thescarms.com/VBasic/alttab.aspx
//Accept windows that
// - are visible
// - do not have a parent
// - have no owner and are not Tool windows OR
// - have an owner and are App windows
//Reject empty titles
string title = WindowMethods.GetWindowText(hwnd);
if (string.IsNullOrEmpty(title))
return true;
if (WindowManagerMethods.IsWindowVisible(hwnd)) {
if ((long)WindowManagerMethods.GetParent(hwnd) == 0) {
bool hasOwner = (long)WindowManagerMethods.GetWindow(hwnd, WindowManagerMethods.GetWindowMode.GW_OWNER) != 0;
WindowMethods.WindowExStyles exStyle = (WindowMethods.WindowExStyles)WindowMethods.GetWindowLong(hwnd, WindowMethods.WindowLong.ExStyle);
if (((exStyle & WindowMethods.WindowExStyles.ToolWindow) == 0 && !hasOwner) || //unowned non-tool window
((exStyle & WindowMethods.WindowExStyles.AppWindow) == WindowMethods.WindowExStyles.AppWindow && hasOwner)) { //owned application window
_windows.Add(new WindowHandle(hwnd, title));
}
}
}
return true;
}
}
}

View file

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Native;
namespace OnTopReplica.WindowSeekers {
/// <summary>
/// Base class for window seekers that can populate a list of window handles based on some criteria.
/// </summary>
abstract class BaseWindowSeeker {
List<WindowHandle> _list = new List<WindowHandle>();
/// <summary>
/// Get the matching windows from the last refresh.
/// </summary>
public IEnumerable<WindowHandle> Windows {
get {
return _list;
}
}
/// <summary>
/// Forces a window list refresh.
/// </summary>
public virtual void Refresh() {
_list.Clear();
WindowManagerMethods.EnumWindows(
new WindowManagerMethods.EnumWindowsProc(RefreshCallback),
IntPtr.Zero);
}
private bool RefreshCallback(IntPtr hwnd, IntPtr lParam) {
bool cont = true;
//Skip owner
if (hwnd == OwnerHandle)
return true;
if (SkipNotVisibleWindows && !WindowManagerMethods.IsWindowVisible(hwnd))
return true;
//Extract basic properties
string title = WindowMethods.GetWindowText(hwnd);
if (InspectWindow(hwnd, title, ref cont)) {
//Window has been picked
_list.Add(new WindowHandle(hwnd, title));
}
return cont;
}
/// <summary>
/// Inspects a window and returns whether the window should be listed or not.
/// </summary>
/// <param name="hwnd">Handle of the window.</param>
/// <param name="title">Title of the window (if any).</param>
/// <param name="terminate">Indicates whether the inspection loop should terminate after this window.</param>
/// <returns>True if the window should be listed.</returns>
protected abstract bool InspectWindow(IntPtr hwnd, string title, ref bool terminate);
/// <summary>
/// Gets or sets the window handle of the owner.
/// </summary>
/// <remarks>
/// Windows with this handle will be automatically skipped.
/// </remarks>
public IntPtr OwnerHandle { get; set; }
/// <summary>
/// Gets or sets whether not visible windows should be skipped.
/// </summary>
public bool SkipNotVisibleWindows { get; set; }
}
}

View file

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Native;
namespace OnTopReplica.WindowSeekers {
/// <summary>
/// Seeks a single window by matching its window class.
/// </summary>
/// <remarks>
/// Class matching is exact and case-sensititve.
/// </remarks>
class ByClassWindowSeeker : BaseWindowSeeker {
public ByClassWindowSeeker(string className) {
if (className == null)
throw new ArgumentNullException();
ClassName = className;
}
public string ClassName { get; private set; }
protected override bool InspectWindow(IntPtr hwnd, string title, ref bool terminate) {
var wndClass = WindowMethods.GetWindowClass(hwnd);
if (ClassName.Equals(wndClass, StringComparison.CurrentCulture)) {
return true;
}
return false;
}
}
}

View file

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Native;
namespace OnTopReplica.WindowSeekers {
/// <summary>
/// Seeks a single window by approximately matching its title.
/// </summary>
/// <remarks>
/// Title search is case-insensitive and matches only the beginning of the windows' titles.
/// </remarks>
class ByTitleWindowSeeker : BaseWindowSeeker {
public ByTitleWindowSeeker(string titleSeekString) {
if (titleSeekString == null)
throw new ArgumentNullException();
TitleMatch = titleSeekString.Trim().ToLower();
}
public string TitleMatch { get; private set; }
protected override bool InspectWindow(IntPtr hwnd, string title, ref bool terminate) {
//Skip empty titles
if (string.IsNullOrEmpty(title))
return false;
//Skip non-top-level windows (skips most internal controls)
bool hasParent = (long)WindowManagerMethods.GetParent(hwnd) != 0;
bool hasOwner = (long)WindowManagerMethods.GetWindow(hwnd, WindowManagerMethods.GetWindowMode.GW_OWNER) != 0;
if (hasParent || hasOwner)
return false;
var modTitle = title.Trim().ToLower();
if (modTitle.StartsWith(TitleMatch)) {
terminate = true; //only one needed
return true;
}
return false;
}
}
}

View file

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Text;
using OnTopReplica.Native;
namespace OnTopReplica.WindowSeekers {
class TaskWindowSeeker : BaseWindowSeeker {
protected override bool InspectWindow(IntPtr hwnd, string title, ref bool terminate) {
//Code taken from: http://www.thescarms.com/VBasic/alttab.aspx
//Accept windows that
// - are visible
// - do not have a parent
// - have no owner and are not Tool windows OR
// - have an owner and are App windows
//Reject empty titles
if (string.IsNullOrEmpty(title))
return false;
if ((long)WindowManagerMethods.GetParent(hwnd) == 0) {
bool hasOwner = (long)WindowManagerMethods.GetWindow(hwnd, WindowManagerMethods.GetWindowMode.GW_OWNER) != 0;
WindowMethods.WindowExStyles exStyle = (WindowMethods.WindowExStyles)WindowMethods.GetWindowLong(hwnd, WindowMethods.WindowLong.ExStyle);
if (((exStyle & WindowMethods.WindowExStyles.ToolWindow) == 0 && !hasOwner) || //unowned non-tool window
((exStyle & WindowMethods.WindowExStyles.AppWindow) == WindowMethods.WindowExStyles.AppWindow && hasOwner)) { //owned application window
return true;
}
}
return false;
}
}
}

View file

@ -31,11 +31,14 @@
<setting name="FullscreenAlwaysOnTop" serializeAs="String"> <setting name="FullscreenAlwaysOnTop" serializeAs="String">
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="Setting" serializeAs="String"> <setting name="RestoreSizeAndPosition" serializeAs="String">
<value /> <value>False</value>
</setting> </setting>
<setting name="Setting1" serializeAs="String"> <setting name="RestoreLastSize" serializeAs="String">
<value /> <value>0, 0</value>
</setting>
<setting name="RestoreLastPosition" serializeAs="String">
<value>0, 0</value>
</setting> </setting>
</OnTopReplica.Properties.Settings> </OnTopReplica.Properties.Settings>
</userSettings> </userSettings>