You are viewing a potentially older version of this package.
View all versions.
BorderlessFullScreen
Quicker alt tabbing
Date uploaded | 7 months ago |
Version | 2.0.1 |
Download link | DeathWrench-BorderlessFullScreen-2.0.1.zip |
Downloads | 3422 |
Dependency string | DeathWrench-BorderlessFullScreen-2.0.1 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
Borderless Full Screen
- Game must be set to windowed mode for this to work properly.
-1.0.1: The mod will do this for you.
+2.0.0: Mod doesn't do this anymore to maintain compatibility with other games that can also utilize BepInEx, you can use the command below to ensure the game starts in windowed mode.
Launch Unity games in windowed mode with this command:
-screen-fullscreen 0
+2.0.0
No longer use Autohotkey.Interop dependency, instead just do what the ahk script did:
public class BorderlessFullScreenPlugin : BaseUnityPlugin
{
[DllImport("user32.dll")]
private static extern IntPtr FindWindow(string className, string windowName);
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int index);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int index, int value);
[DllImport("user32.dll")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int width, int height, uint flags);
private const int GWL_STYLE = -16;
private const uint SWP_FRAMECHANGED = 0x0020;
private const uint SWP_SHOWWINDOW = 0x0040;
private void Start()
{
IntPtr hWnd = FindWindow("UnityWndClass", null);
if (hWnd != IntPtr.Zero)
{
int style = GetWindowLong(hWnd, GWL_STYLE);
style &= ~0xC40000; // Remove WS_BORDER and WS_CAPTION
SetWindowLong(hWnd, GWL_STYLE, style);
SetWindowPos(hWnd, IntPtr.Zero, 0, 0, Screen.width, Screen.height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
}
else
{
Debug.LogError("Unity window not found.");
}
Debug.Log($"Plugin {"BorderlessFullscreen"} is loaded!");
}
}
Old Description for version 1.0.1
Uses AutoHotkey.Interop to execute the following AutoHotkey script into the game through BepInEx.
procName := "UnityWndClass"
WinGet Style, Style, % "ahk_class " procName
If (Style & 0xC40000)
{
WinSet, Style, -0xC40000, % "ahk_class " procName
WinMove, % "ahk_class " procName, , 0, 0, A_ScreenWidth + 1, A_ScreenHeight + 1
}
Return
The benefit of using this is so DXVK can run... as it seems to crash the game for anything other than windowed mode.
.ahk script modified from:
CHANGELOG
2.0.1
- Mostly github stuff, updated readme.
2.0.0
- Removed Autohotkey.Interop dependency
- Fix resolution problem once and for once and for all
- Removed automatically setting the game to windowed mode, as a result. This now works for other Unity games as long as they can also utilize BepInEx
1.0.1
- in 1.0.0 there was a chance to not work properly, so resolution is + 1 pixel taller and wider again.
1.0.0
- Fix resolution problem once and for all.
0.0.9
- Force the game into windowed mode if it's not.
0.0.8
- Fixed mod icon.
0.0.7
- Fix the resolution being slightly incorrect.
0.0.6
- Used a different code from StackOverflow that should only mess up now if another Unity game is active. Whereas before it would sometimes mess up if another window that had Lethal Company in it was present.
0.0.5
- Added AutoHotkey.Interop as a dependency to prevent future rejections.
0.0.4
A_ScreenWidth - 0, A_ScreenHeight - 0
toA_ScreenWidth + 1, A_ScreenHeight + 1
\ This arithmetic fixes the resolution problem at the cost of being a pixel wider and taller.
0.0.3
SetTitleMatchMode, RegEx
toSetTitleMatchMode, 2 SetTitleMatchMode, slow
- Removed
BepInEx 5.4.22.0 - Lethal Company
line, this makes it more consistent. A_ScreenWidth, A_ScreenHeight
changed toA_ScreenWidth - 0, A_ScreenHeight - 0
\ Should fix resolution being incorrect.
0.0.2
- Fixed readme.
- Added Return
0.0.1
- Release