mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-27 04:15:00 +01:00
Invalid parameter type c_int passed to FillConsoleOutputCharacterA
This commit is contained in:
parent
b2eb048d86
commit
cb3950ed1c
@ -3,7 +3,7 @@ try:
|
||||
if not (sys.stderr.isatty() and sys.stdout.isatty()):
|
||||
raise ValueError('not a tty')
|
||||
|
||||
from ctypes import Structure, windll, c_short, c_ushort, c_ulong, c_int, byref, c_wchar, POINTER, c_long, c_char
|
||||
from ctypes import Structure, windll, c_short, c_ushort, c_ulong, c_int, byref, POINTER, c_long, c_char
|
||||
|
||||
class COORD(Structure):
|
||||
_fields_ = [("X", c_short), ("Y", c_short)]
|
||||
@ -86,8 +86,8 @@ else:
|
||||
else: # Clear from cursor position to end of line
|
||||
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))
|
||||
chars_written = c_ulong()
|
||||
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):
|
||||
@ -103,8 +103,8 @@ else:
|
||||
else: # Clear from cursor position to end of screen
|
||||
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))
|
||||
chars_written = c_ulong()
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user