1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 15:20:10 +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, BuiltInPopout,
CustomPopout, CustomPopout,
MSFSTouchPanel, MSFSTouchPanel,
WPFWindow WPFWindow,
MultiMonitorWindow
} }
} }

View file

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

View file

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

View file

@ -136,11 +136,14 @@ namespace MSFSPopoutPanelManager.Provider
var className = PInvoke.GetClassName(hwnd); var className = PInvoke.GetClassName(hwnd);
var caption = PInvoke.GetWindowText(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 if (className == "AceApp" && (caption.IndexOf("(Custom)") > -1 || caption == String.Empty)) // Only close non-builtin pop out panels
{ {
WindowManager.CloseWindow(hwnd); 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); WindowManager.MoveWindow(hwnd, 0, 0);
} }

View file

@ -1,6 +1,9 @@
# Version History # Version History
<hr/> <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 ## 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). * 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;
using System.Windows; using System.Windows;
using System.Windows.Interop;
namespace MSFSPopoutPanelManager.WpfApp namespace MSFSPopoutPanelManager.WpfApp
{ {
@ -9,6 +11,9 @@ namespace MSFSPopoutPanelManager.WpfApp
private const int TOP_ADJUSTMENT = 23; // half of window height private const int TOP_ADJUSTMENT = 23; // half of window height
private const int LEFT_ADJUSTMENT = 27; // half of window width private const int LEFT_ADJUSTMENT = 27; // half of window width
private int _leftCoor;
private int _topCoor;
public bool IsEditingPanelLocation { get; set; } public bool IsEditingPanelLocation { get; set; }
public IntPtr WindowHandle { get; set; } public IntPtr WindowHandle { get; set; }
@ -22,14 +27,25 @@ namespace MSFSPopoutPanelManager.WpfApp
IsEditingPanelLocation = false; IsEditingPanelLocation = false;
this.LocationChanged += PanelCoorOverlay_LocationChanged; this.LocationChanged += PanelCoorOverlay_LocationChanged;
this.Loaded += PanelCoorOverlay_Loaded;
} }
public void MoveWindow(int x, int y) public void MoveWindow(int x, int y)
{ {
_leftCoor = x - LEFT_ADJUSTMENT;
_topCoor = y - TOP_ADJUSTMENT;
this.Left = x - LEFT_ADJUSTMENT; this.Left = x - LEFT_ADJUSTMENT;
this.Top = y - TOP_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) private void PanelCoorOverlay_LocationChanged(object sender, EventArgs e)
{ {
if (this.Top is double.NaN || this.Left is double.NaN) if (this.Top is double.NaN || this.Left is double.NaN)