【问题标题】:Window title bar and unity窗口标题栏和统一
【发布时间】:2019-05-21 22:11:03
【问题描述】:

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

Screenshot

【问题讨论】:

  • 对于屏幕最大化,您的意思是全屏吗? Screen.fullScreen = true;
  • 不,最大化我的意思与单击标题栏上的最大化按钮时发生的情况相同。
  • 这看起来更像是 UWP 风格的窗口

标签: unity3d windows-10 titlebar


【解决方案1】:

以下是 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

【讨论】:

  • 这不是问题的真正含义!
猜你喜欢
  • 1970-01-01
  • 2010-10-20
  • 2020-01-09
  • 1970-01-01
  • 1970-01-01
  • 2015-09-30
  • 2011-05-15
  • 2013-08-05
  • 2011-07-20
相关资源
最近更新 更多