1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-12-28 07:11:59 +00:00

Started Version 3.3.7 development

This commit is contained in:
Stanley 2022-07-10 19:58:54 -04:00
parent 287dcc23dd
commit 191538aff1
6 changed files with 30 additions and 3 deletions

View file

@ -6,6 +6,7 @@
BuiltInPopout,
CustomPopout,
MSFSTouchPanel,
WPFWindow
WPFWindow,
MultiMonitorWindow
}
}

View file

@ -22,6 +22,7 @@ namespace MSFSPopoutPanelManager.Provider
public static void LeftClick(int x, int y)
{
PInvoke.SetCursorPos(x, y);
PInvoke.SetCursorPos(x, y);
Thread.Sleep(300);
@ -42,6 +43,7 @@ namespace MSFSPopoutPanelManager.Provider
LeftClick(x, y);
Thread.Sleep(300);
PInvoke.SetCursorPos(x, y);
PInvoke.SetCursorPos(x, y);
Thread.Sleep(300);

View file

@ -382,6 +382,8 @@ namespace MSFSPopoutPanelManager.Provider
panelInfo.PanelType = PanelType.CustomPopout;
else if (caption.IndexOf("Microsoft Flight Simulator") > -1) // MSFS main game window
return null;
else if (caption.IndexOf("WINDOW") > -1)
panelInfo.PanelType = PanelType.MultiMonitorWindow;
else
panelInfo.PanelType = PanelType.BuiltInPopout;

View file

@ -136,11 +136,14 @@ namespace MSFSPopoutPanelManager.Provider
var className = PInvoke.GetClassName(hwnd);
var caption = PInvoke.GetWindowText(hwnd);
if (className == "AceApp" && caption.IndexOf("WINDOW") > -1) // For multi monitor window, do nothing
return true;
if (className == "AceApp" && (caption.IndexOf("(Custom)") > -1 || caption == String.Empty)) // Only close non-builtin pop out panels
{
WindowManager.CloseWindow(hwnd);
}
else if (className == "AceApp" && caption.IndexOf("Microsoft Flight Simulator") == -1) // for builtin pop out (ATC, VFR Map, ect)
else if (className == "AceApp" && caption.IndexOf("Microsoft Flight Simulator") == -1) // For builtin pop out (ATC, VFR Map, ect)
{
WindowManager.MoveWindow(hwnd, 0, 0);
}

View file

@ -1,6 +1,9 @@
# Version History
<hr/>
## Version 3.3.7
* Fixed an issue where panel number circles are displayed at the wrong location instead of at the location where you clicked your mouse when setting monitor scale that is greater than 100% in Windows display setting.
## Version 3.3.6
* Hot Fix: Resolved an issue where panel separation fails if your MSFS game window is not on the same monitor as where the panels are initially popped out (upper left corner).

View file

@ -1,6 +1,8 @@
using MSFSPopoutPanelManager.Shared;
using MSFSPopoutPanelManager.Provider;
using MSFSPopoutPanelManager.Shared;
using System;
using System.Windows;
using System.Windows.Interop;
namespace MSFSPopoutPanelManager.WpfApp
{
@ -9,6 +11,9 @@ namespace MSFSPopoutPanelManager.WpfApp
private const int TOP_ADJUSTMENT = 23; // half of window height
private const int LEFT_ADJUSTMENT = 27; // half of window width
private int _leftCoor;
private int _topCoor;
public bool IsEditingPanelLocation { get; set; }
public IntPtr WindowHandle { get; set; }
@ -22,14 +27,25 @@ namespace MSFSPopoutPanelManager.WpfApp
IsEditingPanelLocation = false;
this.LocationChanged += PanelCoorOverlay_LocationChanged;
this.Loaded += PanelCoorOverlay_Loaded;
}
public void MoveWindow(int x, int y)
{
_leftCoor = x - LEFT_ADJUSTMENT;
_topCoor = y - TOP_ADJUSTMENT;
this.Left = x - LEFT_ADJUSTMENT;
this.Top = y - TOP_ADJUSTMENT;
}
private void PanelCoorOverlay_Loaded(object sender, System.EventArgs e)
{
// Fixed broken window left/top coordinate for DPI Awareness Per Monitor
var handle = new WindowInteropHelper(this).Handle;
WindowManager.MoveWindow(handle, _leftCoor, _topCoor);
}
private void PanelCoorOverlay_LocationChanged(object sender, EventArgs e)
{
if (this.Top is double.NaN || this.Left is double.NaN)