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

Version 2.0.1

This commit is contained in:
hawkeye 2021-10-07 09:40:21 -04:00
parent b842428d27
commit be6932d46e
4 changed files with 12 additions and 20 deletions

View file

@ -5,7 +5,7 @@
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<Platforms>x64</Platforms>
<Version>2.0</Version>
<Version>2.0.1</Version>
<AssemblyName>MSFSPopoutPanelManager</AssemblyName>
<RootNamespace>MSFSPopoutPanelManager</RootNamespace>
<ApplicationIcon>WindowManager.ico</ApplicationIcon>

View file

@ -28,7 +28,7 @@ namespace MSFSPopoutPanelManager
var processZero = GetProcessZero();
// Move process zero childs back into simulator process
MoveChildWindowsIntoSimulatorPrcess(simulatorProcess, processZero);
MoveChildWindowsIntoSimulatorProcess(simulatorProcess, processZero);
if (simulatorProcess.ChildWindows.Count > 0)
{
@ -49,7 +49,7 @@ namespace MSFSPopoutPanelManager
// Now all newly pop out windows are in process zero, move them into flight simulator process
processZero = GetProcessZero();
MoveChildWindowsIntoSimulatorPrcess(simulatorProcess, processZero);
MoveChildWindowsIntoSimulatorProcess(simulatorProcess, processZero);
// Analyze the content of the pop out panels
AnalyzePopoutWindows(simulatorProcess, profileId);
@ -136,7 +136,7 @@ namespace MSFSPopoutPanelManager
return String.IsNullOrEmpty(title.ToString()) ? null : title.ToString();
}
private void MoveChildWindowsIntoSimulatorPrcess(WindowProcess simulatorProcess, WindowProcess processZero)
private void MoveChildWindowsIntoSimulatorProcess(WindowProcess simulatorProcess, WindowProcess processZero)
{
// The popout windows such as PFD and MFD attached itself to main window for Process ID zero instead of the MSFS process.
// Moving these windows back into MSFS main window
@ -238,14 +238,13 @@ namespace MSFSPopoutPanelManager
var rect = new Rect();
PInvoke.GetClientRect(windowHandle, out rect);
switch (rect.Right)
switch (rect.Bottom)
{
case 1920:
case 1080:
return FlightSimResolution.HD;
case 2560:
case 3440:
case 1440:
return FlightSimResolution.QHD;
case 3840:
case 2160:
return FlightSimResolution.UHD;
default:
return FlightSimResolution.QHD;
@ -327,9 +326,9 @@ namespace MSFSPopoutPanelManager
var point = new Point { X = x, Y = y };
Cursor.Position = new Point(point.X, point.Y);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, point.X, point.Y, 0, 0);
Thread.Sleep(200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, point.X, point.Y, 0, 0);
}
private void AnalyzePopoutWindows(WindowProcess simulatorProcess, int profileId)

View file

@ -42,17 +42,8 @@ namespace MSFSPopoutPanelManager
const uint KEYEVENTF_KEYUP = 0x2;
const uint VK_RMENU = 0xA5; // Right Alternate key
//const int WM_LBUTTONDOWN = 0x201;
//const int WM_LBUTTONUP = 0x202;
foreach (var coor in screenCoordinates)
{
//PInvoke.keybd_event(Convert.ToByte(VK_RMENU), 0, KEYEVENTF_EXTENDEDKEY, 0);
//PInvoke.SendMessage(simulatorHandle, WM_LBUTTONDOWN, 1, CreateLParam(coor.X, coor.Y));
//Thread.Sleep(200);
//PInvoke.SendMessage(simulatorHandle, WM_LBUTTONUP, 0, CreateLParam(coor.X, coor.Y));
//PInvoke.keybd_event(Convert.ToByte(VK_RMENU), 0, KEYEVENTF_KEYUP, 0);
// Move the cursor to the flight simulator screen then move the cursor into position
PInvoke.SetCursorPos(0, 0);
PInvoke.SetCursorPos(coor.X, coor.Y);

View file

@ -1,5 +1,7 @@
# Version History
<hr/>
## Vesion 2.0.1.0
* Change how screen resolution is detected. Used vertical instead of horizontal resolution to account for ultra wide monitors.
## Version 2.0.0.0
* Used new image recognition instead of OCR technology to determine pop outs.