Исправил баги с переключением экранна
This commit is contained in:
parent
c4793cf63f
commit
3ce6ddffe4
Binary file not shown.
|
|
@ -42,9 +42,9 @@
|
|||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 180);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(355, 13);
|
||||
this.label1.Size = new System.Drawing.Size(347, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "SCCMманагер программа для удобной организации работы c CSSM\r\n";
|
||||
this.label1.Text = "SCCMанагер программа для удобной организации работы c CSSM\r\n";
|
||||
//
|
||||
// label20
|
||||
//
|
||||
|
|
|
|||
|
|
@ -103,15 +103,30 @@ namespace Remontor.Connector
|
|||
SetParent(Proc.MainWindowHandle, View.Handle);
|
||||
SetWindowLong(Proc.MainWindowHandle, GWL_STYLE, WS_VISIBLE);
|
||||
ModeMonitor.Resize(Proc, View);
|
||||
ModeMonitor.Resize(Proc, View);
|
||||
|
||||
// hwnd = GetWindowHandleByTitle("Устанавливается контакт с агентом удаленного управления на клиенте " + ConnectStr);
|
||||
|
||||
Thread.Sleep(50);
|
||||
hwnd = GetWindowHandleByTitle("Contacting Remote Control Agent on client " + ConnectStr);
|
||||
|
||||
hwnd = GetWindowHandleByTitle("Устанавливается контакт с агентом удаленного управления на клиенте " + ConnectStr.Split(' ')[0]) ;
|
||||
// hwnd = GetWindowHandleByTitle("Contacting Remote Control Agent on client " + ConnectStr);
|
||||
Point CenterView = new Point(View.Bounds.Width/2, View.Bounds.Height/2);
|
||||
Point CenterDraw = View.PointToScreen(CenterView);
|
||||
MoveWindow(hwnd, CenterDraw.X- 325, CenterDraw.Y - 125 ,650,250,true);
|
||||
|
||||
Task.Run(new Action(() => {
|
||||
Thread.Sleep(3000);
|
||||
System.Console.WriteLine("reenew");
|
||||
|
||||
SConnector.FormMain.Invoke(new MethodInvoker(delegate
|
||||
{
|
||||
Resize();
|
||||
}));
|
||||
}));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception) {
|
||||
MessageBox.Show("Не верно заданно приложение для подключения.");
|
||||
ModeMonitor = new OffMon();
|
||||
|
|
@ -169,10 +184,13 @@ namespace Remontor.Connector
|
|||
{
|
||||
this.Active = act;
|
||||
View.Visible = act;
|
||||
if (act) Resize();
|
||||
// if (act) Resize();
|
||||
if (act)
|
||||
{
|
||||
ShowWindow(hwnd, 5);
|
||||
|
||||
ModeMonitor.Set();
|
||||
ModeMonitor.Resize(Proc, View);
|
||||
Point CenterView = new Point(View.Bounds.Width / 2, View.Bounds.Height / 2);
|
||||
Point CenterDraw = View.PointToScreen(CenterView);
|
||||
MoveWindow(hwnd, CenterDraw.X - 325, CenterDraw.Y - 125, 650, 250, true);
|
||||
|
|
@ -183,7 +201,7 @@ namespace Remontor.Connector
|
|||
}
|
||||
|
||||
|
||||
ModeMonitor.Resize(Proc, View);
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
|
|
@ -201,6 +219,11 @@ namespace Remontor.Connector
|
|||
MoveWindow(hwnd, CenterDraw.X - 325, CenterDraw.Y - 125, 650, 250, true);
|
||||
}
|
||||
|
||||
public void StateChange()
|
||||
{
|
||||
ModeMonitor.Set();
|
||||
}
|
||||
|
||||
public IModeMon GetModeMon()
|
||||
{
|
||||
return ModeMonitor;
|
||||
|
|
@ -209,6 +232,7 @@ namespace Remontor.Connector
|
|||
public IModeMon SetModeMon(IModeMon Mode)
|
||||
{
|
||||
ModeMonitor = ModeMonitor.Change(Mode);
|
||||
ModeMonitor.Set();
|
||||
ModeMonitor.Resize(Proc, View);
|
||||
return ModeMonitor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,13 +23,22 @@ namespace Remontor.Connector
|
|||
private int over = 0;
|
||||
public DobleMonFull()
|
||||
{
|
||||
OldWidth = SConnector.FormMain.Bounds.Width;
|
||||
OldHeight = SConnector.FormMain.Height;
|
||||
OldState = SConnector.FormMain.WindowState;
|
||||
OldPoint = SConnector.FormMain.Location;
|
||||
// OldWidth = SConnector.FormMain.Bounds.Width;
|
||||
//OldHeight = SConnector.FormMain.Height;
|
||||
//OldState = SConnector.FormMain.WindowState;
|
||||
//OldPoint = SConnector.FormMain.Location;
|
||||
//System.Console.WriteLine(OldWidth.ToString());
|
||||
//System.Console.WriteLine(OldHeight.ToString());
|
||||
|
||||
}
|
||||
public override void Set()
|
||||
{
|
||||
|
||||
}
|
||||
public override void Resize(Process Proc, Control View)
|
||||
{
|
||||
if (Chanded) return;
|
||||
Chanded = true;
|
||||
if (over == 0)
|
||||
{
|
||||
over = 1;
|
||||
|
|
@ -38,32 +47,20 @@ namespace Remontor.Connector
|
|||
{
|
||||
over = 0;
|
||||
}
|
||||
if (Chanded) return;
|
||||
Chanded = true;
|
||||
|
||||
|
||||
SConnector.FormMain.WindowState = FormWindowState.Normal;
|
||||
Chanded = false;
|
||||
SConnector.FormMain.Width = SGlobalSetting.settingApp.WidthDoble;
|
||||
SConnector.FormMain.Height = SGlobalSetting.settingApp.HeightDoble;
|
||||
SConnector.FormMain.Location = new System.Drawing.Point(SGlobalSetting.settingApp.xPosDoble, SGlobalSetting.settingApp.yPosDoble);
|
||||
Chanded = false;
|
||||
MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y + 9, View.Bounds.Width, View.Bounds.Height - 9 + over, true);
|
||||
}
|
||||
|
||||
public override IModeMon Change(IModeMon Mode)
|
||||
{
|
||||
|
||||
if (!(Mode is DobleMonFull))
|
||||
{
|
||||
Chanded = true;
|
||||
SConnector.FormMain.WindowState = OldState;
|
||||
SConnector.FormMain.Width = OldWidth;
|
||||
SConnector.FormMain.Height = OldHeight;
|
||||
SConnector.FormMain.Location = OldPoint;
|
||||
Chanded = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
if (Mode == this) return this;
|
||||
return Mode;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,22 @@ namespace Remontor.Connector
|
|||
[DllImport("user32.dll")]
|
||||
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
||||
private int over = 0;
|
||||
public DobleMonOne() { }
|
||||
public override void Resize(Process Proc, Control View)
|
||||
private bool Chanded = true;
|
||||
public DobleMonOne() {
|
||||
|
||||
}
|
||||
public override void Set()
|
||||
{
|
||||
Chanded = true;
|
||||
SConnector.FormMain.WindowState = SConnector.WindowState;
|
||||
SConnector.FormMain.Location = new System.Drawing.Point(SConnector.x, SConnector.y);
|
||||
SConnector.FormMain.Width = SConnector.Width;
|
||||
SConnector.FormMain.Height = SConnector.Height;
|
||||
Chanded = false;
|
||||
}
|
||||
public override void Resize(Process Proc, Control View)
|
||||
{
|
||||
if (Chanded) return;
|
||||
if (over == 0)
|
||||
{
|
||||
over = 1;
|
||||
|
|
@ -26,6 +39,17 @@ namespace Remontor.Connector
|
|||
{
|
||||
over = 0;
|
||||
}
|
||||
|
||||
Chanded = true;
|
||||
if(SConnector.FormMain.WindowState == FormWindowState.Normal)
|
||||
{
|
||||
SConnector.Width = SConnector.FormMain.Width;
|
||||
SConnector.Height = SConnector.FormMain.Height;
|
||||
SConnector.x = SConnector.FormMain.Location.X;
|
||||
SConnector.y = SConnector.FormMain.Location.Y;
|
||||
}
|
||||
SConnector.WindowState = SConnector.FormMain.WindowState;
|
||||
Chanded = false;
|
||||
MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y + 9, View.Bounds.Width * 2, View.Bounds.Height - 9 + over, true);
|
||||
}
|
||||
public override IModeMon Change(IModeMon Mode)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,22 @@ namespace Remontor.Connector
|
|||
[DllImport("user32.dll")]
|
||||
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
||||
private int over = 0;
|
||||
public DobleMonTwo() { }
|
||||
public override void Resize(Process Proc, Control View)
|
||||
private bool Chanded = true;
|
||||
public DobleMonTwo() {
|
||||
|
||||
}
|
||||
public override void Set()
|
||||
{
|
||||
Chanded = true;
|
||||
SConnector.FormMain.WindowState = SConnector.WindowState;
|
||||
SConnector.FormMain.Location = new System.Drawing.Point(SConnector.x, SConnector.y);
|
||||
SConnector.FormMain.Width = SConnector.Width;
|
||||
SConnector.FormMain.Height = SConnector.Height;
|
||||
Chanded = false;
|
||||
}
|
||||
public override void Resize(Process Proc, Control View)
|
||||
{
|
||||
if (Chanded) return;
|
||||
if (over == 0)
|
||||
{
|
||||
over = 1;
|
||||
|
|
@ -25,6 +38,17 @@ namespace Remontor.Connector
|
|||
{
|
||||
over = 0;
|
||||
}
|
||||
|
||||
Chanded = true;
|
||||
if (SConnector.FormMain.WindowState == FormWindowState.Normal)
|
||||
{
|
||||
SConnector.Width = SConnector.FormMain.Width;
|
||||
SConnector.Height = SConnector.FormMain.Height;
|
||||
SConnector.x = SConnector.FormMain.Location.X;
|
||||
SConnector.y = SConnector.FormMain.Location.Y;
|
||||
}
|
||||
SConnector.WindowState = SConnector.FormMain.WindowState;
|
||||
Chanded = false;
|
||||
MoveWindow(Proc.MainWindowHandle, View.Bounds.X - View.Bounds.Width, View.Bounds.Y + 9, View.Bounds.Width * 2, View.Bounds.Height - 9 + over, true);
|
||||
}
|
||||
public override IModeMon Change(IModeMon Mode)
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ namespace Remontor.Connector
|
|||
{
|
||||
public abstract void Resize(Process Proc, Control View);
|
||||
public abstract IModeMon Change(IModeMon Mode);
|
||||
public abstract void Set();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,20 @@ namespace Remontor.Connector
|
|||
{
|
||||
[DllImport("user32.dll")]
|
||||
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
||||
public OffMon() { }
|
||||
private bool Chanded = true;
|
||||
public OffMon() {
|
||||
// SConnector.FormMain.Bounds = SConnector.MainBounds;
|
||||
Chanded = false;
|
||||
}
|
||||
|
||||
public override void Set()
|
||||
{
|
||||
|
||||
}
|
||||
public override void Resize(Process Proc, Control View)
|
||||
{
|
||||
if (Chanded) return;
|
||||
// SConnector.MainBounds = SConnector.FormMain.Bounds;
|
||||
}
|
||||
public override IModeMon Change(IModeMon Mode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Remontor.Setting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
@ -13,12 +14,27 @@ namespace Remontor.Connector
|
|||
{
|
||||
[DllImport("user32.dll")]
|
||||
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
||||
private int over = 0;
|
||||
private int over = 0;
|
||||
private bool Chanded = true;
|
||||
|
||||
public OneMon() { }
|
||||
public OneMon() {
|
||||
|
||||
}
|
||||
|
||||
public override void Set()
|
||||
{
|
||||
Chanded = true;
|
||||
SConnector.FormMain.WindowState = SConnector.WindowState;
|
||||
SConnector.FormMain.Location = new System.Drawing.Point(SConnector.x, SConnector.y);
|
||||
SConnector.FormMain.Width = SConnector.Width;
|
||||
SConnector.FormMain.Height = SConnector.Height;
|
||||
Chanded = false;
|
||||
}
|
||||
public override void Resize(Process Proc, Control View)
|
||||
{
|
||||
if(over == 0)
|
||||
if (Chanded) return;
|
||||
;
|
||||
if (over == 0)
|
||||
{
|
||||
over = 1;
|
||||
}
|
||||
|
|
@ -26,6 +42,17 @@ namespace Remontor.Connector
|
|||
{
|
||||
over = 0;
|
||||
}
|
||||
Chanded = true;
|
||||
if (SConnector.FormMain.WindowState == FormWindowState.Normal)
|
||||
{
|
||||
SConnector.Width = SConnector.FormMain.Width;
|
||||
SConnector.Height = SConnector.FormMain.Height;
|
||||
SConnector.x = SConnector.FormMain.Location.X;
|
||||
SConnector.y = SConnector.FormMain.Location.Y;
|
||||
|
||||
}
|
||||
SConnector.WindowState = SConnector.FormMain.WindowState;
|
||||
Chanded = false;
|
||||
MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y + 9, View.Bounds.Width, View.Bounds.Height - 9 + over, true);
|
||||
}
|
||||
public override IModeMon Change(IModeMon Mode)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ namespace Remontor.Connector
|
|||
public static Control Panel;
|
||||
public static Form1 FormMain;
|
||||
public static Connect ActionConnect = null;
|
||||
public static int x,y, Width, Height;
|
||||
public static FormWindowState WindowState = FormWindowState.Normal;
|
||||
public static void NewConnect(IComp comp)
|
||||
{
|
||||
Connect con = new Connect(comp);
|
||||
|
|
@ -92,6 +94,14 @@ namespace Remontor.Connector
|
|||
}
|
||||
}
|
||||
|
||||
public static void StateChangeActiv()
|
||||
{
|
||||
if (ActionConnect != null)
|
||||
{
|
||||
ActionConnect.StateChange();
|
||||
}
|
||||
}
|
||||
|
||||
public static int ActivConnect()
|
||||
{
|
||||
return Connects.Count();
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
this.DoubleBuffered = true;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "Form1";
|
||||
this.Text = "SCCMманагер";
|
||||
this.Text = "SCCMанагер";
|
||||
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ namespace Remontor
|
|||
|
||||
public bool CloseOn = false;
|
||||
public bool ShowOn = false;
|
||||
private FormWindowState lastWindowsState = FormWindowState.Minimized;
|
||||
public MenuStripCommand MenuStripCommand;
|
||||
public Form1()
|
||||
{
|
||||
|
|
@ -35,6 +36,7 @@ namespace Remontor
|
|||
barSessionControl1.hideTabSetting += flowConteinerSetting1.HideBar;
|
||||
SConnector.Panel = this.panel3;
|
||||
SConnector.FormMain = this;
|
||||
|
||||
|
||||
MenuStripCommand = new MenuStripCommand();
|
||||
MenuStripCommand.UpdateTree += flowContainerWords1.UpdateTree;
|
||||
|
|
@ -53,6 +55,18 @@ namespace Remontor
|
|||
private void tabControl1_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
SConnector.ResizeActiv();
|
||||
if (this.WindowState != lastWindowsState)
|
||||
{
|
||||
|
||||
lastWindowsState = this.WindowState;
|
||||
// if(this.WindowState == FormWindowState.Maximized) SConnector.WindowState = FormWindowState.Maximized;
|
||||
//if (this.WindowState == FormWindowState.Normal)
|
||||
//{
|
||||
// SConnector.WindowState = FormWindowState.Normal;
|
||||
SConnector.StateChangeActiv();
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +87,10 @@ namespace Remontor
|
|||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
SConnector.x = this.Bounds.X;
|
||||
SConnector.y = this.Bounds.Y;
|
||||
SConnector.Width = this.Bounds.Width;
|
||||
SConnector.Height = this.Bounds.Height;
|
||||
}
|
||||
|
||||
private void barSessionControl1_Load(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ namespace Remontor.Picter
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
if (comp.GetName() != null)
|
||||
{
|
||||
|
|
@ -41,7 +40,7 @@ namespace Remontor.Picter
|
|||
new PicLoaderTask(comp.GetName(), image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static public void WriteResult(PicBase picBase)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue