Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetMainWindowTitle()

unsafe string System.Diagnostics.Process.GetMainWindowTitle ( )
inlineprivate

Definition at line 2200 of file Process.cs.

2201 {
2203 if (mainWindowHandle == IntPtr.Zero)
2204 {
2205 return string.Empty;
2206 }
2207 int windowTextLengthW = global::Interop.User32.GetWindowTextLengthW(mainWindowHandle);
2208 if (windowTextLengthW == 0)
2209 {
2210 return string.Empty;
2211 }
2213 Span<char> span = ((windowTextLengthW > 256) ? ((Span<char>)new char[windowTextLengthW]) : stackalloc char[256]);
2215 fixed (char* lpString = span2)
2216 {
2217 windowTextLengthW = global::Interop.User32.GetWindowTextW(mainWindowHandle, lpString, span2.Length);
2218 }
2219 return span2.Slice(0, windowTextLengthW).ToString();
2220 }

References System.Runtime.Serialization.Dictionary, System.Diagnostics.Process.MainWindowHandle, and System.IntPtr.Zero.