mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 09:49:16 +01:00
a66878498e
Record 360 controls using your DualShock 4 (PS: any old macros using hold control while running macro may be set to a new control when loaded, please re save your macro) Macro recording now happens in the select an action window instead of a separate one Save and Load Macro presets to use any time When recording with delays (recommend for X360 macros) you can double click on delays to edit the time When recording a new macro, previously saved Macros for that control are shown Many minor Macro fixes Giving major updates useless names that will never be seen outside of this changelog Icon Update Fixed shift modifier lightbar settings blocked off High DPI support (144+) Fixed various bugs at 120 DPI and higher When installing the ds4 driver, Actually checks if the driver got installed instead of always saying install complete
65 lines
2.2 KiB
C#
65 lines
2.2 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using System.Threading;
|
|
using System.Runtime.InteropServices;
|
|
using System.Diagnostics;
|
|
|
|
|
|
namespace ScpServer
|
|
{
|
|
static class Program
|
|
{
|
|
[DllImport("user32.dll")]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
static extern bool SetForegroundWindow(IntPtr hWnd);
|
|
|
|
[DllImport("user32.dll")]
|
|
private static extern IntPtr GetForegroundWindow();
|
|
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main(string [] args)
|
|
{
|
|
System.Runtime.GCSettings.LatencyMode = System.Runtime.GCLatencyMode.LowLatency;
|
|
try
|
|
{
|
|
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.High;
|
|
}
|
|
catch
|
|
{
|
|
// Ignore problems raising the priority.
|
|
}
|
|
bool createdNew = true;
|
|
using (Mutex mutex = new Mutex(true, "MyApplicationName", out createdNew))
|
|
{
|
|
if (createdNew)
|
|
{
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new DS4Form(args));
|
|
}
|
|
else
|
|
{
|
|
Process current = Process.GetCurrentProcess();
|
|
foreach (Process process in Process.GetProcessesByName("DS4Windows"))
|
|
{
|
|
if (process.Id != current.Id)
|
|
{
|
|
SetForegroundWindow(process.MainWindowHandle);
|
|
if (GetForegroundWindow() != process.MainWindowHandle) //if tool is minimized to tray
|
|
{
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new Alreadyrunning());
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|