Current Conclusion:In Main, right under the line that says
begin, paste this:
# Disable ALT+Enter
reghotkey = Win32API.new('user32', 'RegisterHotKey', 'LIII', 'I')
reghotkey.call(0, 1, 1, 0x0D)
If you are using the script that puts the game into fullscreen by simulating an ALT+Enter keypress, make sure that is placed before this.
People have been asking for ways to disable the player's ability to press ALT+Enter to go into (or get out of) fullscreen-mode for years now. I am unsure if there really is a "fix-all" for this, but I have taken action to see if perhaps there is.
I found a DLL made by Cremno that can disable ALT+Enter.
Get the DLL here:
http://www.mediafire.com/download/ffr36fml1cua73r/NoF12.dllPut the file into a blank test project.
Replace Main with this:
begin
# Disable ALT+Enter
noaltenter = Win32API.new('NoF12', 'NoAltEnter', 'L', nil)
noaltenter.call(1)
# Prepare for transition
Graphics.freeze
# Make scene object (title screen)
$scene = Scene_Title.new
# Call main method as long as $scene is effective
while $scene != nil
$scene.main
end
# Fade out
Graphics.transition(20)
rescue Errno::ENOENT
# Supplement Errno::ENOENT exception
# If unable to open file, display message and end
filename = $!.message.sub("No such file or directory - ", "")
print("Unable to find file #{filename}.")
end
Now testplay and see if you can get into fullscreen.
Coming from
this post, I believed to have found a solution.
You can copy this script and replace Main with it. The change is only the first few lines. Try this out in a new project.
begin
# Disable ALT+Enter
reghotkey = Win32API.new('user32', 'RegisterHotKey', 'LIII', 'I')
result = reghotkey.call(0, 1, 0x4001, 0x0D)
if result != 0 then print 'RegisterHotKey successfully completed' end
# Prepare for transition
Graphics.freeze
# Make scene object (title screen)
$scene = Scene_Title.new
# Call main method as long as $scene is effective
while $scene != nil
$scene.main
end
# Fade out
Graphics.transition(20)
rescue Errno::ENOENT
# Supplement Errno::ENOENT exception
# If unable to open file, display message and end
filename = $!.message.sub("No such file or directory - ", "")
print("Unable to find file #{filename}.")
end
If the method was successful, you should have a message window pop-up to confirm that. Try using ALT+Enter and see if it does anything. If you cannot toggle between fullscreen and windowed mode, insert this little snippet in just above Main:
class Scene_Map
alias check_for_alt_enter update
def update
if Input.trigger?(Input::ALT) && Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
end
check_for_alt_enter
end
end
Try pressing ALT+Enter and ALT+C (or whatever is your confirm button). If you pressed these buttons at the same time, you should hear the beep for ALT+C but not for ALT+Enter.
Now try running another game
with this one still open. Can you ALT+Enter into fullscreen? I couldn't, not until I closed this game's window first.
However, LiTTleDRAgo reported that this method did not work for him. To help with this investigation, I would like you, the users, to help me out. Please try the two methods above and report whether or not ALT+Enter was disabled.
Also, please provide your OS and keyboard model. For me, I have tested this only on a NV59 Gateway laptop with the built-in keyboard running on Windows 7.