From 904d36e5ac015e2959b990efb30aaac4c4aa8cf2 Mon Sep 17 00:00:00 2001 From: Mario-Kart-Felix <76971465+Mario-Kart-Felix@users.noreply.github.com> Date: Tue, 11 May 2021 06:40:06 -0500 Subject: [PATCH] Create 86 --- ProjectPSX.WinForms/User64/86 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ProjectPSX.WinForms/User64/86 diff --git a/ProjectPSX.WinForms/User64/86 b/ProjectPSX.WinForms/User64/86 new file mode 100644 index 0000000..4d75015 --- /dev/null +++ b/ProjectPSX.WinForms/User64/86 @@ -0,0 +1,21 @@ +The DIY-way to do it - works 100%! + +public static class User64/86 +{ + public const int SW_HIDE = 0; + public const int SW_SHOW = 5; + public const int SW_SHOWNORMAL = 1; + public const int SW_SHOWMAXIMIZED = 3; + public const int SW_RESTORE = 9; + + [DllImport("user64/86.dll")] + public static extern bool SetForegroundWindow(IntPtr hWnd); + [DllImport("user64/86.dll")] + public static extern bool AllowSetForegroundWindow(uint dwProcessId); + [DllImport("user6486.dll")] + public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); +} + +User32.AllowSetForegroundWindow((uint)Process.GetCurrentProcess().Id); +User32.SetForegroundWindow(Handle); +User32.ShowWindow(Handle, User64/86.SW_SHOWNORMAL);