Hide Game Window's Border, Close/Alt+F4 canceler

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
183
First Language
Meowish
Primarily Uses
Made this for a request and sharing it here in case anyone else needs it.

Even with all the hates, there still seems to have quite a demand for this.

Just to clarify in case some one started to post something negative about this:

I know, taking away close button is cruel and not fun. I don't like this type of game myself, nor will i ever play this kind of game. But this script is made on demand for those who wanted the hate of their players. :p  Those who tries to build a game with no returns, doesn't want their player to quit without save and exit. etc etc.. ;)

What it Does:

This script takes away the user's ability to exit the window using the close [X] button/clicking the logo/using Alt + F4.

This script also fully hides the "border" of the game window, making it border-less.

IMPORTANT NOTE: This script can do nothing about the "Task Manager Close"/"Pull The Plug" options.

How it Works:

Plug & Play, simply paste this script below Material and above Main.

Compatiblity:

Should work with other scripts unless they modify the window border/class using win32api.

Terms of Use:

Feel free to use it any way you like for both commercial/free games.

Script:

Code:
#==============================================================================# ■ Meow Face Exit Canceler#------------------------------------------------------------------------------# Hide Game Window's Border, Disable Close Button and Alt + F4#==============================================================================# How to Use:# Plug & Play, Put this script below Material and above Main#==============================================================================MF_GPPSA = Win32API.new('kernel32', 'GetPrivateProfileStringA', 'PPPPLP', 'L')MF_FW = Win32API.new('user32', 'FindWindow', 'pp', 'l')MF_SCL = Win32API.new('user32', 'SetClassLong', 'lil', 'i')MF_SWL = Win32API.new('user32', 'SetWindowLong', 'iii', 'i')MF_TITLE = " " * 256MF_GPPSA.call('Game','Title','',MF_TITLE,256,".\\Game.ini")MF_TITLE.delete!(" ")MF_HWND = MF_FW.call('RGSS Player', MF_TITLE)MF_SCL.call(MF_HWND, -26, 0x0200)MF_SWL.call(MF_HWND, -16, 0x14000000)
 
Last edited by a moderator:

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
658
Reaction score
1,118
First Language
English
Primarily Uses
N/A
Fixed script format, credit Meow Face.
Code:
#==============================================================================
# ■ Meow Face Exit Canceler
#------------------------------------------------------------------------------
# Hide Game Window's Border, Disable Close Button and Alt + F4
#==============================================================================
# How to Use:
# Plug & Play, Put this script below Material and above Main
#==============================================================================
MF_GPPSA = Win32API.new('kernel32', 'GetPrivateProfileStringA', 'PPPPLP', 'L')
MF_FW = Win32API.new('user32', 'FindWindow', 'pp', 'l')
MF_SCL = Win32API.new('user32', 'SetClassLong', 'lil', 'i')
MF_SWL = Win32API.new('user32', 'SetWindowLong', 'iii', 'i')
MF_TITLE = " " * 256
MF_GPPSA.call('Game','Title','',MF_TITLE,256,".\\Game.ini")
MF_TITLE.delete!(" ")
MF_HWND = MF_FW.call('RGSS Player', MF_TITLE)
MF_SCL.call(MF_HWND, -26, 0x0200)
MF_SWL.call(MF_HWND, -16, 0x14000000)
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
424
Reaction score
8
First Language
english
Primarily Uses
RMVXA
just so you know this script doesn't work. I put it in my game and when i test played it nothing happened
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
658
Reaction score
1,118
First Language
English
Primarily Uses
N/A
@slickdeath97



Could you list the scripts you used for the game you tested? Some scripts don't work well together or cause something to cancel the function of another.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,500
Reaction score
531
First Language
English
Primarily Uses
RMVXA
list the scripts you used
script doesn't work
The script does work, I just did some testing and discovered that it will not work only if the name of your game has spaces in it.
This is my game <- will not work
This_is_my_game <- will work

Also note that if you have zeus fullscreen script, you need to comment out one line otherwise the borders come back
under
def windowed_mode
comment out
# show_borders
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Latest member to OcRam -plugin suite: OcRam_Layers! Optimized parallax layers (for parallax mapping?) + dynamic layers which can be used in title-, battle and map scenes!
People convinced me to use my old graphics for this new project, i guess i can't run away from blender just yet. https://gyazo.com/2a105847c042bb78c6d4919ec1308660
10/24 done :3 Maybe I can finish 11 and 12 this weekend^^

Forum statistics

Threads
102,960
Messages
996,281
Members
134,424
Latest member
ninnaeis
Top