Alright, so I'm trying to experiment with consoles in RPG Maker using Windows functions, of which my knowledge is limited...
My code for creating a new console:
Win32API.new('kernel32.dll', 'AllocConsole', '', '').callWin32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call(title)$stdin.reopen('CONIN$')$stdout.reopen('CONOUT$')And after I create a console, I dispose of it by running the code below
My code for closing it:
Win32API.new('kernel32.dll', 'FreeConsole', '', '').callhandle = Win32API.new('kernel32.dll', 'GetConsoleWindow', '', '').callWin32API.new('user32.dll', 'DestroyWindow', 'P','').call(handle)The code compiles without error, but the console window does not close. I guess the problem might have something to do with the console not being a "Window" although I would think it is. Also, I'm not sure what the 3rd and 4th parameters for the Win32API.new method are supposed to be...
Any help would be much appreciated.
My code for creating a new console:
Win32API.new('kernel32.dll', 'AllocConsole', '', '').callWin32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call(title)$stdin.reopen('CONIN$')$stdout.reopen('CONOUT$')And after I create a console, I dispose of it by running the code below
My code for closing it:
Win32API.new('kernel32.dll', 'FreeConsole', '', '').callhandle = Win32API.new('kernel32.dll', 'GetConsoleWindow', '', '').callWin32API.new('user32.dll', 'DestroyWindow', 'P','').call(handle)The code compiles without error, but the console window does not close. I guess the problem might have something to do with the console not being a "Window" although I would think it is. Also, I'm not sure what the 3rd and 4th parameters for the Win32API.new method are supposed to be...
Any help would be much appreciated.