Skip to content

Commit

Permalink
Feature: Allocate console
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongMods committed Sep 16, 2023
1 parent 1bb38d8 commit 0410fbf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions strongmod/strongmod/init.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import ctypes
from ctypes import CDLL
from ctypes import CFUNCTYPE, c_void_p
Expand All @@ -13,6 +14,14 @@
t = Thread(target=CFUNCTYPE(c_void_p)(entry))
t.start()

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
kernel32.AllocConsole()

sys.stdout = open('CONOUT$', 'w')
sys.stderr = open('CONOUT$', 'w')

sys.stdin = open('CONIN$', 'r')


@ctypes.CFUNCTYPE(ctypes.c_void_p)
def handle_ui_tick_event():
Expand Down

0 comments on commit 0410fbf

Please sign in to comment.