///SOURCE: http://forum.unity3d.com/threads/window-manipulation-in-unity.84252/ using UnityEngine; using System.Collections; using System.Runtime.InteropServices; using System; using System.Diagnostics; public class windowMod : MonoBehaviour { [DllImport("user32.dll")] static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); // HWND WINAPI GetForegroundWindow(void); string word; void Start() { if (Application.platform == RuntimePlatform.WindowsPlayer) { const uint SWP_NOMOVE = 0X2; const uint SWP_NOSIZE = 1; const uint SWP_NOZORDER = 0X4; const uint SWP_SHOWWINDOW = 0x0040; const uint SWP_HIDEWINDOW = 0x0080; //some if not all of these instructions seem to be unnecessary but like, I don't understand the script so not taking any risk (y) const int HWND_TOPMOST = -1; word = GetForegroundWindow().ToString(); bool a = SetWindowPos(GetForegroundWindow(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); } } }