- Home /
How can i change the title of the standalone player window?
Answer by jiteshvm · Jul 26, 2011 at 08:56 PM
//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");
Heh was just kidding. I know you can't get user32.dll on $$anonymous$$acs. :)
Unfortunately this only changes the name of the first window found when searching for the old name - which not necessarily is the window of your stand-alone build.
To confirm this just create a text file called "Old Window Title.txt", open it with Notepad and afterwards run your stand-alone build. Now the window title of Notepad will be changed (at least it does so on my computer).
That's a good point. Using GetActiveWindow
rather than FindWindow
seems to work and it doesn't rely on the name of the current window.
Answer by uldall · Dec 12, 2012 at 08:48 AM
You can change it for cross platform here: Edit > Project Settings > Player > Product Name
Answer by Strangertoyourlife · Sep 19, 2018 at 11:37 AM
I was having trouble getting this to work. I did finally get this to work and it is great! Here is how I formatted it:
Your answer
Follow this Question
Related Questions
Windows Unity Aplicaction on Extend Screen 0 Answers
Window title on standalone says "Conform_Terrain". How do I change this? 1 Answer
How to change the title of the standalone Mac player window after launch? 1 Answer
Start Fullscreen with title/quick launch bars still visible 1 Answer
Hiccups, simple lines of code sometimes taking several milliseconds 1 Answer