In the same way Borderless Gaming do it, here is what i use:
Install AutoIt (if you want), and in your game folder create a new script.
Right-click > New text document > rename the extension to .au3 (or create a .au3 directly if your system shows extensions).
Then edit the content with:
#include <WinAPI.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
HotKeySet("{F11}", "_ToggleFS")
Global $gamepath = @ScriptDir & "\Mudrock.exe" ; Relative path, change for another game
Global $title = "Created with GameMaker" ; Window title, change for another game
Global $isFS = False
Global $styleBackup = 0
Run($gamepath)
WinWait($title, "")
_ToggleFS()
Func _ToggleFS()
Local $hWnd = WinGetHandle($title)
If Not $hWnd Then Return
If Not $isFS Then
$styleBackup = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
Local $w = @DesktopWidth
Local $h = @DesktopHeight
Local $style = $styleBackup
$style = BitAND($style, BitNOT($WS_CAPTION))
$style = BitAND($style, BitNOT($WS_THICKFRAME))
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $style)
_WinAPI_SetWindowPos($hWnd, 0, 0, 0, $w, $h, $SWP_SHOWWINDOW)
$isFS = True
Else
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $styleBackup)
_WinAPI_SetWindowPos($hWnd, 0, 100, 100, 1280, 720, $SWP_SHOWWINDOW)
$isFS = False
EndIf
EndFunc
While 1
Sleep(1200)
If Not ProcessExists("Mudrock.exe") Then Exit
WEnd
;=====================> End of the script
Three ways to run it:
Using SciTE (the editor included with AutoIt): press F5 to run the script.
Compile the script to an exe, then run it. (Dont trust window about virus if you get a notification, its a false positive you can read the code yourself.)
Right-click the .au3 file and select Run Script.