public static void SetWindowTitle(string title) { #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN // 1) get the current window handle. IntPtr windowHandle = WindowUtils.GetWindowHandle(); // 2) set the window title, if we got something. if (windowHandle != IntPtr.Zero) { SetWindowText(windowHandle, title); } #endif }
public static void SetPositionAndSize(int x, int y, int resX, int resY) { #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN // 1) get the current window handle. IntPtr windowHandle = WindowUtils.GetWindowHandle(); // 2) offset and position the window, if we got something. if (windowHandle != IntPtr.Zero) { SetWindowPos(windowHandle, 0 /*HWND_TOP*/, x, y, resX, resY, 0 /*No extra flags*/); } #endif }
public static void RemoveBorder() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN // 1) get the current window handle. IntPtr windowHandle = WindowUtils.GetWindowHandle(); // 2) clear out the window style flags by setting style to visible only if (windowHandle != IntPtr.Zero) { SetWindowLong(windowHandle, (int)WindowLongFlags.GWL_STYLE, (uint)WindowStyles.WS_VISIBLE); } #endif }