窗口标题栏和统一

时间:2018-12-21 12:23:11

标签: unity3d windows-10 titlebar

如何更改Windows 10版本的标题栏的颜色?附件中的屏幕截图是一个示例。另外,我们如何以编程方式最大化窗口? Screen.SetResolution仅更改屏幕尺寸。它不会最大化窗口。

Screenshot

1 个答案:

答案 0 :(得分:0)

以下是Unity论坛中的一些代码:

 //Import the following.
 [DllImport("user32.dll", EntryPoint = "SetWindowText")]
 public static extern bool SetWindowText(System.IntPtr hwnd, System.String lpString);
 [DllImport("user32.dll", EntryPoint = "FindWindow")]
 public static extern System.IntPtr FindWindow(System.String className, System.String windowName); //Get the window handle.
 windowPtr = FindWindow(null, "Old Window Title"); //Set the title text using the window handle.
 SetWindowText(windowPtr, "New Window Title - Yayyy");

Link to Unity Forum