mirror of
https://github.com/LorenzCK/OnTopReplica.git
synced 2024-06-03 11:04:32 +12:00
Merge 7a8ae1a795
into 63e9487423
This commit is contained in:
commit
8defa9cca7
|
@ -67,6 +67,9 @@ namespace OnTopReplica.StartupOptions {
|
||||||
|
|
||||||
private static void ParseCommandLine(string[] args, Options options) {
|
private static void ParseCommandLine(string[] args, Options options) {
|
||||||
var cmdOptions = new NDesk.Options.OptionSet()
|
var cmdOptions = new NDesk.Options.OptionSet()
|
||||||
|
.Add<int>("screen=", "ScreenIndex to display on.", id => {
|
||||||
|
options.ScreenIndex = id;
|
||||||
|
})
|
||||||
.Add<long>("windowId=", "Window handle ({HWND}) to be cloned.", id => {
|
.Add<long>("windowId=", "Window handle ({HWND}) to be cloned.", id => {
|
||||||
options.WindowId = new IntPtr(id);
|
options.WindowId = new IntPtr(id);
|
||||||
options.WindowTitle = null;
|
options.WindowTitle = null;
|
||||||
|
|
|
@ -5,7 +5,8 @@ using System.Text;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using OnTopReplica.WindowSeekers;
|
using OnTopReplica.WindowSeekers;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace OnTopReplica.StartupOptions {
|
namespace OnTopReplica.StartupOptions {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -19,7 +20,9 @@ namespace OnTopReplica.StartupOptions {
|
||||||
DisableChrome = false;
|
DisableChrome = false;
|
||||||
MustBeVisible = false;
|
MustBeVisible = false;
|
||||||
Fullscreen = false;
|
Fullscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ScreenIndex = 0;
|
||||||
|
|
||||||
#region Position and size
|
#region Position and size
|
||||||
|
|
||||||
|
@ -97,6 +100,12 @@ namespace OnTopReplica.StartupOptions {
|
||||||
|
|
||||||
#region Application
|
#region Application
|
||||||
|
|
||||||
|
private void setFormLocation(Form form, Screen screen) {
|
||||||
|
Point start = StartLocation ?? default(Point);
|
||||||
|
Point loc = new Point(start.X + screen.WorkingArea.Location.X, start.Y + screen.WorkingArea.Location.Y);
|
||||||
|
form.Location = loc;
|
||||||
|
}
|
||||||
|
|
||||||
public void Apply(MainForm form) {
|
public void Apply(MainForm form) {
|
||||||
Log.Write("Applying command line launch parameters");
|
Log.Write("Applying command line launch parameters");
|
||||||
|
|
||||||
|
@ -160,6 +169,9 @@ namespace OnTopReplica.StartupOptions {
|
||||||
form.ClientSize = StartSize.Value;
|
form.ClientSize = StartSize.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ScreenIndex != 0) {
|
||||||
|
setFormLocation(form, Screen.AllScreens[ScreenIndex]);
|
||||||
|
}
|
||||||
//Other features
|
//Other features
|
||||||
if (EnableClickForwarding) {
|
if (EnableClickForwarding) {
|
||||||
form.ClickForwardingEnabled = true;
|
form.ClickForwardingEnabled = true;
|
||||||
|
|
Loading…
Reference in a new issue