FillConsoleOutputCharacterA seems to be requiring a c_char, not a c_wchar

This commit is contained in:
Thomas Nagy 2014-01-06 01:01:10 +01:00
parent 001488b8d3
commit 5c85d5907d
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 4 additions and 4 deletions

View File

@ -11,13 +11,13 @@ console commands.
"""
import re, sys, time
import re, sys
from waflib.Utils import threading
wlock = threading.Lock()
try:
from ctypes import Structure, windll, c_short, c_ushort, c_ulong, c_int, byref, c_wchar, GetLastError, POINTER, c_long
from ctypes import Structure, windll, c_short, c_ushort, c_ulong, c_int, byref, c_char, POINTER, c_long
except ImportError:
class AnsiTerm(object):
@ -126,7 +126,7 @@ else:
line_start = sbinfo.CursorPosition
line_length = sbinfo.Size.X - sbinfo.CursorPosition.X
chars_written = c_int()
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole, c_wchar(' '), line_length, line_start, byref(chars_written))
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole, c_char(' '), line_length, line_start, byref(chars_written))
windll.kernel32.FillConsoleOutputAttribute(self.hconsole, sbinfo.Attributes, line_length, line_start, byref(chars_written))
def clear_screen(self, param):
@ -143,7 +143,7 @@ else:
clear_start = sbinfo.CursorPosition
clear_length = ((sbinfo.Size.X - sbinfo.CursorPosition.X) + sbinfo.Size.X * (sbinfo.Size.Y - sbinfo.CursorPosition.Y))
chars_written = c_int()
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole, c_wchar(' '), clear_length, clear_start, byref(chars_written))
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole, c_char(' '), clear_length, clear_start, byref(chars_written))
windll.kernel32.FillConsoleOutputAttribute(self.hconsole, sbinfo.Attributes, clear_length, clear_start, byref(chars_written))
def push_cursor(self, param):