Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
WindowService.cs
Go to the documentation of this file.
1using System;
3using SDL2;
4
5namespace ReLogic.OS.Windows;
6
8{
9 public float GetScaling()
10 {
11 try
12 {
14 int deviceCaps = NativeMethods.GetDeviceCaps(dC, NativeMethods.DeviceCap.VertRes);
15 return (float)NativeMethods.GetDeviceCaps(dC, NativeMethods.DeviceCap.DesktopVertRes) / (float)deviceCaps;
16 }
17 catch (Exception)
18 {
19 return 1f;
20 }
21 }
22
23 public void SetQuickEditEnabled(bool enabled)
24 {
26 if (NativeMethods.GetConsoleMode(stdHandle, out var lpMode))
27 {
28 lpMode = ((!enabled) ? (lpMode & ~NativeMethods.ConsoleMode.QuickEditMode) : (lpMode | NativeMethods.ConsoleMode.QuickEditMode));
29 NativeMethods.SetConsoleMode(stdHandle, lpMode);
30 }
31 }
32
33 public void SetUnicodeTitle(GameWindow window, string title)
34 {
35 SDL.SDL_SetWindowTitle(window.Handle, title);
36 }
37
38 public void StartFlashingIcon(GameWindow window)
39 {
41 NativeMethods.FlashWindowEx(ref flashInfo);
42 }
43
44 public void StopFlashingIcon(GameWindow window)
45 {
47 NativeMethods.FlashWindowEx(ref flashInfo);
48 }
49
50 public void HideConsole()
51 {
53 }
54}
static bool GetConsoleMode(IntPtr hConsoleHandle, out ConsoleMode lpMode)
static IntPtr GetDC(IntPtr hWnd)
static int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex)
static IntPtr GetStdHandle(StdHandleType nStdHandle)
static bool SetConsoleMode(IntPtr hConsoleHandle, ConsoleMode dwMode)
static bool FlashWindowEx(ref FlashInfo flashInfo)
void SetQuickEditEnabled(bool enabled)
void SetUnicodeTitle(GameWindow window, string title)
void StartFlashingIcon(GameWindow window)
void StopFlashingIcon(GameWindow window)
static FlashInfo CreateStop(IntPtr hWnd)
static FlashInfo CreateStart(IntPtr hWnd)
static readonly IntPtr Zero
Definition IntPtr.cs:18