mirror of
https://github.com/LorenzCK/OnTopReplica.git
synced 2024-05-21 04:43:55 +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) {
|
||||
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 => {
|
||||
options.WindowId = new IntPtr(id);
|
||||
options.WindowTitle = null;
|
||||
|
|
|
@ -5,7 +5,8 @@ using System.Text;
|
|||
using System.Drawing;
|
||||
using System.IO;
|
||||
using OnTopReplica.WindowSeekers;
|
||||
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OnTopReplica.StartupOptions {
|
||||
|
||||
/// <summary>
|
||||
|
@ -19,7 +20,9 @@ namespace OnTopReplica.StartupOptions {
|
|||
DisableChrome = false;
|
||||
MustBeVisible = false;
|
||||
Fullscreen = false;
|
||||
}
|
||||
}
|
||||
|
||||
public int ScreenIndex = 0;
|
||||
|
||||
#region Position and size
|
||||
|
||||
|
@ -97,6 +100,12 @@ namespace OnTopReplica.StartupOptions {
|
|||
|
||||
#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) {
|
||||
Log.Write("Applying command line launch parameters");
|
||||
|
||||
|
@ -160,6 +169,9 @@ namespace OnTopReplica.StartupOptions {
|
|||
form.ClientSize = StartSize.Value;
|
||||
}
|
||||
|
||||
if (ScreenIndex != 0) {
|
||||
setFormLocation(form, Screen.AllScreens[ScreenIndex]);
|
||||
}
|
||||
//Other features
|
||||
if (EnableClickForwarding) {
|
||||
form.ClickForwardingEnabled = true;
|
||||
|
|
Loading…
Reference in a new issue